Skip to content

Fix incorrect browser locale detection using wrong API#301

Open
04cb wants to merge 1 commit intoTypiCMS:masterfrom
04cb:fix/incorrect-browser-locale-detection
Open

Fix incorrect browser locale detection using wrong API#301
04cb wants to merge 1 commit intoTypiCMS:masterfrom
04cb:fix/incorrect-browser-locale-detection

Conversation

@04cb
Copy link

@04cb 04cb commented Mar 7, 2026

The getBrowserLocaleOrMainLocale function incorrectly uses getenv('HTTP_ACCEPT_LANGUAGE') to retrieve the browser's language preference. This retrieves an environment variable, not an HTTP request header, so it will typically be empty in modern PHP setups.

Changed to use $request->header('Accept-Language') to properly get the browser's preferred language from the HTTP request headers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant