Skip to content

Commit 7f237b8

Browse files
feat(i18n): add Arabic, Bengali, Hindi locales (now 15 languages total)
1 parent 91e4103 commit 7f237b8

4 files changed

Lines changed: 12106 additions & 1 deletion

File tree

frontend/src/lib/i18n.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@ import nl from '@/locales/nl.json';
1313
import es from '@/locales/es.json';
1414
import uk from '@/locales/uk.json';
1515
import ru from '@/locales/ru.json';
16+
import ar from '@/locales/ar.json';
17+
import bn from '@/locales/bn.json';
18+
import hi from '@/locales/hi.json';
1619

1720
export const supportedLanguages = [
18-
'en', 'ja', 'zh', 'de', 'ko', 'fr', 'pt-BR', 'it', 'nl', 'es', 'uk', 'ru',
21+
'en', 'ja', 'zh', 'de', 'ko', 'fr', 'pt-BR', 'it', 'nl', 'es', 'uk', 'ru', 'ar', 'bn', 'hi',
1922
] as const;
2023
export type SupportedLanguage = (typeof supportedLanguages)[number];
2124

@@ -32,8 +35,17 @@ export const languageNames: Record<SupportedLanguage, string> = {
3235
es: 'Español',
3336
uk: 'Українська',
3437
ru: 'Русский',
38+
ar: 'العربية',
39+
bn: 'বাংলা',
40+
hi: 'हिन्दी',
3541
};
3642

43+
// Languages that require right-to-left text direction.
44+
export const rtlLanguages: readonly SupportedLanguage[] = ['ar'];
45+
46+
export const isRtlLanguage = (lang: string): boolean =>
47+
rtlLanguages.includes(lang as SupportedLanguage);
48+
3749
i18n
3850
.use(LanguageDetector)
3951
.use(initReactI18next)
@@ -51,6 +63,9 @@ i18n
5163
es: { translation: es },
5264
uk: { translation: uk },
5365
ru: { translation: ru },
66+
ar: { translation: ar },
67+
bn: { translation: bn },
68+
hi: { translation: hi },
5469
},
5570
fallbackLng: 'en',
5671
supportedLngs: supportedLanguages,

0 commit comments

Comments
 (0)