Don't consider empty language codes when selecting language (fixes #540)

This commit is contained in:
Jakob Borg 2014-08-18 23:43:54 +02:00
parent 6bbf1f9355
commit 518aa30c9c

View File

@ -95,7 +95,7 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http, $translate, $loca
for (var i = 0; i < langs.length; i++) {
lang = langs[i];
matching = validLangs.filter(function (l) {
return l.indexOf(lang) == 0;
return lang.length >= 2 && l.indexOf(lang) == 0;
});
if (matching.length >= 1) {
$translate.use(matching[0]);