diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 6bd88390bf..5fc5a27bc9 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -368,10 +368,9 @@ function init_userprefs($userdata) message_die(CRITICAL_ERROR, 'Could not update user language info'); } - $board_config['default_lang'] = $default_lang; $userdata['user_lang'] = $default_lang; } - elseif ( $board_config['default_lang'] !== $default_lang ) + elseif ( $userdata['user_id'] === ANONYMOUS && $board_config['default_lang'] !== $default_lang ) { $sql = 'UPDATE ' . CONFIG_TABLE . " SET config_value = '" . $default_lang . "' @@ -381,10 +380,10 @@ function init_userprefs($userdata) { message_die(CRITICAL_ERROR, 'Could not update user language info'); } - - $board_config['default_lang'] = $default_lang; } + $board_config['default_lang'] = $default_lang; + include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx); if ( defined('IN_ADMIN') )