fix(web): show current language's flag in switcher, not target (#11262)

The language switcher displayed the *other* language's flag (clicking
the Chinese flag switched to Chinese). This is dissonant — a flag reads
as a state indicator first, so seeing the Chinese flag while the UI is
in English feels wrong. Users expect the flag to reflect the current
language, like every other status indicator.

Flips the flag and label ternaries so English shows UK + EN, Chinese
shows CN + 中文. Tooltip text ("Switch to Chinese" / "切换到英文") still
communicates the click action, which is where that belongs.
This commit is contained in:
Teknium 2026-04-16 16:36:12 -07:00 committed by GitHub
parent 59a5ff9cb2
commit 00ba8b25a9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -17,10 +17,10 @@ export function LanguageSwitcher() {
title={t.language.switchTo} title={t.language.switchTo}
aria-label={t.language.switchTo} aria-label={t.language.switchTo}
> >
{/* Show the *other* language's flag as the clickable target */} {/* Show the *current* language's flag — tooltip advertises the click action */}
<span className="text-base leading-none">{locale === "en" ? "🇨🇳" : "🇬🇧"}</span> <span className="text-base leading-none">{locale === "en" ? "🇬🇧" : "🇨🇳"}</span>
<span className="hidden sm:inline font-display tracking-wide uppercase text-[0.65rem]"> <span className="hidden sm:inline font-display tracking-wide uppercase text-[0.65rem]">
{locale === "en" ? "中文" : "EN"} {locale === "en" ? "EN" : "中文"}
</span> </span>
</button> </button>
); );