feat: add next-international translations (#2)
* feat: add next-international translations * chore: fix formatting * chore: address pull request feedback
This commit is contained in:
17
packages/translation/src/lang.ts
Normal file
17
packages/translation/src/lang.ts
Normal 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>
|
||||
>;
|
||||
};
|
||||
Reference in New Issue
Block a user