Skip to content

Commit

Permalink
The language choice was lost if there where errors in the setting.
Browse files Browse the repository at this point in the history
  • Loading branch information
tumba25 committed Dec 25, 2010
1 parent 5efe463 commit 9f4e902
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions includes/qi_settings.php
Expand Up @@ -111,6 +111,7 @@
'CONFIG_NUM_REPLIES_MIN' => (isset($qi_config['num_replies_min'])) ? $qi_config['num_replies_min'] : 1,
'CONFIG_NUM_REPLIES_MAX' => (isset($qi_config['num_replies_max'])) ? $qi_config['num_replies_max'] : 15,
'CONFIG_EMAIL_DOMAIN' => (isset($qi_config['email_domain'])) ? $qi_config['email_domain'] : '',
'SEL_LANG' => (!empty($language)) ? $language : '',
));

// Output page
Expand Down
11 changes: 10 additions & 1 deletion index.php
Expand Up @@ -93,7 +93,16 @@

// Get and set the language.
$language = (!empty($qi_config['qi_lang'])) ? $qi_config['qi_lang'] : 'en';
$language = request_var('lang', $language);

// If there is a language selected in the dropdown menu it's sent as GET, then igonre the hidden POST field.
if (isset($_GET['lang']))
{
$language = request_var('lang', $language);
}
else if (!empty($_POST['sel_lang']))
{
$language = request_var('sel_lang', $language);
}

$user->lang = (file_exists($quickinstall_path . 'language/' . $language)) ? $language : 'en';
qi::add_lang(array('qi', 'phpbb'), $quickinstall_path . 'language/' . $user->lang . '/');
Expand Down
1 change: 1 addition & 0 deletions style/settings_body.html
Expand Up @@ -270,6 +270,7 @@ <h1>{L_SETTINGS}</h1>
<p class="submit-buttons">
<input type="reset" name="reset" value="{L_RESET}" class="button1" /> &nbsp;
<input type="submit" name="submit" value="{L_SUBMIT}" class="button1" />
<input type="hidden" name="sel_lang" value="{SEL_LANG}" />
</p>
</fieldset>

Expand Down

0 comments on commit 9f4e902

Please sign in to comment.