From 9c61eb5dd79ac5b20532351a917c800b14811bdb Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 30 May 2014 15:23:56 -0400 Subject: [PATCH] updated translations --- dashboard-ui/collections.html | 3 ++ dashboard-ui/index.html | 1 - dashboard-ui/moviesrecommended.html | 4 ++ dashboard-ui/scripts/indexpage.js | 2 +- dashboard-ui/scripts/librarylist.js | 42 ++++--------------- dashboard-ui/scripts/librarypathmapping.js | 2 +- dashboard-ui/scripts/livetvnewrecording.js | 18 +++++++- dashboard-ui/scripts/livetvprogram.js | 4 +- dashboard-ui/scripts/livetvrecording.js | 4 +- dashboard-ui/scripts/livetvrecordinglist.js | 2 +- dashboard-ui/scripts/livetvseriestimer.js | 8 ++-- dashboard-ui/scripts/livetvseriestimers.js | 16 +++---- dashboard-ui/scripts/livetvstatus.js | 38 +++++++++-------- dashboard-ui/scripts/livetvtimer.js | 6 +-- dashboard-ui/scripts/livetvtimers.js | 6 +-- dashboard-ui/scripts/loginpage.js | 2 +- dashboard-ui/scripts/mediacontroller.js | 14 +++---- dashboard-ui/scripts/medialibrarypage.js | 2 +- dashboard-ui/scripts/metadataadvanced.js | 20 --------- dashboard-ui/scripts/metadatasubtitles.js | 5 --- dashboard-ui/scripts/moviecollections.js | 4 +- dashboard-ui/scripts/moviesrecommended.js | 12 +++--- dashboard-ui/scripts/mypreferencesdisplay.js | 2 +- .../scripts/mypreferenceslanguages.js | 2 +- .../scripts/mypreferenceswebclient.js | 2 +- dashboard-ui/scripts/notifications.js | 30 ++++++------- dashboard-ui/scripts/notificationsettings.js | 4 +- dashboard-ui/scripts/nowplayingbar.js | 16 +++---- dashboard-ui/scripts/nowplayingpage.js | 12 +++--- dashboard-ui/scripts/plugincatalogpage.js | 6 +-- dashboard-ui/scripts/pluginspage.js | 12 +++--- dashboard-ui/scripts/scheduledtaskpage.js | 4 +- dashboard-ui/scripts/scheduledtaskspage.js | 15 +++---- dashboard-ui/scripts/search.js | 12 +++--- dashboard-ui/scripts/supporterkeypage.js | 12 +++--- dashboard-ui/scripts/useredit.js | 4 +- dashboard-ui/scripts/userimagepage.js | 10 ++--- dashboard-ui/scripts/userparentalcontrol.js | 2 +- dashboard-ui/scripts/userpassword.js | 12 +++--- dashboard-ui/scripts/userprofilespage.js | 12 +++--- 40 files changed, 181 insertions(+), 203 deletions(-) diff --git a/dashboard-ui/collections.html b/dashboard-ui/collections.html index f7b53096da..fc55bc292a 100644 --- a/dashboard-ui/collections.html +++ b/dashboard-ui/collections.html @@ -25,6 +25,9 @@
+
diff --git a/dashboard-ui/index.html b/dashboard-ui/index.html index 984d80ad8f..7d9efac278 100644 --- a/dashboard-ui/index.html +++ b/dashboard-ui/index.html @@ -18,7 +18,6 @@ diff --git a/dashboard-ui/moviesrecommended.html b/dashboard-ui/moviesrecommended.html index 218b2ae956..f2793e6c98 100644 --- a/dashboard-ui/moviesrecommended.html +++ b/dashboard-ui/moviesrecommended.html @@ -28,6 +28,10 @@
+
-
diff --git a/dashboard-ui/scripts/indexpage.js b/dashboard-ui/scripts/indexpage.js index 90899a5218..00919efdcf 100644 --- a/dashboard-ui/scripts/indexpage.js +++ b/dashboard-ui/scripts/indexpage.js @@ -143,7 +143,7 @@ }); } - var html = ''; + var html = '
'; if (index) { html += '

My Library

'; diff --git a/dashboard-ui/scripts/librarylist.js b/dashboard-ui/scripts/librarylist.js index 94f483c28b..d2f2b1eaa9 100644 --- a/dashboard-ui/scripts/librarylist.js +++ b/dashboard-ui/scripts/librarylist.js @@ -109,22 +109,22 @@ var resumePosition = (item.UserData || {}).PlaybackPositionTicks || 0; var onPlayClick = 'LibraryBrowser.showPlayMenu(this, \'' + item.Id + '\', \'' + item.Type + '\', ' + item.IsFolder + ', \'' + item.MediaType + '\', ' + resumePosition + ');return false;'; - html += ''; + html += ''; buttonCount++; if (item.MediaType == "Audio" || item.Type == "MusicAlbum") { - html += ''; + html += ''; buttonCount++; } } if (item.LocalTrailerCount && item.PlayAccess == 'Full') { - html += ''; + html += ''; buttonCount++; } if (currentUser.Configuration.IsAdministrator && item.Type != "Recording" && item.Type != "Program") { - html += ''; + html += ''; buttonCount++; } @@ -158,7 +158,7 @@ function splitVersions(id, page) { - Dashboard.confirm("Are you sure you wish to split the media sources into separate items?", "Split Media Apart", function (confirmResult) { + Dashboard.confirm(Globalize.translate('MessageConfirmSplitMedia'), Globalize.translate('HeaderSplitMedia'), function (confirmResult) { if (confirmResult) { @@ -179,30 +179,6 @@ } - function getContextMenuOptions(elem) { - - var items = []; - - var id = elem.getAttribute('data-itemid'); - - items.push({ type: 'header', text: 'Edit' }); - - items.push({ type: 'link', text: 'Details', url: 'edititemmetadata.html?id=' + id }); - - items.push({ type: 'link', text: 'Images', url: 'edititemimages.html?id=' + id }); - - var versionCount = parseInt(elem.getAttribute('data-mediasourcecount') || '0'); - - if (versionCount > 1) { - - items.push({ type: 'divider' }); - items.push({ type: 'header', text: 'Manage' }); - items.push({ type: 'command', text: 'Split Versions Apart', name: 'SplitVersions' }); - } - - return items; - } - $.fn.createPosterItemMenus = function (options) { options = options || {}; @@ -324,8 +300,8 @@ if (selection.length < 2) { Dashboard.alert({ - message: "Please select two or more items to group together.", - title: "Error" + message: Globalize.translate('MessagePleaseSelectItemsToGroup'), + title: Globalize.translate('HeaderError') }); return; @@ -337,9 +313,9 @@ }).join('
'); - var msg = "The following titles will be grouped into one item:

" + names; + var msg = Globalize.translate('MessageTheFollowingItemsWillBeGrouped') + "

" + names; - msg += "

Media Browser clients will automatically choose the optimal version to play based on device and network performance. Are you sure you wish to continue?"; + msg += "

" + Globalize.translate('MessageConfirmItemGrouping'); Dashboard.confirm(msg, "Group Versions", function (confirmResult) { diff --git a/dashboard-ui/scripts/librarypathmapping.js b/dashboard-ui/scripts/librarypathmapping.js index 7467ef927b..7edd24c04c 100644 --- a/dashboard-ui/scripts/librarypathmapping.js +++ b/dashboard-ui/scripts/librarypathmapping.js @@ -4,7 +4,7 @@ function remove(page, index) { - Dashboard.confirm("Are you sure you wish to delete this path substitution?", "Confirm Deletion", function (result) { + Dashboard.confirm(Globalize.translate('MessageConfirmPathSubstitutionDeletion'), Globalize.translate('HeaderConfirmDeletion'), function (result) { if (result) { diff --git a/dashboard-ui/scripts/livetvnewrecording.js b/dashboard-ui/scripts/livetvnewrecording.js index e40dc5631e..20330a4631 100644 --- a/dashboard-ui/scripts/livetvnewrecording.js +++ b/dashboard-ui/scripts/livetvnewrecording.js @@ -61,7 +61,7 @@ function selectDays(page, days) { - var daysOfWeek = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']; + var daysOfWeek = getDaysOfWeek(); for (var i = 0, length = daysOfWeek.length; i < length; i++) { @@ -72,10 +72,24 @@ } } + + function getDaysOfWeek() { + + // Do not localize. These are used as values, not text. + return [ + 'Sunday', + 'Monday', + 'Tuesday', + 'Wednesday', + 'Thursday', + 'Friday', + 'Saturday' + ]; + } function getDays(page) { - var daysOfWeek = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']; + var daysOfWeek = getDaysOfWeek(); var days = []; diff --git a/dashboard-ui/scripts/livetvprogram.js b/dashboard-ui/scripts/livetvprogram.js index 5e5e1070ac..04b4680367 100644 --- a/dashboard-ui/scripts/livetvprogram.js +++ b/dashboard-ui/scripts/livetvprogram.js @@ -4,7 +4,7 @@ function deleteTimer(page, id) { - Dashboard.confirm("Are you sure you wish to cancel this recording?", "Confirm Recording Cancellation", function (result) { + Dashboard.confirm(Globalize.translate('MessageConfirmRecordingCancellation'), Globalize.translate('HeaderConfirmRecordingCancellation'), function (result) { if (result) { @@ -12,7 +12,7 @@ ApiClient.cancelLiveTvTimer(id).done(function () { - Dashboard.alert('Recording cancelled.'); + Dashboard.alert(Globalize.translate('MessageRecordingCancelled')); reload(page); }); diff --git a/dashboard-ui/scripts/livetvrecording.js b/dashboard-ui/scripts/livetvrecording.js index 23ba53e22a..153793ba3f 100644 --- a/dashboard-ui/scripts/livetvrecording.js +++ b/dashboard-ui/scripts/livetvrecording.js @@ -4,7 +4,7 @@ function deleteRecording() { - Dashboard.confirm("Are you sure you wish to delete this recording?", "Confirm Recording Deletion", function (result) { + Dashboard.confirm(Globalize.transate('MessageConfirmRecordingDeletion'), Globalize.transate('HeaderConfirmRecordingDeletion'), function (result) { if (result) { @@ -12,7 +12,7 @@ ApiClient.deleteLiveTvRecording(currentItem.Id).done(function () { - Dashboard.alert('Recording deleted'); + Dashboard.alert(Globalize.transate('MessageRecordingDeleted')); Dashboard.navigate('livetvrecordings.html'); }); diff --git a/dashboard-ui/scripts/livetvrecordinglist.js b/dashboard-ui/scripts/livetvrecordinglist.js index c78382759e..40042866c1 100644 --- a/dashboard-ui/scripts/livetvrecordinglist.js +++ b/dashboard-ui/scripts/livetvrecordinglist.js @@ -98,7 +98,7 @@ }); } else { - $('.listName', page).html('All Recordings'); + $('.listName', page).html(Globalize.translate('HeaderAllRecordings')); } }).on('pageshow', "#liveTvRecordingListPage", function () { diff --git a/dashboard-ui/scripts/livetvseriestimer.js b/dashboard-ui/scripts/livetvseriestimer.js index f8065c260b..6a4ece92b9 100644 --- a/dashboard-ui/scripts/livetvseriestimer.js +++ b/dashboard-ui/scripts/livetvseriestimer.js @@ -4,7 +4,7 @@ function deleteTimer(page, id) { - Dashboard.confirm("Are you sure you wish to cancel this recording?", "Confirm Recording Cancellation", function (result) { + Dashboard.confirm(Globalize.translate('MessageConfirmRecordingCancellation'), Globalize.translate('HeaderConfirmRecordingCancellation'), function (result) { if (result) { @@ -12,7 +12,7 @@ ApiClient.cancelLiveTvTimer(id).done(function () { - Dashboard.alert('Recording cancelled.'); + Dashboard.alert(Globalize.translate('MessageRecordingCancelled')); reload(page); }); @@ -108,7 +108,7 @@ item.Days = getDays(form); ApiClient.updateLiveTvSeriesTimer(item).done(function () { - Dashboard.alert('Timer Saved'); + Dashboard.alert(Globalize.translate('MessageRecordingSaved')); }); }); @@ -204,7 +204,7 @@ html += ''; - html += 'Cancel Recording'; + html += '' + Globalize.translate('ButonCancelRecording') + ''; html += ''; } diff --git a/dashboard-ui/scripts/livetvseriestimers.js b/dashboard-ui/scripts/livetvseriestimers.js index 71880ef31e..9e903ebf1a 100644 --- a/dashboard-ui/scripts/livetvseriestimers.js +++ b/dashboard-ui/scripts/livetvseriestimers.js @@ -8,7 +8,7 @@ function deleteSeriesTimer(page, id) { - Dashboard.confirm("Are you sure you wish to cancel this series?", "Confirm Series Cancellation", function (result) { + Dashboard.confirm(Globalize.translate('MessageConfirmSeriesCancellation'), Globalize.translate('HeaderConfirmSeriesCancellation'), function (result) { if (result) { @@ -16,7 +16,7 @@ ApiClient.cancelLiveTvSeriesTimer(id).done(function () { - Dashboard.alert('Series cancelled.'); + Dashboard.alert(Globalize.translate('MessageSeriesCancelled')); reload(page); }); @@ -31,7 +31,7 @@ html += '
    '; - html += '
  • Series Recordings
  • '; + html += '
  • ' + Globalize.translate('HeaderSeriesRecordings') + '
  • '; for (var i = 0, length = timers.length; i < length; i++) { @@ -55,7 +55,7 @@ if (timer.RecordAnyTime) { - html += ' - Any time.'; + html += ' - ' + Globalize.translate('LabelAnytime'); } else { html += ' - ' + LiveTvHelpers.getDisplayTime(timer.StartDate); } @@ -63,7 +63,7 @@ html += '

    '; if (timer.RecordAnyChannel) { - html += 'All Channels'; + html += Globalize.translate('LabelAllChannels'); } else if (timer.ChannelId) { html += timer.ChannelName; @@ -71,7 +71,7 @@ html += '

    '; html += ''; - html += 'Cancel Series'; + html += '' + Globalize.translate('ButtonCancelSeries') + ''; html += ''; } @@ -80,7 +80,7 @@ var elem = $('#items', page).html(html).trigger('create'); - $('.btnCancelSeries', elem).on('click', function() { + $('.btnCancelSeries', elem).on('click', function () { deleteSeriesTimer(page, this.getAttribute('data-seriestimerid')); @@ -121,7 +121,7 @@ var page = this; reload(page); - + }).on('pageinit', "#liveTvSeriesTimersPage", function () { var page = this; diff --git a/dashboard-ui/scripts/livetvstatus.js b/dashboard-ui/scripts/livetvstatus.js index 1a465bca31..8eaeb203c1 100644 --- a/dashboard-ui/scripts/livetvstatus.js +++ b/dashboard-ui/scripts/livetvstatus.js @@ -2,9 +2,9 @@ function resetTuner(page, id) { - var message = 'Are you sure you wish to reset this tuner? Any active players or recordings will be abruptly stopped.'; + var message = Globalize.translate('MessageConfirmResetTuner'); - Dashboard.confirm(message, "Reset Tuner", function (confirmResult) { + Dashboard.confirm(message, Globalize.translate('HeaderResetTuner'), function (confirmResult) { if (confirmResult) { @@ -43,20 +43,24 @@ if (tuner.Status == 'RecordingTv') { if (tuner.ChannelName) { - html += 'Recording ' + tuner.ChannelName + ''; + html += ''; + html += Globalize.translate('StatusRecordingProgram').replace('{0}', tuner.ChannelName); + html += ''; } else { - html += 'Recording'; + html += Globalize.translate('StatusRecording'); } } else if (tuner.Status == 'LiveTv') { if (tuner.ChannelName) { - html += 'Watching ' + tuner.ChannelName + ''; + html += ''; + html += Globalize.translate('StatusWatchingProgram').replace('{0}', tuner.ChannelName); + html += ''; } else { - html += 'Watching'; + html += Globalize.translate('StatusWatching'); } } else { @@ -77,7 +81,7 @@ html += ''; html += ''; - html += ''; + html += ''; html += ''; html += ''; @@ -117,10 +121,10 @@ var versionHtml = service.Version || 'Unknown'; if (service.HasUpdateAvailable) { - versionHtml += ' (Update available)'; + versionHtml += ' ' + Globalize.translate('LiveTvUpdateAvailable') + ''; } else { - versionHtml += ' Up to date!'; + versionHtml += ' ' + Globalize.translate('LabelVersionUpToDate'); } $('#activeServiceVersion', page).html(versionHtml).trigger('create'); @@ -180,23 +184,23 @@ var progress = (task.CurrentProgressPercentage || 0).toFixed(1); var progressElem = $('.refreshGuideProgress', page).val(progress); - + if (task.State == 'Running') { progressElem.show(); } else { progressElem.hide(); } - + var lastResult = task.LastExecutionResult ? task.LastExecutionResult.Status : ''; - + if (lastResult == "Failed") { - $('.lastRefreshGuideResult', page).html('(failed)'); + $('.lastRefreshGuideResult', page).html('' + Globalize.translate('LabelFailed') + ''); } else if (lastResult == "Cancelled") { - $('.lastRefreshGuideResult', page).html('(cancelled)'); + $('.lastRefreshGuideResult', page).html('' + Globalize.translate('LabelCancelled') + ''); } else if (lastResult == "Aborted") { - $('.lastRefreshGuideResult', page).html('(Aborted by server shutdown)'); + $('.lastRefreshGuideResult', page).html('' + Globalize.translate('LabelAbortedByServerShutdown') + ''); } else { $('.lastRefreshGuideResult', page).html(lastResult); } @@ -243,9 +247,9 @@ if (ApiClient.isWebSocketOpen()) { ApiClient.sendWebSocketMessage("ScheduledTasksInfoStart", "1000,1000"); } - + $(ApiClient).on("websocketmessage", onWebSocketMessage).on('websocketopen', function () { - + if (ApiClient.isWebSocketOpen()) { ApiClient.sendWebSocketMessage("ScheduledTasksInfoStart", "1000,1000"); } diff --git a/dashboard-ui/scripts/livetvtimer.js b/dashboard-ui/scripts/livetvtimer.js index 49b885a575..619b2ac507 100644 --- a/dashboard-ui/scripts/livetvtimer.js +++ b/dashboard-ui/scripts/livetvtimer.js @@ -4,7 +4,7 @@ function deleteTimer(page, id) { - Dashboard.confirm("Are you sure you wish to cancel this recording?", "Confirm Recording Cancellation", function (result) { + Dashboard.confirm(Globalize.translate('MessageConfirmRecordingCancellation'), Globalize.translate('HeaderConfirmRecordingCancellation'), function (result) { if (result) { @@ -12,7 +12,7 @@ ApiClient.cancelLiveTvTimer(id).done(function () { - Dashboard.alert('Recording cancelled.'); + Dashboard.alert(Globalize.translate('MessageRecordingCancelled')); Dashboard.navigate('livetvtimers.html'); }); @@ -81,7 +81,7 @@ item.IsPostPaddingRequired = $('#chkPostPaddingRequired', form).checked(); ApiClient.updateLiveTvTimer(item).done(function () { - Dashboard.alert('Timer Saved'); + Dashboard.alert(Globalize.translate('MessageRecordingSaved')); }); }); diff --git a/dashboard-ui/scripts/livetvtimers.js b/dashboard-ui/scripts/livetvtimers.js index 79ac2fa56a..d9a8066efb 100644 --- a/dashboard-ui/scripts/livetvtimers.js +++ b/dashboard-ui/scripts/livetvtimers.js @@ -2,7 +2,7 @@ function deleteTimer(page, id) { - Dashboard.confirm("Are you sure you wish to cancel this recording?", "Confirm Recording Cancellation", function (result) { + Dashboard.confirm(Globalize.translate('MessageConfirmRecordingCancellation'), Globalize.translate('HeaderConfirmRecordingCancellation'), function (result) { if (result) { @@ -10,7 +10,7 @@ ApiClient.cancelLiveTvTimer(id).done(function () { - Dashboard.alert('Recording cancelled.'); + Dashboard.alert(Globalize.translate('MessageRecordingCancelled')); reload(page); }); @@ -77,7 +77,7 @@ html += ''; - html += 'Cancel Recording'; + html += '' + Globalize.translate('ButonCancelRecording') + ''; html += ''; } diff --git a/dashboard-ui/scripts/loginpage.js b/dashboard-ui/scripts/loginpage.js index d6ca6a3581..65c75433e2 100644 --- a/dashboard-ui/scripts/loginpage.js +++ b/dashboard-ui/scripts/loginpage.js @@ -117,7 +117,7 @@ Dashboard.hideLoadingMsg(); setTimeout(function () { - Dashboard.showError("Invalid user or password."); + Dashboard.showError(Globalize.translate('MessageInvalidUser')); }, 300); }); diff --git a/dashboard-ui/scripts/mediacontroller.js b/dashboard-ui/scripts/mediacontroller.js index 5145f165a8..ca99256785 100644 --- a/dashboard-ui/scripts/mediacontroller.js +++ b/dashboard-ui/scripts/mediacontroller.js @@ -52,7 +52,7 @@ var currentPlayer; var currentTargetInfo; var players = []; - + var keys = new bindKeys(self); $(window).on("keydown", keys.keyBinding); @@ -438,7 +438,7 @@ html += ''; - html += '

    All plays will be sent to the selected player.

    '; + html += '

    ' + Globalize.translate('LabelAllPlaysSentToPlayer') + '

    '; checkedHtml = enableMirrorMode ? ' checked="checked"' : ''; html += '
    '; @@ -521,7 +521,7 @@ var self = this; var keyResult = {}; - self.keyBinding = function(e) { + self.keyBinding = function (e) { if (bypass()) return; @@ -533,7 +533,7 @@ } }; - self.keyPrevent = function(e) { + self.keyPrevent = function (e) { if (bypass()) return; @@ -544,10 +544,10 @@ } }; - keyResult[32] = function() { // spacebar + keyResult[32] = function () { // spacebar var player = controller.getCurrentPlayer(); - + player.getPlayerState().done(function (result) { var state = result; @@ -562,7 +562,7 @@ }); }; - var bypass = function() { + var bypass = function () { // Get active elem to see what type it is var active = document.activeElement; var type = active.type || active.tagName.toLowerCase(); diff --git a/dashboard-ui/scripts/medialibrarypage.js b/dashboard-ui/scripts/medialibrarypage.js index 5199607ca5..5636640fce 100644 --- a/dashboard-ui/scripts/medialibrarypage.js +++ b/dashboard-ui/scripts/medialibrarypage.js @@ -298,7 +298,7 @@ var location = virtualFolder.Locations[index]; - Dashboard.confirm("Are you sure you wish to remove " + location + "?", "Remove Media Location", function (confirmResult) { + Dashboard.confirm("Are you sure you wish to remove this location?", "Remove Media Location", function (confirmResult) { if (confirmResult) { diff --git a/dashboard-ui/scripts/metadataadvanced.js b/dashboard-ui/scripts/metadataadvanced.js index d496e7da75..810abf5382 100644 --- a/dashboard-ui/scripts/metadataadvanced.js +++ b/dashboard-ui/scripts/metadataadvanced.js @@ -26,26 +26,6 @@ Dashboard.hideLoadingMsg(); }, - loadItemTypes: function (page, configuration, types) { - - var html = '
    '; - - for (var i = 0, length = types.length; i < length; i++) { - - var type = types[i]; - var id = "checkbox-" + i + "a"; - - var checkedAttribute = configuration.InternetProviderExcludeTypes.indexOf(type) != -1 ? ' checked="checked"' : ''; - - html += ''; - html += ''; - } - - html += "
    "; - - $('#divItemTypes', page).html(html).trigger("create"); - }, - onSubmit: function () { var form = this; diff --git a/dashboard-ui/scripts/metadatasubtitles.js b/dashboard-ui/scripts/metadatasubtitles.js index 08e963b336..c9e5bf8da7 100644 --- a/dashboard-ui/scripts/metadatasubtitles.js +++ b/dashboard-ui/scripts/metadatasubtitles.js @@ -58,11 +58,6 @@ }); - }).on('pageinit', "#metadataSubtitlesPage", function () { - - var page = this; - - }); function metadataSubtitlesPage() { diff --git a/dashboard-ui/scripts/moviecollections.js b/dashboard-ui/scripts/moviecollections.js index 6d239e5667..36ffd8dc28 100644 --- a/dashboard-ui/scripts/moviecollections.js +++ b/dashboard-ui/scripts/moviecollections.js @@ -43,10 +43,10 @@ }); html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount); - + $('.noItemsMessage', page).hide(); } else { - html += '

    Collections allow you to enjoy personalized groupings of Movies, Series, Albums, Books and Games. Click the New button to start creating Collections.

    '; + $('.noItemsMessage', page).show(); } $('#items', page).html(html).trigger('create').createPosterItemMenus(); diff --git a/dashboard-ui/scripts/moviesrecommended.js b/dashboard-ui/scripts/moviesrecommended.js index 037c1a9471..cc0136746d 100644 --- a/dashboard-ui/scripts/moviesrecommended.js +++ b/dashboard-ui/scripts/moviesrecommended.js @@ -9,18 +9,18 @@ switch (recommendation.RecommendationType) { case 'SimilarToRecentlyPlayed': - title = 'Because you watched ' + recommendation.BaselineItemName; + title = Globalize.translate('RecommendationBecauseYouWatched').replace("{0}", recommendation.BaselineItemName); break; case 'SimilarToLikedItem': - title = 'Because you like ' + recommendation.BaselineItemName; + title = Globalize.translate('RecommendationBecauseYouLike').replace("{0}", recommendation.BaselineItemName); break; case 'HasDirectorFromRecentlyPlayed': case 'HasLikedDirector': - title = 'Directed by ' + recommendation.BaselineItemName; + title = Globalize.translate('RecommendationDirectedBy').replace("{0}", recommendation.BaselineItemName); break; case 'HasActorFromRecentlyPlayed': case 'HasLikedActor': - title = 'Starring ' + recommendation.BaselineItemName; + title = Globalize.translate('RecommendationStarring').replace("{0}", recommendation.BaselineItemName); break; } @@ -88,12 +88,14 @@ if (!recommendations.length) { - $('.recommendations', page).html('

    No movie suggestions are currently available. Start watching and rating your movies, and then come back to view your recommendations.

    '); + $('.noItemsMessage', page).show(); + $('.recommendations', page).html(''); return; } var html = recommendations.map(getRecommendationHtml).join(''); + $('.noItemsMessage', page).hide(); $('.recommendations', page).html(html).createPosterItemMenus(); }); diff --git a/dashboard-ui/scripts/mypreferencesdisplay.js b/dashboard-ui/scripts/mypreferencesdisplay.js index f419f9625a..b74df3d3b8 100644 --- a/dashboard-ui/scripts/mypreferencesdisplay.js +++ b/dashboard-ui/scripts/mypreferencesdisplay.js @@ -17,7 +17,7 @@ user.Configuration.GroupMoviesIntoBoxSets = $('#chkGroupMoviesIntoCollections', page).checked(); ApiClient.updateUser(user).done(function () { - Dashboard.alert(Globalize.translate("SettingsSaved")); + Dashboard.alert(Globalize.translate('SettingsSaved')); }); } diff --git a/dashboard-ui/scripts/mypreferenceslanguages.js b/dashboard-ui/scripts/mypreferenceslanguages.js index 5f103f2e43..e9688d2696 100644 --- a/dashboard-ui/scripts/mypreferenceslanguages.js +++ b/dashboard-ui/scripts/mypreferenceslanguages.js @@ -42,7 +42,7 @@ user.Configuration.PlayDefaultAudioTrack = $('#chkPlayDefaultAudioTrack', page).checked(); ApiClient.updateUser(user).done(function () { - Dashboard.alert(Globalize.translate("SettingsSaved")); + Dashboard.alert(Globalize.translate('SettingsSaved')); }); } diff --git a/dashboard-ui/scripts/mypreferenceswebclient.js b/dashboard-ui/scripts/mypreferenceswebclient.js index 1ddfe1e3fd..8269882f17 100644 --- a/dashboard-ui/scripts/mypreferenceswebclient.js +++ b/dashboard-ui/scripts/mypreferenceswebclient.js @@ -23,7 +23,7 @@ ApiClient.updateDisplayPreferences('home', displayPreferences, userId, 'webclient').done(function () { - Dashboard.alert(Globalize.translate("SettingsSaved")); + Dashboard.alert(Globalize.translate('SettingsSaved')); }); } diff --git a/dashboard-ui/scripts/notifications.js b/dashboard-ui/scripts/notifications.js index 89d462e271..13700630a8 100644 --- a/dashboard-ui/scripts/notifications.js +++ b/dashboard-ui/scripts/notifications.js @@ -8,16 +8,16 @@ self.total = 0; - self.getNotificationsSummary = function() { + self.getNotificationsSummary = function () { self.getNotificationsSummaryPromise = self.getNotificationsSummaryPromise || ApiClient.getNotificationSummary(Dashboard.getCurrentUserId()); return self.getNotificationsSummaryPromise; }; - self.updateNotificationCount = function() { + self.updateNotificationCount = function () { - self.getNotificationsSummary().done(function(summary) { + self.getNotificationsSummary().done(function (summary) { var item = $('.btnNotifications').removeClass('levelNormal').removeClass('levelWarning').removeClass('levelError').html(summary.UnreadCount); @@ -27,13 +27,13 @@ }); }; - self.showNotificationsFlyout = function() { + self.showNotificationsFlyout = function () { var context = this; var html = '
    '; - html += 'Close'; + html += '' + Globalize.translate('ButtonClose') + ''; html += '
    '; html += '

    Notifications

    '; @@ -45,8 +45,8 @@ html += '

    '; - html += ''; - html += ''; + html += ''; + html += ''; html += '
    '; @@ -55,19 +55,19 @@ $(document.body).append(html); - $('.notificationsFlyout').popup({ positionTo: context }).trigger('create').popup("open").on("popupafterclose", function() { + $('.notificationsFlyout').popup({ positionTo: context }).trigger('create').popup("open").on("popupafterclose", function () { $(this).off("popupafterclose").remove(); - }).on('click', '.btnMarkRead', function() { + }).on('click', '.btnMarkRead', function () { - var ids = $('.unreadFlyoutNotification').map(function() { + var ids = $('.unreadFlyoutNotification').map(function () { return this.getAttribute('data-notificationid'); }).get(); - self.markNotificationsRead(ids, function() { + self.markNotificationsRead(ids, function () { $('.notificationsFlyout').popup("close"); @@ -85,9 +85,9 @@ refreshNotifications(startIndex, limit, elem, markReadButton, false); }; - self.markNotificationsRead = function(ids, callback) { + self.markNotificationsRead = function (ids, callback) { - ApiClient.markNotificationsRead(Dashboard.getCurrentUserId(), ids, true).done(function() { + ApiClient.markNotificationsRead(Dashboard.getCurrentUserId(), ids, true).done(function () { self.getNotificationsSummaryPromise = null; @@ -118,7 +118,7 @@ function listUnreadNotifications(list, totalRecordCount, startIndex, limit, elem, btn, showPaging) { if (!totalRecordCount) { - elem.html('

    No unread notifications.

    '); + elem.html('

    ' + Globalize.translate('LabelNoUnreadNotifications') + '

    '); btn.hide(); return; } @@ -178,7 +178,7 @@ } if (notification.Url) { - html += '

    More information

    '; + html += '

    ' + Globalize.translate('ButtonMoreInformation') + '

    '; } html += '
    '; diff --git a/dashboard-ui/scripts/notificationsettings.js b/dashboard-ui/scripts/notificationsettings.js index d8743bced7..ab3d6ccc5a 100644 --- a/dashboard-ui/scripts/notificationsettings.js +++ b/dashboard-ui/scripts/notificationsettings.js @@ -26,9 +26,9 @@ itemHtml += '

    ' + i.Name + '

    '; if (i.Enabled) { - itemHtml += '

    Enabled

    '; + itemHtml += '

    ' + Globalize.translate('LabelEnabled') + '

    '; } else { - itemHtml += '

    Disabled

    '; + itemHtml += '

    ' + Globalize.translate('LabelDisabled') + '

    '; } itemHtml += ''; diff --git a/dashboard-ui/scripts/nowplayingbar.js b/dashboard-ui/scripts/nowplayingbar.js index 42fd13b4e7..1a61392c6a 100644 --- a/dashboard-ui/scripts/nowplayingbar.js +++ b/dashboard-ui/scripts/nowplayingbar.js @@ -22,13 +22,13 @@ html += '