closes #2963, closes #2957

v1.18.x
Barış Soner Uşaklı 10 years ago
parent 5fda8422c5
commit 0ed46c3bae

@ -2,7 +2,11 @@
/*global define*/
define('admin/general/languages', ['admin/settings'], function(Settings) {
$(function() {
var Languages = {}
Languages.init = function() {
Settings.prepare();
});
};
return Languages;
});

@ -250,6 +250,12 @@ adminController.plugins.get = function(req, res, next) {
adminController.languages.get = function(req, res, next) {
languages.list(function(err, languages) {
if (err) {
return next(err);
}
languages.forEach(function(language) {
language.selected = language.code === meta.config.defaultLang;
});
res.render('admin/general/languages', {
languages: languages
});

@ -14,13 +14,13 @@
<label for="defaultLang">Default Language</label>
<select id="language" data-field="defaultLang" class="form-control">
<!-- BEGIN languages -->
<option value="{languages.code}">{languages.name} ({languages.code})</option>
<option value="{languages.code}" <!-- IF languages.selected -->selected<!-- ENDIF languages.selected -->>{languages.name} ({languages.code})</option>
<!-- END languages -->
</select>
</div>
</form>
</div>
</div>
</div>
@ -35,6 +35,4 @@
</div>
</div>
<script type="text/javascript">
$('#language').val(translator.getLanguage());
</script>

Loading…
Cancel
Save