diff options
author | Vic D'Elfant <vic@phpbb.com> | 2008-01-07 09:30:18 +0000 |
---|---|---|
committer | Vic D'Elfant <vic@phpbb.com> | 2008-01-07 09:30:18 +0000 |
commit | 159ce6f8d1bddbe7afc055f70cab3107b9c74a5f (patch) | |
tree | 7db301f86f09a71900e192945329fa23a7f8eed3 /phpBB/includes | |
parent | 5dddcb42aee429bcd77f18ec1ae94677a01b1c3a (diff) | |
download | forums-159ce6f8d1bddbe7afc055f70cab3107b9c74a5f.tar forums-159ce6f8d1bddbe7afc055f70cab3107b9c74a5f.tar.gz forums-159ce6f8d1bddbe7afc055f70cab3107b9c74a5f.tar.bz2 forums-159ce6f8d1bddbe7afc055f70cab3107b9c74a5f.tar.xz forums-159ce6f8d1bddbe7afc055f70cab3107b9c74a5f.zip |
Fixed a problem caused by "-x-" variations of a translation, such as fr-x-strict and de-x-sie. We're now sending the main language code to the output so it will at least be a valid language code
git-svn-id: file:///svn/phpbb/trunk@8311 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/functions.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 84fd033ddb..bb8d8c18c0 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -3190,6 +3190,13 @@ function page_header($page_title = '', $display_online_list = true) // Which timezone? $tz = ($user->data['user_id'] != ANONYMOUS) ? strval(doubleval($user->data['user_timezone'])) : strval(doubleval($config['board_timezone'])); + // Send a proper content-language to the output + $user_lang = $user->lang['USER_LANG']; + if (strpos($user_lang, '-x-') !== false) + { + $user_lang = substr($user_lang, 0, strpos($user_lang, '-x-')); + } + // The following assigns all _common_ variables that may be used at any point in a template. $template->assign_vars(array( 'SITENAME' => $config['sitename'], @@ -3248,7 +3255,7 @@ function page_header($page_title = '', $display_online_list = true) 'S_VIEWTOPIC' => false, 'S_VIEWFORUM' => false, 'S_USER_PM_POPUP' => $user->optionget('popuppm'), - 'S_USER_LANG' => $user->lang['USER_LANG'], + 'S_USER_LANG' => $user_lang, 'S_USER_BROWSER' => (isset($user->data['session_browser'])) ? $user->data['session_browser'] : $user->lang['UNKNOWN_BROWSER'], 'S_USERNAME' => $user->data['username'], 'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'], |