Merge branch 'testing' of gitorious.org:statusnet/mainline into testing
* 'testing' of gitorious.org:statusnet/mainline: Language setting fixes:
This commit is contained in:
commit
09169d6f3c
@ -277,8 +277,8 @@ class SiteAdminPanelForm extends AdminForm
|
||||
$this->unli();
|
||||
|
||||
$this->li();
|
||||
$this->out->dropdown('language', _('Language'),
|
||||
get_nice_language_list(), _('Default site language'),
|
||||
$this->out->dropdown('language', _('Default language'),
|
||||
get_nice_language_list(), _('Site language when autodetection from browser settings is not available'),
|
||||
false, $this->value('language'));
|
||||
$this->unli();
|
||||
|
||||
|
@ -253,6 +253,7 @@ function main()
|
||||
$user = common_current_user();
|
||||
|
||||
// initialize language env
|
||||
common_log(LOG_DEBUG, "XXX: WAIII");
|
||||
|
||||
common_init_language();
|
||||
|
||||
|
@ -40,7 +40,8 @@ $default =
|
||||
'logdebug' => false,
|
||||
'fancy' => false,
|
||||
'locale_path' => INSTALLDIR.'/locale',
|
||||
'language' => 'en_US',
|
||||
'language' => 'en',
|
||||
'langdetect' => true,
|
||||
'languages' => get_all_languages(),
|
||||
'email' =>
|
||||
array_key_exists('SERVER_ADMIN', $_SERVER) ? $_SERVER['SERVER_ADMIN'] : null,
|
||||
|
@ -105,12 +105,14 @@ function common_language()
|
||||
|
||||
// Otherwise, find the best match for the languages requested by the
|
||||
// user's browser...
|
||||
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...
|
||||
return common_config('site', 'language');
|
||||
|
Loading…
Reference in New Issue
Block a user