diff --git a/dashboard-ui/mypreferencesdisplay.html b/dashboard-ui/mypreferencesdisplay.html index 2349d1c445..355e74a900 100644 --- a/dashboard-ui/mypreferencesdisplay.html +++ b/dashboard-ui/mypreferencesdisplay.html @@ -10,6 +10,59 @@
+
+

+ ${HeaderLanguage} +

+ +
+
+
+ + +
+
${LabelPreferredDisplayLanguageHelp}
+ +
+
+ +
+
+

${HeaderNavigation} diff --git a/dashboard-ui/scripts/appsettings.js b/dashboard-ui/scripts/appsettings.js index 5f7195e026..b47fff9f81 100644 --- a/dashboard-ui/scripts/appsettings.js +++ b/dashboard-ui/scripts/appsettings.js @@ -65,7 +65,16 @@ return appStorage.getItem('enableSyncToExternalStorage') != 'false'; }, - displayPreferencesKey: function() { + displayLanguage: function (val) { + + if (val != null) { + update('displayLanguage', val); + } + + return appStorage.getItem('displayLanguage') || 'en-US'; + }, + + displayPreferencesKey: function () { if (AppInfo.isNativeApp) { return 'Emby Mobile'; } diff --git a/dashboard-ui/scripts/globalize.js b/dashboard-ui/scripts/globalize.js index 6cc94cb467..3347838d34 100644 --- a/dashboard-ui/scripts/globalize.js +++ b/dashboard-ui/scripts/globalize.js @@ -75,6 +75,13 @@ deferred.resolveWith(null, [null]); }); + } else if (AppInfo.supportsUserDisplayLanguageSetting) { + + Logger.log('AppInfo.supportsUserDisplayLanguageSetting is true'); + + culture = document.documentElement.getAttribute('data-culture'); + deferred.resolveWith(null, [culture]); + } else { Logger.log('navigator.globalization.getLocaleName is unavailable'); diff --git a/dashboard-ui/scripts/mypreferencesdisplay.js b/dashboard-ui/scripts/mypreferencesdisplay.js index 9849d9e220..27eab859f5 100644 --- a/dashboard-ui/scripts/mypreferencesdisplay.js +++ b/dashboard-ui/scripts/mypreferencesdisplay.js @@ -10,6 +10,8 @@ $('#selectThemeSong', page).val(appStorage.getItem('enableThemeSongs-' + user.Id) || '').selectmenu("refresh"); $('#selectBackdrop', page).val(appStorage.getItem('enableBackdrops-' + user.Id) || '').selectmenu("refresh"); + $('#selectLanguage', page).val(AppSettings.displayLanguage()).selectmenu("refresh"); + page.querySelector('.chkEnableFullScreen').checked = AppSettings.enableFullScreen(); Dashboard.hideLoadingMsg(); @@ -23,6 +25,7 @@ user.Configuration.GroupMoviesIntoBoxSets = page.querySelector('.chkGroupMoviesIntoCollections').checked; AppSettings.enableFullScreen(page.querySelector('.chkEnableFullScreen').checked); + AppSettings.displayLanguage(page.querySelector('#selectLanguage').value); appStorage.setItem('enableThemeSongs-' + user.Id, $('#selectThemeSong', page).val()); appStorage.setItem('enableBackdrops-' + user.Id, $('#selectBackdrop', page).val()); @@ -84,6 +87,12 @@ } else { $('.fldFullscreen', page).hide(); } + + if (AppInfo.supportsUserDisplayLanguageSetting) { + $('.languageSection', page).show(); + } else { + $('.languageSection', page).hide(); + } }); })(jQuery, window, document); \ No newline at end of file diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js index f50c325887..488163e702 100644 --- a/dashboard-ui/scripts/site.js +++ b/dashboard-ui/scripts/site.js @@ -1729,6 +1729,7 @@ var AppInfo = {}; AppInfo.supportsFullScreen = isCordova && isAndroid; AppInfo.supportsSyncPathSetting = isCordova && isAndroid; + AppInfo.supportsUserDisplayLanguageSetting = Dashboard.isConnectMode() && !isCordova; if (isCordova && isAndroid) { AppInfo.directPlayAudioContainers = "flac,aac,mp3,mpa,wav,wma,mp2,ogg,oga,webma,ape,opus".split(','); diff --git a/dashboard-ui/strings/html/server.json b/dashboard-ui/strings/html/server.json index c8c6c341c8..67311c970c 100644 --- a/dashboard-ui/strings/html/server.json +++ b/dashboard-ui/strings/html/server.json @@ -544,8 +544,8 @@ "LabelFriendlyServerName": "Friendly server name:", "LabelFriendlyServerNameHelp": "This name will be used to identify this server. If left blank, the computer name will be used.", "LabelPreferredDisplayLanguage": "Preferred display language:", - "LabelPreferredDisplayLanguageHelp": "Translating Emby is an ongoing project and is not yet complete.", - "LabelReadHowYouCanContribute": "Read about how you can contribute.", + "LabelPreferredDisplayLanguageHelp": "Translating Emby is an ongoing project.", + "LabelReadHowYouCanContribute": "Learn how you can contribute.", "HeaderNewCollection": "New Collection", "ButtonSubmit": "Submit", "ButtonCreate": "Create", diff --git a/dashboard-ui/voice/voice.js b/dashboard-ui/voice/voice.js index e78baa1cf0..ddba1e8364 100644 --- a/dashboard-ui/voice/voice.js +++ b/dashboard-ui/voice/voice.js @@ -341,12 +341,12 @@ function showCommand(result) { if (result.category == 'tvguide') { - Dashboard.navigate('livetv.html'); + Dashboard.navigate('livetv.html?tab=1'); return; } if (result.category == 'recordings') { - Dashboard.navigate('livetv.html'); + Dashboard.navigate('livetv.html?tab=3'); return; } }