From 41b0b8c5f92c77e406c8fc96c810749cf99b4409 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Sun, 6 Apr 2014 23:55:46 -0700 Subject: [ticket/12254] Better language switching on registration page PHPBB3-12254 --- phpBB/phpbb/user.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/user.php b/phpBB/phpbb/user.php index b9b3896606..fceeb53946 100644 --- a/phpBB/phpbb/user.php +++ b/phpBB/phpbb/user.php @@ -80,7 +80,21 @@ class user extends \phpbb\session } else { - $user_lang_name = basename($config['default_lang']); + $change_lang = request_var('change_lang', ''); + if ($change_lang) + { + global $SID, $_EXTRA_URL; + + $use_lang = basename($change_lang); + $user_lang_name = (file_exists($this->lang_path . $use_lang . "/common.$phpEx")) ? $use_lang : basename($config['default_lang']); + $this->data['user_lang'] = $user_lang_name; + $SID .= '&change_lang=' . $user_lang_name; + $_EXTRA_URL[] = 'change_lang=' . $user_lang_name; + } + else + { + $user_lang_name = basename($config['default_lang']); + } $user_date_format = $config['default_dateformat']; $user_timezone = $config['board_timezone']; @@ -189,7 +203,7 @@ class user extends \phpbb\session $style_id = $style_request; $SID .= '&style=' . $style_id; - $_EXTRA_URL = array('style=' . $style_id); + $_EXTRA_URL[] = 'style=' . $style_id; } else { -- cgit v1.2.1