feat(i18n): add Farsi (fa) language support (#2385)

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Arash Kadkhodaei
2026-07-05 17:38:17 +07:00
committed by decolua
co-authored by Cursor
parent 46e6c01a01
commit b6454d84da
4 changed files with 267 additions and 31 deletions
+69 -30
View File
@@ -1,41 +1,77 @@
export const LOCALES = ["en", "vi", "zh-CN", "zh-TW", "ja", "pt-BR", "pt-PT", "ko", "es", "de", "fr", "he", "ar", "ru", "pl", "cs", "nl", "tr", "uk", "tl", "id", "th", "hi", "bn", "ur", "ro", "sv", "it", "el", "hu", "fi", "da", "no"];
export const LOCALES = [
"en",
"vi",
"zh-CN",
"zh-TW",
"ja",
"pt-BR",
"pt-PT",
"ko",
"es",
"de",
"fr",
"he",
"ar",
"ru",
"pl",
"cs",
"nl",
"tr",
"uk",
"tl",
"id",
"th",
"hi",
"bn",
"ur",
"ro",
"sv",
"it",
"el",
"hu",
"fi",
"da",
"no",
"fa",
];
export const DEFAULT_LOCALE = "en";
export const LOCALE_COOKIE = "locale";
export const LOCALE_NAMES = {
"en": "English",
"vi": "Tiếng Việt",
en: "English",
vi: "Tiếng Việt",
"zh-CN": "简体中文",
"zh-TW": "繁體中文",
"ja": "日本語",
ja: "日本語",
"pt-BR": "Português (Brasil)",
"pt-PT": "Português (Portugal)",
"ko": "한국어",
"es": "Español",
"de": "Deutsch",
"fr": "Français",
"he": "עברית",
"ar": "العربية",
"ru": "Русский",
"pl": "Polski",
"cs": "Čeština",
"nl": "Nederlands",
"tr": "Türkçe",
"uk": "Українська",
"tl": "Tagalog",
"id": "Indonesia",
"th": "ไทย",
"hi": "हिन्दी",
"bn": "বাংলা",
"ur": "اردو",
"ro": "Română",
"sv": "Svenska",
"it": "Italiano",
"el": "Ελληνικά",
"hu": "Magyar",
"fi": "Suomi",
"da": "Dansk",
"no": "Norsk"
ko: "한국어",
es: "Español",
de: "Deutsch",
fr: "Français",
he: "עברית",
ar: "العربية",
ru: "Русский",
pl: "Polski",
cs: "Čeština",
nl: "Nederlands",
tr: "Türkçe",
uk: "Українська",
tl: "Tagalog",
id: "Indonesia",
th: "ไทย",
hi: "हिन्दी",
bn: "বাংলা",
ur: "اردو",
ro: "Română",
sv: "Svenska",
it: "Italiano",
el: "Ελληνικά",
hu: "Magyar",
fi: "Suomi",
da: "Dansk",
no: "Norsk",
fa: "فارسی",
};
export function normalizeLocale(locale) {
@@ -138,6 +174,9 @@ export function normalizeLocale(locale) {
if (locale === "no") {
return "no";
}
if (locale === "fa") {
return "fa";
}
return DEFAULT_LOCALE;
}
+2 -1
View File
@@ -49,7 +49,8 @@ const getLocaleInfo = (locale) => {
"hu": { name: "Magyar", flag: "🇭🇺" },
"fi": { name: "Suomi", flag: "🇫🇮" },
"da": { name: "Dansk", flag: "🇩🇰" },
"no": { name: "Norsk", flag: "🇳🇴" }
"no": { name: "Norsk", flag: "🇳🇴" },
"fa": { name: "فارسی", flag: "🇮🇷" }
};
return locales[locale] || { name: locale, flag: "🌐" };
};
+1
View File
@@ -33,4 +33,5 @@ export const LOCALE_FLAGS = {
"fi": "🇫🇮",
"da": "🇩🇰",
"no": "🇳🇴",
"fa": "🇮🇷",
};