We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 2ab6e976 authored by tobyink's avatar tobyink

Add correct selected="selected" attribute to language drop down.

Also, avoid translating language names into currently selected language. Better for usability if each language name appears in its own language.
parent a5993317
......@@ -53,6 +53,10 @@ $smarty->template_dir = $install_path . '/themes/'. $default_theme . '/templates
$smarty->compile_dir = $install_path. '/themes/' . $default_theme . '/templates_c/';
$smarty->cache_dir = $install_path. '/cache/';
$current_lang = isset($_GET['lang']) ? $_GET['lang'] : $_COOKIE['lang'];
$smarty->assign('current_lang', $current_lang);
$smarty->assign('current_lang_array', array($current_lang => 1));
$smarty->assign('base_url', $base_url);
$smarty->assign('this_page', $_SERVER['REQUEST_URI']);
$smarty->assign('this_page_absolute',
......
<form method='get' action=''>
<select name='lang' id='lang' onchange='this.form.submit()'>
<option value='en_US'>{t}English (US){/t}</option>
<option value='de_DE'>{t}German (Germany){/t}</option>
<option {if $current_lang_array.en_US}selected="selected"{/if} value='en_US'>English (US)</option>
<option {if $current_lang_array.de_DE}selected="selected"{/if} value='de_DE'>Deutsch (Deutschland)</option>
</select>
<noscript>
<input type='submit' value='{t}Change Language{/t}' />
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment