Use language from query parameter

This commit is contained in:
Jakob Borg 2014-07-22 20:27:36 +02:00
parent 3b4fe19dfb
commit bc0a8fcc1d
2 changed files with 9 additions and 2 deletions

File diff suppressed because one or more lines are too long

View File

@ -21,7 +21,7 @@ syncthing.config(function ($httpProvider, $translateProvider) {
$translateProvider.preferredLanguage('en');
});
syncthing.controller('SyncthingCtrl', function ($scope, $http, $translate) {
syncthing.controller('SyncthingCtrl', function ($scope, $http, $translate, $location) {
var prevDate = 0;
var getOK = true;
var restarting = false;
@ -40,6 +40,13 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http, $translate) {
$scope.reportPreview = false;
$scope.upgradeInfo = {};
$scope.$on("$locationChangeSuccess", function () {
var lang = $location.search().lang;
if (lang) {
$translate.use(lang);
}
});
$scope.needActions = {
'rm': 'Del',
'rmdir': 'Del (dir)',