fix: language switcher defaults to EN, not browser locale
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user