feat: add next-international translations (#2)

* feat: add next-international translations
* chore: fix formatting
* chore: address pull request feedback
This commit is contained in:
Meier Lukas
2023-12-19 23:09:41 +01:00
committed by GitHub
parent 3cedb7fba5
commit a082f70470
24 changed files with 290 additions and 27 deletions

View File

@@ -0,0 +1,17 @@
import { supportedLanguages } from ".";
const enTranslations = () => import("./lang/en");
export const languageMapping = () => {
const mapping: Record<string, unknown> = {};
for (const language of supportedLanguages) {
mapping[language] = () =>
import(`./lang/${language}`) as ReturnType<typeof enTranslations>;
}
return mapping as Record<
(typeof supportedLanguages)[number],
() => ReturnType<typeof enTranslations>
>;
};