diff options
| author | Luke <luke.pulverenti@gmail.com> | 2015-07-28 08:35:57 -0400 |
|---|---|---|
| committer | Luke <luke.pulverenti@gmail.com> | 2015-07-28 08:35:57 -0400 |
| commit | af4cb1de35c64d42f96694295b535e81384ac2fa (patch) | |
| tree | 1ec5abdeb29e8a20bb68b0a8351d1ce3c1d88493 | |
| parent | ba2574a03b76f98b3688755f2afaad4ee01333d0 (diff) | |
| parent | 162d6dd917e6d6e966a83e65c4ec1d340e602540 (diff) | |
Merge pull request #1149 from t-andre/dev
Reports - update localization
6 files changed, 86 insertions, 24 deletions
diff --git a/MediaBrowser.Api/Reports/Activities/ReportActivitiesBuilder.cs b/MediaBrowser.Api/Reports/Activities/ReportActivitiesBuilder.cs index 33d36f11b..83816c6e3 100644 --- a/MediaBrowser.Api/Reports/Activities/ReportActivitiesBuilder.cs +++ b/MediaBrowser.Api/Reports/Activities/ReportActivitiesBuilder.cs @@ -130,6 +130,7 @@ namespace MediaBrowser.Api.Reports { case HeaderMetadata.Name: option.Column = (i, r) => i.Name; + option.Header.SortField = ""; break; case HeaderMetadata.Overview: option.Column = (i, r) => i.Overview; diff --git a/MediaBrowser.Api/Reports/Common/HeaderMetadata.cs b/MediaBrowser.Api/Reports/Common/HeaderMetadata.cs index 74fcdd149..af5abf46a 100644 --- a/MediaBrowser.Api/Reports/Common/HeaderMetadata.cs +++ b/MediaBrowser.Api/Reports/Common/HeaderMetadata.cs @@ -47,6 +47,17 @@ namespace MediaBrowser.Api.Reports ImagePrimary, ImageBackdrop, ImageLogo, + Actor, + Studios, + Composer, + Director, + GuestStar, + Producer, + Writer, + Artist, + Years, + ParentalRatings, + CommunityRatings, //Activity logs Overview, diff --git a/MediaBrowser.Api/Reports/Common/ReportBuilderBase.cs b/MediaBrowser.Api/Reports/Common/ReportBuilderBase.cs index 81b441a07..6e1dd8d35 100644 --- a/MediaBrowser.Api/Reports/Common/ReportBuilderBase.cs +++ b/MediaBrowser.Api/Reports/Common/ReportBuilderBase.cs @@ -155,9 +155,7 @@ namespace MediaBrowser.Api.Reports if (internalHeader != HeaderMetadata.None) { string localHeader = "Header" + internalHeader.ToString(); - headerName = internalHeader != HeaderMetadata.None ? ReportHelper.GetJavaScriptLocalizedString(localHeader) : ""; - if (string.Compare(localHeader, headerName, StringComparison.CurrentCultureIgnoreCase) == 0) - headerName = ReportHelper.GetServerLocalizedString(localHeader); + headerName = ReportHelper.GetCoreLocalizedString(localHeader); } return headerName; } diff --git a/MediaBrowser.Api/Reports/Common/ReportHelper.cs b/MediaBrowser.Api/Reports/Common/ReportHelper.cs index c70cedf61..9dc4fbd51 100644 --- a/MediaBrowser.Api/Reports/Common/ReportHelper.cs +++ b/MediaBrowser.Api/Reports/Common/ReportHelper.cs @@ -76,14 +76,6 @@ namespace MediaBrowser.Api.Reports return rType; } - /// <summary> Gets java script localized string. </summary> - /// <param name="phrase"> The phrase. </param> - /// <returns> The java script localized string. </returns> - public static string GetJavaScriptLocalizedString(string phrase) - { - return BaseItem.LocalizationManager.GetLocalizedString(phrase); - } - /// <summary> Gets report view type. </summary> /// <param name="rowType"> The type. </param> /// <returns> The report view type. </returns> @@ -132,10 +124,10 @@ namespace MediaBrowser.Api.Reports return rType; } - /// <summary> Gets server localized string. </summary> + /// <summary> Gets core localized string. </summary> /// <param name="phrase"> The phrase. </param> - /// <returns> The server localized string. </returns> - public static string GetServerLocalizedString(string phrase) + /// <returns> The core localized string. </returns> + public static string GetCoreLocalizedString(string phrase) { return BaseItem.LocalizationManager.GetLocalizedString(phrase); } diff --git a/MediaBrowser.Api/Reports/Stat/ReportStatBuilder.cs b/MediaBrowser.Api/Reports/Stat/ReportStatBuilder.cs index 8cb57c030..c9ee6337f 100644 --- a/MediaBrowser.Api/Reports/Stat/ReportStatBuilder.cs +++ b/MediaBrowser.Api/Reports/Stat/ReportStatBuilder.cs @@ -110,7 +110,7 @@ namespace MediaBrowser.Api.Reports /// <returns> The resul production locations. </returns> private ReportStatResult GetResulProductionLocations(ReportStatResult result, BaseItem[] items, int topItem = 5) { - this.GetGroups(result, ReportHelper.GetServerLocalizedString("HeaderCountries"), topItem, + this.GetGroups(result, GetLocalizedHeader(HeaderMetadata.Countries), topItem, items.OfType<IHasProductionLocations>() .Where(x => x.ProductionLocations != null) .SelectMany(x => x.ProductionLocations) @@ -134,7 +134,7 @@ namespace MediaBrowser.Api.Reports /// <returns> The result community ratings. </returns> private ReportStatResult GetResultCommunityRatings(ReportStatResult result, BaseItem[] items, int topItem = 5) { - this.GetGroups(result, ReportHelper.GetServerLocalizedString("LabelCommunityRating"), topItem, + this.GetGroups(result, GetLocalizedHeader(HeaderMetadata.CommunityRating), topItem, items.Where(x => x.CommunityRating != null && x.CommunityRating > 0) .GroupBy(x => x.CommunityRating) .OrderByDescending(x => x.Count()) @@ -156,7 +156,7 @@ namespace MediaBrowser.Api.Reports /// <returns> The result genres. </returns> private ReportStatResult GetResultGenres(ReportStatResult result, BaseItem[] items, int topItem = 5) { - this.GetGroups(result, ReportHelper.GetServerLocalizedString("HeaderGenres"), topItem, + this.GetGroups(result, GetLocalizedHeader(HeaderMetadata.Genres), topItem, items.SelectMany(x => x.Genres) .GroupBy(x => x) .OrderByDescending(x => x.Count()) @@ -178,7 +178,7 @@ namespace MediaBrowser.Api.Reports /// <returns> The result parental ratings. </returns> private ReportStatResult GetResultParentalRatings(ReportStatResult result, BaseItem[] items, int topItem = 5) { - this.GetGroups(result, ReportHelper.GetServerLocalizedString("HeaderParentalRatings"), topItem, + this.GetGroups(result, GetLocalizedHeader(HeaderMetadata.ParentalRatings), topItem, items.Where(x => x.OfficialRating != null) .GroupBy(x => x.OfficialRating) .OrderByDescending(x => x.Count()) @@ -200,16 +200,26 @@ namespace MediaBrowser.Api.Reports /// <returns> The result persons. </returns> private ReportStatResult GetResultPersons(ReportStatResult result, BaseItem[] items, int topItem = 5) { - List<string> t = new List<string> { PersonType.Actor, PersonType.Composer, PersonType.Director, PersonType.GuestStar, PersonType.Producer, PersonType.Writer, "Artist", "AlbumArtist" }; + List<HeaderMetadata> t = new List<HeaderMetadata> + { + HeaderMetadata.Actor, + HeaderMetadata.Composer, + HeaderMetadata.Director, + HeaderMetadata.GuestStar, + HeaderMetadata.Producer, + HeaderMetadata.Writer, + HeaderMetadata.Artist, + HeaderMetadata.AlbumArtist + }; foreach (var item in t) { var ps = items.Where(x => x.People != null && x.SupportsPeople).SelectMany(x => x.People) - .Where(n => n.Type == item) + .Where(n => n.Type == item.ToString()) .GroupBy(x => x.Name) .OrderByDescending(x => x.Count()) .Take(topItem); if (ps != null && ps.Count() > 0) - this.GetGroups(result, ReportHelper.GetServerLocalizedString("Option" + item), topItem, + this.GetGroups(result, GetLocalizedHeader(item), topItem, ps.Select(x => new ReportStatItem { Name = x.Key, @@ -229,7 +239,7 @@ namespace MediaBrowser.Api.Reports /// <returns> The result production years. </returns> private ReportStatResult GetResultProductionYears(ReportStatResult result, BaseItem[] items, int topItem = 5) { - this.GetGroups(result, ReportHelper.GetServerLocalizedString("HeaderYears"), topItem, + this.GetGroups(result, GetLocalizedHeader(HeaderMetadata.Year), topItem, items.Where(x => x.ProductionYear != null && x.ProductionYear > 0) .GroupBy(x => x.ProductionYear) .OrderByDescending(x => x.Count()) @@ -251,7 +261,7 @@ namespace MediaBrowser.Api.Reports /// <returns> The result studios. </returns> private ReportStatResult GetResultStudios(ReportStatResult result, BaseItem[] items, int topItem = 5) { - this.GetGroups(result, ReportHelper.GetServerLocalizedString("HeaderStudios"), topItem, + this.GetGroups(result, GetLocalizedHeader(HeaderMetadata.Studios), topItem, items.SelectMany(x => x.Studios) .GroupBy(x => x) .OrderByDescending(x => x.Count()) diff --git a/MediaBrowser.Server.Implementations/Localization/Core/core.json b/MediaBrowser.Server.Implementations/Localization/Core/core.json index 607436054..44a10f0a9 100644 --- a/MediaBrowser.Server.Implementations/Localization/Core/core.json +++ b/MediaBrowser.Server.Implementations/Localization/Core/core.json @@ -125,5 +125,55 @@ "HeaderImagePrimary": "Primary", "HeaderImageBackdrop": "Backdrop", "HeaderImageLogo": "Logo", - "HeaderUserPrimaryImage": "User Image" + "HeaderUserPrimaryImage": "User Image", + "HeaderOverview": "Overview", + "HeaderShortOverview": "Short Overview", + "HeaderType": "Type", + "HeaderSeverity": "Severity", + "HeaderUser": "User", + "HeaderName": "Name", + "HeaderDate": "Date", + "HeaderPremiereDate": "Premiere Date", + "HeaderDateAdded": "Date Added", + "HeaderReleaseDate": "Release date", + "HeaderRuntime": "Runtime", + "HeaderPlayCount": "Play Count", + "HeaderSeason": "Season", + "HeaderSeasonNumber": "Season number", + "HeaderSeries": "Series:", + "HeaderNetwork": "Network", + "HeaderYear": "Year:", + "HeaderYears": "Years:", + "HeaderParentalRating": "Parental Rating", + "HeaderCommunityRating": "Community rating", + "HeaderTrailers": "Trailers", + "HeaderSpecials": "Specials", + "HeaderGameSystems": "Game Systems", + "HeaderPlayers": "Players:", + "HeaderAlbumArtists": "Album Artists", + "HeaderAlbums": "Albums", + "HeaderDisc": "Disc", + "HeaderTrack": "Track", + "HeaderAudio": "Audio", + "HeaderVideo": "Video", + "HeaderEmbeddedImage": "Embedded image", + "HeaderResolution": "Resolution", + "HeaderSubtitles": "Subtitles", + "HeaderGenres": "Genres", + "HeaderCountries": "Countries", + "HeaderStatus": "Status", + "HeaderTracks": "Tracks", + "HeaderMusicArtist": "Music artist", + "HeaderLocked": "Locked", + "HeaderStudios": "Studios", + "HeaderActor": "Actors", + "HeaderComposer": "Composers", + "HeaderDirector": "Directors", + "HeaderGuestStar": "Guest star", + "HeaderProducer": "Producers", + "HeaderWriter": "Writers", + "HeaderParentalRatings": "Parental Ratings", + "HeaderCommunityRatings": "Community ratings", + + } |
