diff --git a/gui/scripts/syncthing/core/services/localeService.js b/gui/scripts/syncthing/core/services/localeService.js index b594ed204..d27947d6e 100644 --- a/gui/scripts/syncthing/core/services/localeService.js +++ b/gui/scripts/syncthing/core/services/localeService.js @@ -18,6 +18,20 @@ angular.module('syncthing.core') _availableLocales = locales; }; + function isLocalStorageEnabled () { + // Feature detect localStorage; https://mathiasbynens.be/notes/localstorage-pattern + try { + var uid = new Date(); + var storage = window.localStorage; + storage.setItem(uid, uid); + var success = storage.getItem(uid) == uid; + storage.removeItem(uid); + return success; + } catch (exception) { + return false; + } + } + this.$get = ['$http', '$translate', '$location', function ($http, $translate, $location) { /** @@ -32,22 +46,10 @@ angular.module('syncthing.core') } function autoConfigLocale() { - // Feature detect localStorage; https://mathiasbynens.be/notes/localstorage-pattern - var storage; - var fail; - var uid; - try { - uid = new Date; - (storage = window.localStorage).setItem(uid, uid); - fail = storage.getItem(uid) != uid; - storage.removeItem(uid); - fail && (storage = false); - } catch (exception) {} - var params = $location.search(); var savedLang; - if (storage) { - savedLang = storage[_SYNLANG]; + if (isLocalStorageEnabled()) { + savedLang = localStorage[_SYNLANG]; } if(params.lang) { @@ -99,7 +101,7 @@ angular.module('syncthing.core') function useLocale(language, save2Storage) { if (language) { $translate.use(language).then(function () { - if (save2Storage && typeof(localStorage) != 'undefined') + if (save2Storage && isLocalStorageEnabled()) localStorage[_SYNLANG] = language; }); } diff --git a/internal/auto/gui.files.go b/internal/auto/gui.files.go index 194092581..355ab938d 100644 --- a/internal/auto/gui.files.go +++ b/internal/auto/gui.files.go @@ -5,7 +5,7 @@ import ( ) const ( - AssetsBuildDate = "Sun, 12 Apr 2015 22:43:36 GMT" + AssetsBuildDate = "Mon, 13 Apr 2015 16:04:48 GMT" ) func Assets() map[string][]byte { @@ -109,7 +109,7 @@ func Assets() map[string][]byte { assets["scripts/syncthing/core/module.js"], _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/0rMSy/NSSzSy81PKc1J1VAvrsxLLsnIzEvXS84vSlXXUYiO1bTmAgAAAP//AQAA//+OUhsnJgAAAA==") - assets["scripts/syncthing/core/services/localeService.js"], _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/5Q5e3Mat/b/51Po5+nUuLV5LmDiX+50H5Cbqet0gu+0N0knI0CAyrJLJS026eS733OOtOwCayfVH7I4OjovnZfWPFlkMVf1dTrLYlE717tkapYyWdSnqRLnFy8YjPpGpVs5E6p2fptOeSzGQm3lVJxfsnkG+DJNWO2C/U3IOM4zLZg2Sk7N+c2LPXjLFfs0E3OexcYSutzv4fjEt1zGfBILu6uPz47/e3fr371mr9gZLD/h+uyGNRpsmibasJXYsXmqWIynxyZVfCEKCoCWcCO3Av6shWbp3CLC8k9grKdKbgwTeso3YnbI9/Zt6N8Ox5/u/F+GY+D+Nzvj87OX7MyfK7niPNFnlwBaI+hj1mr7TZxbAc7tCOdBQBjKYjR77T7OnodzZ0Bzi+DXBPdpPaAz2p0ZXHdxDhBj4A9xDpu0HhE8pHlozxiSTptMSZ5kCJsIR8drISev06U5oBnpeJ6dOzRbHL+0OyIqi0Mqnl+i0jmhVaZyTeeTXBvfyUuatWndLjSYJFdv7r6Oymq0HxX7gTWJd0FUUkdi1O3h3A9pjVKNmijzqEfrPpIbeW06Q3cUKPF5mSZiYUGPuShtEsULaN2ya0KhWwpSDb6wkgiZcoSE3PAY0JrDpgVebcHjkqk83mU1t/Hxcdgk4af5xbeakcA/vZaRCaetHW79JmK9bIS7teJWzhkRjVAE+kk3HonM6OmSAIt0r0er0KOFvjigext4JObsc263HlnGDwrrkc8663ktxBaxw+4M0Kc6QVCa+zRHNA9oRm/o+CGdTK5eB3h4mCxiqZes9jq4sBslqMN87x9gvvctJqk01BuheGJSAulPw7GDcrTuqJXGrFb84vYkxchQaCMhc4ASCMsIlukVV2TpOc8j1msVcWtjlfy951GUziXijbN0TZc/JycagUhwnX0uKT8siNZrLmS8EASYEQBvXM6WsaRLXMQWKxYL0maROQn8AfL2wxat8S58cnafHN/3Pdql+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