1
0
mirror of https://github.com/moparisthebest/wallabag synced 2024-11-23 17:42:15 -05:00

[add] languages well displayed on config page #480

This commit is contained in:
Nicolas Lœuillet 2014-02-21 15:24:33 +01:00
parent 0a022f9a39
commit c9bd17a100
3 changed files with 17 additions and 4 deletions

View File

@ -23,6 +23,19 @@ class Poche
private $currentLanguage = ''; private $currentLanguage = '';
private $notInstalledMessage = array(); private $notInstalledMessage = array();
private $language_names = array(
'cs_CZ.utf8' => 'čeština',
'de_DE.utf8' => 'German',
'en_EN.utf8' => 'English',
'es_ES.utf8' => 'Español',
'fa_IR.utf8' => 'فارسی',
'fr_FR.utf8' => 'Français',
'it_IT.utf8' => 'Italiano',
'pl_PL.utf8' => 'Polski',
'ru_RU.utf8' => 'Pусский',
'sl_SI.utf8' => 'Slovenščina',
'uk_UA.utf8' => 'Український',
);
public function __construct() public function __construct()
{ {
if ($this->configFileIsAvailable()) { if ($this->configFileIsAvailable()) {
@ -333,7 +346,7 @@ class Poche
$current = true; $current = true;
} }
$languages[] = array('name' => $language, 'current' => $current); $languages[] = array('name' => $this->language_names[$language], 'value' => $language, 'current' => $current);
} }
return $languages; return $languages;
@ -751,7 +764,7 @@ class Poche
$actualLanguage = false; $actualLanguage = false;
foreach ($languages as $language) { foreach ($languages as $language) {
if ($language['name'] == $_POST['language']) { if ($language['value'] == $_POST['language']) {
$actualLanguage = true; $actualLanguage = true;
break; break;
} }

View File

@ -69,7 +69,7 @@
<label class="col w150p" for="language">{% trans "Language:" %}</label> <label class="col w150p" for="language">{% trans "Language:" %}</label>
<select class="col" id="language" name="language"> <select class="col" id="language" name="language">
{% for language in languages %} {% for language in languages %}
<option value="{{ language.name }}" {{ language.current ? 'selected' : '' }}>{{ language.name }}</option> <option value="{{ language.value }}" {{ language.current ? 'selected' : '' }}>{{ language.name }}</option>
{% endfor %} {% endfor %}
</select> </select>
</div> </div>

View File

@ -69,7 +69,7 @@
<label class="col w150p" for="language">{% trans "Language:" %}</label> <label class="col w150p" for="language">{% trans "Language:" %}</label>
<select class="col" id="language" name="language"> <select class="col" id="language" name="language">
{% for language in languages %} {% for language in languages %}
<option value="{{ language.name }}" {{ language.current ? 'selected' : '' }}>{{ language.name }}</option> <option value="{{ language.value }}" {{ language.current ? 'selected' : '' }}>{{ language.name }}</option>
{% endfor %} {% endfor %}
</select> </select>
</div> </div>