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
File diff suppressed because one or more lines are too long
+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 DEFAULT_LOCALE = "en";
export const LOCALE_COOKIE = "locale"; export const LOCALE_COOKIE = "locale";
export const LOCALE_NAMES = { export const LOCALE_NAMES = {
"en": "English", en: "English",
"vi": "Tiếng Việt", vi: "Tiếng Việt",
"zh-CN": "简体中文", "zh-CN": "简体中文",
"zh-TW": "繁體中文", "zh-TW": "繁體中文",
"ja": "日本語", ja: "日本語",
"pt-BR": "Português (Brasil)", "pt-BR": "Português (Brasil)",
"pt-PT": "Português (Portugal)", "pt-PT": "Português (Portugal)",
"ko": "한국어", ko: "한국어",
"es": "Español", es: "Español",
"de": "Deutsch", de: "Deutsch",
"fr": "Français", fr: "Français",
"he": "עברית", he: "עברית",
"ar": "العربية", ar: "العربية",
"ru": "Русский", ru: "Русский",
"pl": "Polski", pl: "Polski",
"cs": "Čeština", cs: "Čeština",
"nl": "Nederlands", nl: "Nederlands",
"tr": "Türkçe", tr: "Türkçe",
"uk": "Українська", uk: "Українська",
"tl": "Tagalog", tl: "Tagalog",
"id": "Indonesia", id: "Indonesia",
"th": "ไทย", th: "ไทย",
"hi": "हिन्दी", hi: "हिन्दी",
"bn": "বাংলা", bn: "বাংলা",
"ur": "اردو", ur: "اردو",
"ro": "Română", ro: "Română",
"sv": "Svenska", sv: "Svenska",
"it": "Italiano", it: "Italiano",
"el": "Ελληνικά", el: "Ελληνικά",
"hu": "Magyar", hu: "Magyar",
"fi": "Suomi", fi: "Suomi",
"da": "Dansk", da: "Dansk",
"no": "Norsk" no: "Norsk",
fa: "فارسی",
}; };
export function normalizeLocale(locale) { export function normalizeLocale(locale) {
@@ -138,6 +174,9 @@ export function normalizeLocale(locale) {
if (locale === "no") { if (locale === "no") {
return "no"; return "no";
} }
if (locale === "fa") {
return "fa";
}
return DEFAULT_LOCALE; return DEFAULT_LOCALE;
} }
+2 -1
View File
@@ -49,7 +49,8 @@ const getLocaleInfo = (locale) => {
"hu": { name: "Magyar", flag: "🇭🇺" }, "hu": { name: "Magyar", flag: "🇭🇺" },
"fi": { name: "Suomi", flag: "🇫🇮" }, "fi": { name: "Suomi", flag: "🇫🇮" },
"da": { name: "Dansk", flag: "🇩🇰" }, "da": { name: "Dansk", flag: "🇩🇰" },
"no": { name: "Norsk", flag: "🇳🇴" } "no": { name: "Norsk", flag: "🇳🇴" },
"fa": { name: "فارسی", flag: "🇮🇷" }
}; };
return locales[locale] || { name: locale, flag: "🌐" }; return locales[locale] || { name: locale, flag: "🌐" };
}; };
+1
View File
@@ -33,4 +33,5 @@ export const LOCALE_FLAGS = {
"fi": "🇫🇮", "fi": "🇫🇮",
"da": "🇩🇰", "da": "🇩🇰",
"no": "🇳🇴", "no": "🇳🇴",
"fa": "🇮🇷",
}; };