Add FA, EN, and AR static copy, with English LTR and catalog hidden outside Persian.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Alireza Hassani
2026-08-31 17:29:24 +03:30
co-authored by Cursor
parent 51fb9f6a26
commit 6543c994c3
27 changed files with 1395 additions and 368 deletions
+14
View File
@@ -0,0 +1,14 @@
import { ar } from "@/i18n/ar";
import { defaultLocale, isLocale, type Locale } from "@/i18n/config";
import { en } from "@/i18n/en";
import { fa, type Messages } from "@/i18n/fa";
export const dictionaries: Record<Locale, Messages> = { fa, en, ar };
export function getMessages(locale: Locale | string | null | undefined): Messages {
return dictionaries[isLocale(locale) ? locale : defaultLocale];
}
export function interpolate(template: string, vars: Record<string, string>) {
return Object.entries(vars).reduce((text, [key, value]) => text.split(`{${key}}`).join(value), template);
}