diff --git a/dashboard-ui/bower_components/iron-meta/.bower.json b/dashboard-ui/bower_components/iron-meta/.bower.json index 9e650790be..8119ebcf41 100644 --- a/dashboard-ui/bower_components/iron-meta/.bower.json +++ b/dashboard-ui/bower_components/iron-meta/.bower.json @@ -25,14 +25,14 @@ "web-component-tester": "*", "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" }, - "homepage": "https://github.com/PolymerElements/iron-meta", + "homepage": "https://github.com/polymerelements/iron-meta", "_release": "1.0.3", "_resolution": { "type": "version", "tag": "v1.0.3", "commit": "91529259262b0d8f33fed44bc3fd47aedf35cb04" }, - "_source": "git://github.com/PolymerElements/iron-meta.git", + "_source": "git://github.com/polymerelements/iron-meta.git", "_target": "^1.0.0", - "_originalSource": "PolymerElements/iron-meta" + "_originalSource": "polymerelements/iron-meta" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/iron-resizable-behavior/.bower.json b/dashboard-ui/bower_components/iron-resizable-behavior/.bower.json index 9ae5e84c7e..1f0548f3d7 100644 --- a/dashboard-ui/bower_components/iron-resizable-behavior/.bower.json +++ b/dashboard-ui/bower_components/iron-resizable-behavior/.bower.json @@ -27,14 +27,14 @@ "web-component-tester": "*", "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" }, - "homepage": "https://github.com/PolymerElements/iron-resizable-behavior", + "homepage": "https://github.com/polymerelements/iron-resizable-behavior", "_release": "1.0.2", "_resolution": { "type": "version", "tag": "v1.0.2", "commit": "85de8ba28be2bf17c81d6436ef1119022b003674" }, - "_source": "git://github.com/PolymerElements/iron-resizable-behavior.git", + "_source": "git://github.com/polymerelements/iron-resizable-behavior.git", "_target": "^1.0.0", - "_originalSource": "PolymerElements/iron-resizable-behavior" + "_originalSource": "polymerelements/iron-resizable-behavior" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/paper-styles/.bower.json b/dashboard-ui/bower_components/paper-styles/.bower.json index 6b23721aea..04e2128c81 100644 --- a/dashboard-ui/bower_components/paper-styles/.bower.json +++ b/dashboard-ui/bower_components/paper-styles/.bower.json @@ -34,7 +34,7 @@ "tag": "v1.0.11", "commit": "347542e9ebe3e6e5f0830ee10e1c20c12956ff2c" }, - "_source": "git://github.com/PolymerLabs/paper-styles.git", + "_source": "git://github.com/PolymerElements/paper-styles.git", "_target": "^1.0.0", - "_originalSource": "PolymerLabs/paper-styles" + "_originalSource": "PolymerElements/paper-styles" } \ No newline at end of file diff --git a/dashboard-ui/css/librarymenu.css b/dashboard-ui/css/librarymenu.css index 3f9a7c0fc6..c03759284e 100644 --- a/dashboard-ui/css/librarymenu.css +++ b/dashboard-ui/css/librarymenu.css @@ -292,7 +292,7 @@ color: #2ad; } -@media all and (max-width: 440px) { +@media all and (max-width: 400px) { .libraryMenuButtonText { display: none; diff --git a/dashboard-ui/mypreferencesmenu.html b/dashboard-ui/mypreferencesmenu.html index 55645f560c..e1f43f06fb 100644 --- a/dashboard-ui/mypreferencesmenu.html +++ b/dashboard-ui/mypreferencesmenu.html @@ -46,45 +46,41 @@
-
+
${ButtonDisplaySettings}
${ButtonDisplaySettingsHelp}
-
-
+
${ButtonHomeScreenSettings}
${ButtonHomeScreenSettingsHelp}
-
-
+
${ButtonPlaybackSettings}
${ButtonPlaybackSettingsHelp}
-
-
+
${ButtonProfile}
${ButtonProfileHelp}
-
diff --git a/dashboard-ui/scripts/globalize.js b/dashboard-ui/scripts/globalize.js index fab4ecbc45..93bcec3a28 100644 --- a/dashboard-ui/scripts/globalize.js +++ b/dashboard-ui/scripts/globalize.js @@ -17,7 +17,7 @@ return dictionaries[getUrl(name, culture)]; } - function loadDictionary(name, culture, loadUrl, saveUrl) { + function loadDictionary(name, culture) { var deferred = DeferredBuilder.Deferred(); @@ -25,9 +25,22 @@ deferred.resolve(); } else { - $.getJSON(loadUrl).done(function (dictionary) { - dictionaries[saveUrl] = dictionary; + var url = getUrl(name, culture); + + $.getJSON(url).done(function (dictionary) { + + dictionaries[url] = dictionary; deferred.resolve(); + + }).fail(function () { + + // If there's no dictionary for that language, grab English + $.getJSON(getUrl(name, 'en-US')).done(function (dictionary) { + + dictionaries[url] = dictionary; + deferred.resolve(); + + }); }); } @@ -39,30 +52,53 @@ currentCulture = value; - var htmlValue = value; - var jsValue = value; - - var htmlUrl = getUrl('html', htmlValue); - var jsUrl = getUrl('javascript', jsValue); - - var htmlLoadUrl = getUrl('html', htmlValue); - var jsLoadUrl = getUrl('javascript', jsValue); - - //htmlLoadUrl = getUrl('html', 'server'); - //jsLoadUrl = getUrl('javascript', 'javascript'); - - return $.when(loadDictionary('html', htmlValue, htmlLoadUrl, htmlUrl), loadDictionary('javascript', jsValue, jsLoadUrl, jsUrl)); + return $.when(loadDictionary('html', value), loadDictionary('javascript', value)); } + function getDeviceCulture() { + var deferred = DeferredBuilder.Deferred(); + + var culture; + + if (navigator.globalization && navigator.globalization.getLocaleName) { + + navigator.globalization.getLocaleName(function (locale) { + + culture = (locale.value || '').replace('_', '-'); + Logger.log('Device culture is ' + culture); + deferred.resolveWith(null, [culture]); + + }, function () { + deferred.resolveWith(null, [null]); + }); + + + } else { + + culture = document.documentElement.getAttribute('data-culture'); + deferred.resolveWith(null, [culture]); + } + + return deferred.promise(); + } + + function ensure() { - var culture = document.documentElement.getAttribute('data-culture'); + var deferred = DeferredBuilder.Deferred(); - if (!culture) { - culture = 'en-US'; - } + getDeviceCulture().done(function (culture) { - return setCulture(culture); + if (!culture) { + culture = 'en-US'; + } + + setCulture(culture).done(function () { + deferred.resolve(); + }); + }); + + return deferred.promise(); } function translateDocument(html, dictionaryName) { diff --git a/dashboard-ui/strings/html/server.json b/dashboard-ui/strings/html/server.json index cbe6b8315c..93b9f27254 100644 --- a/dashboard-ui/strings/html/server.json +++ b/dashboard-ui/strings/html/server.json @@ -1510,5 +1510,6 @@ "ButtonPlaybackSettingsHelp": "Specify your audio and subtitle preferences, streaming quality, and more.", "ButtonProfileHelp": "Set your profile image and password.", "HeaderHomeScreenSettings": "Home Screen Settings", - "HeaderProfile": "Profile" + "HeaderProfile": "Profile", + "HeaderLanguage": "Language" }