diff --git a/dashboard-ui/scripts/extensions.js b/dashboard-ui/scripts/extensions.js index 712980d8b4..c819ecbae0 100644 --- a/dashboard-ui/scripts/extensions.js +++ b/dashboard-ui/scripts/extensions.js @@ -513,8 +513,15 @@ function ticks_to_human(str) { window.Globalize = { translate: function (key) { - return window.localizationGlossary[key] || key; + var val = window.localizationGlossary[key] || key; + for (var i = 1; i < arguments.length; i++) { + + val = val.replace('{' + (i - 1) + '}', arguments[i]); + + } + + return val; } }; diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index 064d21888f..11ef46dc0f 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -145,10 +145,10 @@ minutes = minutes || 1; - childText += Math.round(minutes) + " min"; + childText += Globalize.translate('ValueMinutes', Math.round(minutes)); } else { - childText += '0 min'; + childText += Globalize.translate('ValueMinutes', 0); } //childText += item.ChildCount == 1 ? "1 item" : item.ChildCount + " items"; @@ -248,28 +248,28 @@ var html = '
'; html += ''; @@ -313,14 +313,14 @@ var html = '
'; html += ''; @@ -499,7 +499,7 @@ if (options.index == 'disc') { - return item.ParentIndexNumber == null ? '' : 'Disc ' + item.ParentIndexNumber; + return item.ParentIndexNumber == null ? '' : Globalize.translate('ValueDiscNumber', item.ParentIndexNumber); } var sortBy = (options.sortBy || '').toLowerCase(); @@ -521,12 +521,12 @@ } if (sortBy.indexOf('officialrating') == 0) { - return item.OfficialRating || 'Unrated'; + return item.OfficialRating || Globalize.translate('HeaderUnrated'); } if (sortBy.indexOf('communityrating') == 0) { if (item.CommunityRating == null) { - return 'Unrated'; + return Globalize.translate('HeaderUnrated'); } return Math.floor(item.CommunityRating); @@ -534,7 +534,7 @@ if (sortBy.indexOf('criticrating') == 0) { if (item.CriticRating == null) { - return 'Unrated'; + return Globalize.translate('HeaderUnrated'); } return Math.floor(item.CriticRating); @@ -542,7 +542,7 @@ if (sortBy.indexOf('metascore') == 0) { if (item.Metascore == null) { - return 'Unrated'; + return Globalize.translate('HeaderUnrated'); } return Math.floor(item.Metascore); @@ -683,9 +683,9 @@ var textlines = []; if (item.Type == 'Episode') { - textlines.push(item.SeriesName || 'Unknown Series'); + textlines.push(item.SeriesName || ' '); } else if (item.Type == 'MusicAlbum') { - textlines.push(item.AlbumArtist || 'Unknown Artist'); + textlines.push(item.AlbumArtist || ' '); } var displayName = LibraryBrowser.getPosterViewDisplayName(item); @@ -696,18 +696,18 @@ textlines.push(displayName); if (item.Type == 'Audio') { - textlines.push(item.Artists.join(', ') || 'Unknown Artist'); + textlines.push(item.Artists.join(', ') || ' '); } if (item.Type == 'Game') { - textlines.push(item.GameSystem || 'Unknown Game System'); + textlines.push(item.GameSystem || ' '); } else if (item.Type == 'MusicGenre') { - textlines.push('Music genre'); + textlines.push(' '); } else if (item.Type == 'MusicArtist') { - textlines.push('Music artist'); + textlines.push(' '); } else { textlines.push(LibraryBrowser.getMiscInfoHtml(item)); @@ -874,7 +874,7 @@ if (options.showPremiereDateIndex && futureDateText) { - var val = futureDateText || "Unknown Date"; + var val = futureDateText || Globalize.translate('HeaderUnknownDate'); if (val != currentIndexValue) { @@ -882,7 +882,7 @@ currentIndexValue = val; } } else if (options.timeline) { - var year = item.ProductionYear || "Unknown Year"; + var year = item.ProductionYear || Globalize.translate('HeaderUnknownYear'); if (year != currentIndexValue) { @@ -1257,7 +1257,7 @@ if (progressHtml) { html += "
"; - html += progressHtml || " "; + html += progressHtml; html += "
"; } }