From bbf09989b02dfaee9c3fa57b01c4a5766018a5b7 Mon Sep 17 00:00:00 2001 From: Vic D'Elfant Date: Mon, 7 Jan 2008 13:50:56 +0000 Subject: Same goes for the 3_0_0 branch... 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/branches/phpBB-3_0_0@8312 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index bf00beb2e1..6f11170172 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -3301,6 +3301,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'], @@ -3356,7 +3363,7 @@ function page_header($page_title = '', $display_online_list = true) 'S_REGISTERED_USER' => $user->data['is_registered'], 'S_IS_BOT' => $user->data['is_bot'], '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'], -- cgit v1.2.1