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);
|
const dropdownRef = useRef<HTMLDivElement>(null);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// Priority: prop > cookie > browser detection
|
// Priority: prop > cookie > 'en'. We intentionally do NOT auto-detect
|
||||||
const lang = currentLang || getLangCookie() || detectBrowserLang();
|
// 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);
|
setActiveLang(lang);
|
||||||
|
|
||||||
// Apply RTL if Arabic
|
// Apply RTL if Arabic
|
||||||
|
|||||||
Reference in New Issue
Block a user