mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-04 07:31:58 +00:00
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:
parent
3d2f146460
commit
56b79f12ac
5 changed files with 31 additions and 74 deletions
|
|
@ -9,15 +9,16 @@ import type { Locale } from "@/i18n";
|
|||
import { cn } from "@/lib/utils";
|
||||
|
||||
/**
|
||||
* Language picker — shows the current language's flag + endonym, opens a
|
||||
* dropdown of all supported locales when clicked. Persists choice to
|
||||
* localStorage via the I18n context.
|
||||
* Language picker — shows the current language's endonym, opens a dropdown
|
||||
* of all supported locales when clicked. Persists choice to localStorage via
|
||||
* the I18n context.
|
||||
*
|
||||
* Replaces the older two-state EN↔ZH toggle now that we ship 16 locales
|
||||
* (en, zh, zh-hant, ja, de, es, fr, tr, uk, af, ko, it, ga, pt, ru, hu).
|
||||
*
|
||||
* Locale markers use lipis/flag-icons (SVG sprites) instead of emoji so flags
|
||||
* render consistently across platforms.
|
||||
* No country flags by design — languages aren't countries, and flag pairings
|
||||
* inevitably create political mismappings (e.g. Mandarin variants ≠ any single
|
||||
* jurisdiction, English ≠ GB, Portuguese ≠ PT). Endonyms are unambiguous.
|
||||
*
|
||||
* When placed at the bottom of the sidebar (next to ThemeSwitcher), pass
|
||||
* `dropUp` so the list opens above the trigger and avoids clipping below the
|
||||
|
|
@ -71,7 +72,6 @@ export function LanguageSwitcher({ dropUp = false }: LanguageSwitcherProps) {
|
|||
className="px-2 py-1 normal-case tracking-normal font-normal text-xs text-muted-foreground hover:text-foreground"
|
||||
>
|
||||
<span className="inline-flex items-center gap-1.5">
|
||||
<LocaleFlagIcon countryCode={current.flagCountryCode} />
|
||||
<Typography
|
||||
mondwest
|
||||
className="hidden sm:inline tracking-wide uppercase text-[0.65rem]"
|
||||
|
|
@ -146,8 +146,6 @@ function LanguageSwitcherOptions({
|
|||
role="option"
|
||||
type="button"
|
||||
>
|
||||
<LocaleFlagIcon countryCode={meta.flagCountryCode} />
|
||||
|
||||
<span className="truncate">{meta.name}</span>
|
||||
|
||||
{selected && <span className="ml-auto text-xs">✓</span>}
|
||||
|
|
@ -158,15 +156,6 @@ function LanguageSwitcherOptions({
|
|||
);
|
||||
}
|
||||
|
||||
function LocaleFlagIcon({ countryCode }: LocaleFlagIconProps) {
|
||||
return (
|
||||
<span
|
||||
aria-hidden
|
||||
className={cn("fi fis shrink-0 text-base leading-none", `fi-${countryCode}`)}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
interface LanguageSwitcherOptionsProps {
|
||||
allLocales: Array<[Locale, (typeof LOCALE_META)[Locale]]>;
|
||||
locale: Locale;
|
||||
|
|
@ -177,7 +166,3 @@ interface LanguageSwitcherOptionsProps {
|
|||
interface LanguageSwitcherProps {
|
||||
dropUp?: boolean;
|
||||
}
|
||||
|
||||
interface LocaleFlagIconProps {
|
||||
countryCode: string;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue