// Supported locales for the app. fa-IR is the default (Persian, RTL); en-US is // the secondary (English, LTR). Routing is path-prefixed: /fa-IR/... , /en-US/... export const locales = ['fa-IR', 'en-US'] as const; export type Locale = (typeof locales)[number]; export const defaultLocale: Locale = 'fa-IR'; export const localeDirection: Record = { 'fa-IR': 'rtl', 'en-US': 'ltr', }; // Short, human-facing labels for the language switcher. export const localeNames: Record = { 'fa-IR': 'فارسی', 'en-US': 'English', }; export const LOCALE_COOKIE = 'NEXT_LOCALE'; export function isLocale(value: string | undefined | null): value is Locale { return !!value && (locales as readonly string[]).includes(value); } export function dirFor(locale: Locale): 'rtl' | 'ltr' { return localeDirection[locale]; }