fix: language switcher defaults to EN, not browser locale

This commit is contained in:
Ryan Salazar
2026-05-23 06:33:42 +00:00
parent bfd674f571
commit a597400e3f

View File

@@ -92,8 +92,12 @@ export default function LanguageSwitcher({ currentLang, onLanguageChange, compac
const dropdownRef = useRef<HTMLDivElement>(null);
useEffect(() => {
// Priority: prop > cookie > browser detection
const lang = currentLang || getLangCookie() || detectBrowserLang();
// Priority: prop > cookie > 'en'. We intentionally do NOT auto-detect
// the browser locale here — site content is English-only at this
// point, so showing "FR" on a French-locale browser misrepresents
// the page. Users opt into another language by picking it in the
// dropdown, which then writes the cookie.
const lang = currentLang || getLangCookie() || 'en';
setActiveLang(lang);
// Apply RTL if Arabic