feat(i18n): add full Arabic (ar) translation

Adds a complete Arabic locale (2759 keys, full parity with en) and wires
it into routing, RTL direction detection, message loading, the language
switcher, and flag icons alongside the existing he/fa RTL locales.
This commit is contained in:
xhzeem
2026-07-21 23:07:40 +02:00
committed by Linus Rath
parent 3dceecb4c5
commit fda898fc96
6 changed files with 3285 additions and 3 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
// RTL locales: Hebrew (he) and Persian/Farsi (fa). Everything else is LTR.
const rtlLocales = new Set(['he', 'fa']);
// RTL locales: Arabic (ar), Hebrew (he), and Persian/Farsi (fa). Everything else is LTR.
const rtlLocales = new Set(['ar', 'he', 'fa']);
export function getLocaleDirection(locale: string): 'ltr' | 'rtl' {
return rtlLocales.has(locale) ? 'rtl' : 'ltr';
+3
View File
@@ -33,6 +33,9 @@ export default getRequestConfig(async ({ requestLocale }) => {
// Use static imports for better compatibility
let messages;
switch (locale) {
case 'ar':
messages = (await import('../locales/ar/common.json')).default;
break;
case 'cs':
messages = (await import('../locales/cs/common.json')).default;
break;
+1 -1
View File
@@ -12,7 +12,7 @@ const localePrefix = (process.env.NEXT_PUBLIC_LOCALE_PREFIX ?? 'never') as
| 'always'
| 'as-needed';
const SUPPORTED_LOCALES = ['cs', 'da', 'de', 'en', 'es', 'fa', 'fr', 'he', 'hu', 'it', 'ja', 'ko', 'lv', 'nl', 'pl', 'pt', 'ro', 'ru', 'sk', 'tr', 'uk', 'zh'] as const;
const SUPPORTED_LOCALES = ['ar', 'cs', 'da', 'de', 'en', 'es', 'fa', 'fr', 'he', 'hu', 'it', 'ja', 'ko', 'lv', 'nl', 'pl', 'pt', 'ro', 'ru', 'sk', 'tr', 'uk', 'zh'] as const;
// Fallback locale used when the visitor's Accept-Language header does not
// match any supported locale (and no NEXT_LOCALE cookie is set yet). Admins