fix(dashboard): remove country flags from language picker (#29997)
Closes #29750. Reporter flagged that 繁體中文 displayed the TW flag instead of the PRC flag. Rather than picking a side, drop the language-flag pairings entirely — languages aren't countries (English ≠ GB, Portuguese ≠ PT, Mandarin variants ≠ any single jurisdiction), and endonyms are unambiguous. - LOCALE_META: strip flagCountryCode field - LanguageSwitcher: remove LocaleFlagIcon component + both call sites - main.tsx: drop flag-icons CSS import - package.json: uninstall flag-icons
This commit is contained in:
@@ -37,27 +37,31 @@ const TRANSLATIONS: Record<Locale, Translations> = {
|
||||
};
|
||||
|
||||
// Display metadata for the language picker — endonym (native name) so users
|
||||
// recognize their language even if they don't speak the current UI language,
|
||||
// plus a flag-icons sprite (ISO 3166-1 alpha-2) for visual scanning.
|
||||
// recognize their language even if they don't speak the current UI language.
|
||||
// Exposed as a constant so the LanguageSwitcher and any future settings page
|
||||
// can share the same list.
|
||||
export const LOCALE_META: Record<Locale, { name: string; flagCountryCode: string }> = {
|
||||
en: { name: "English", flagCountryCode: "gb" },
|
||||
zh: { name: "简体中文", flagCountryCode: "cn" },
|
||||
"zh-hant": { name: "繁體中文", flagCountryCode: "tw" },
|
||||
ja: { name: "日本語", flagCountryCode: "jp" },
|
||||
de: { name: "Deutsch", flagCountryCode: "de" },
|
||||
es: { name: "Español", flagCountryCode: "es" },
|
||||
fr: { name: "Français", flagCountryCode: "fr" },
|
||||
tr: { name: "Türkçe", flagCountryCode: "tr" },
|
||||
uk: { name: "Українська", flagCountryCode: "ua" },
|
||||
af: { name: "Afrikaans", flagCountryCode: "za" },
|
||||
ko: { name: "한국어", flagCountryCode: "kr" },
|
||||
it: { name: "Italiano", flagCountryCode: "it" },
|
||||
ga: { name: "Gaeilge", flagCountryCode: "ie" },
|
||||
pt: { name: "Português", flagCountryCode: "pt" },
|
||||
ru: { name: "Русский", flagCountryCode: "ru" },
|
||||
hu: { name: "Magyar", flagCountryCode: "hu" },
|
||||
//
|
||||
// We intentionally do NOT pair locales with country flags. Languages are not
|
||||
// countries (English ≠ GB, Portuguese ≠ PT, Spanish ≠ ES, Chinese variants ≠
|
||||
// any single jurisdiction). Endonyms are unambiguous and avoid the political
|
||||
// mismapping that flag pairings inevitably create.
|
||||
export const LOCALE_META: Record<Locale, { name: string }> = {
|
||||
en: { name: "English" },
|
||||
zh: { name: "简体中文" },
|
||||
"zh-hant": { name: "繁體中文" },
|
||||
ja: { name: "日本語" },
|
||||
de: { name: "Deutsch" },
|
||||
es: { name: "Español" },
|
||||
fr: { name: "Français" },
|
||||
tr: { name: "Türkçe" },
|
||||
uk: { name: "Українська" },
|
||||
af: { name: "Afrikaans" },
|
||||
ko: { name: "한국어" },
|
||||
it: { name: "Italiano" },
|
||||
ga: { name: "Gaeilge" },
|
||||
pt: { name: "Português" },
|
||||
ru: { name: "Русский" },
|
||||
hu: { name: "Magyar" },
|
||||
};
|
||||
|
||||
const SUPPORTED_LOCALES = Object.keys(TRANSLATIONS) as Locale[];
|
||||
|
||||
Reference in New Issue
Block a user