Language setting fixes:
- switch 'en_US' to 'en', fixes the "admin panel switches to Arabic" bug - tweak setting descriptions to clarify that most of the time we'll be using browser language - add a backend switch to disable language detection (should this be exposed to ui?)
This commit is contained in:
12
lib/util.php
12
lib/util.php
@@ -105,11 +105,13 @@ function common_language()
|
||||
|
||||
// Otherwise, find the best match for the languages requested by the
|
||||
// user's browser...
|
||||
$httplang = isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : null;
|
||||
if (!empty($httplang)) {
|
||||
$language = client_prefered_language($httplang);
|
||||
if ($language)
|
||||
return $language;
|
||||
if (common_config('site', 'langdetect')) {
|
||||
$httplang = isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : null;
|
||||
if (!empty($httplang)) {
|
||||
$language = client_prefered_language($httplang);
|
||||
if ($language)
|
||||
return $language;
|
||||
}
|
||||
}
|
||||
|
||||
// Finally, if none of the above worked, use the site's default...
|
||||
|
Reference in New Issue
Block a user