mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-09 23:30:50 +02:00
Reports - update localization
This commit is contained in:
parent
ba2574a03b
commit
162d6dd917
|
@ -130,6 +130,7 @@ namespace MediaBrowser.Api.Reports
|
||||||
{
|
{
|
||||||
case HeaderMetadata.Name:
|
case HeaderMetadata.Name:
|
||||||
option.Column = (i, r) => i.Name;
|
option.Column = (i, r) => i.Name;
|
||||||
|
option.Header.SortField = "";
|
||||||
break;
|
break;
|
||||||
case HeaderMetadata.Overview:
|
case HeaderMetadata.Overview:
|
||||||
option.Column = (i, r) => i.Overview;
|
option.Column = (i, r) => i.Overview;
|
||||||
|
|
|
@ -47,6 +47,17 @@ namespace MediaBrowser.Api.Reports
|
||||||
ImagePrimary,
|
ImagePrimary,
|
||||||
ImageBackdrop,
|
ImageBackdrop,
|
||||||
ImageLogo,
|
ImageLogo,
|
||||||
|
Actor,
|
||||||
|
Studios,
|
||||||
|
Composer,
|
||||||
|
Director,
|
||||||
|
GuestStar,
|
||||||
|
Producer,
|
||||||
|
Writer,
|
||||||
|
Artist,
|
||||||
|
Years,
|
||||||
|
ParentalRatings,
|
||||||
|
CommunityRatings,
|
||||||
|
|
||||||
//Activity logs
|
//Activity logs
|
||||||
Overview,
|
Overview,
|
||||||
|
|
|
@ -155,9 +155,7 @@ namespace MediaBrowser.Api.Reports
|
||||||
if (internalHeader != HeaderMetadata.None)
|
if (internalHeader != HeaderMetadata.None)
|
||||||
{
|
{
|
||||||
string localHeader = "Header" + internalHeader.ToString();
|
string localHeader = "Header" + internalHeader.ToString();
|
||||||
headerName = internalHeader != HeaderMetadata.None ? ReportHelper.GetJavaScriptLocalizedString(localHeader) : "";
|
headerName = ReportHelper.GetCoreLocalizedString(localHeader);
|
||||||
if (string.Compare(localHeader, headerName, StringComparison.CurrentCultureIgnoreCase) == 0)
|
|
||||||
headerName = ReportHelper.GetServerLocalizedString(localHeader);
|
|
||||||
}
|
}
|
||||||
return headerName;
|
return headerName;
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,14 +76,6 @@ namespace MediaBrowser.Api.Reports
|
||||||
return rType;
|
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>
|
/// <summary> Gets report view type. </summary>
|
||||||
/// <param name="rowType"> The type. </param>
|
/// <param name="rowType"> The type. </param>
|
||||||
/// <returns> The report view type. </returns>
|
/// <returns> The report view type. </returns>
|
||||||
|
@ -132,10 +124,10 @@ namespace MediaBrowser.Api.Reports
|
||||||
return rType;
|
return rType;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> Gets server localized string. </summary>
|
/// <summary> Gets core localized string. </summary>
|
||||||
/// <param name="phrase"> The phrase. </param>
|
/// <param name="phrase"> The phrase. </param>
|
||||||
/// <returns> The server localized string. </returns>
|
/// <returns> The core localized string. </returns>
|
||||||
public static string GetServerLocalizedString(string phrase)
|
public static string GetCoreLocalizedString(string phrase)
|
||||||
{
|
{
|
||||||
return BaseItem.LocalizationManager.GetLocalizedString(phrase);
|
return BaseItem.LocalizationManager.GetLocalizedString(phrase);
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,7 +110,7 @@ namespace MediaBrowser.Api.Reports
|
||||||
/// <returns> The resul production locations. </returns>
|
/// <returns> The resul production locations. </returns>
|
||||||
private ReportStatResult GetResulProductionLocations(ReportStatResult result, BaseItem[] items, int topItem = 5)
|
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>()
|
items.OfType<IHasProductionLocations>()
|
||||||
.Where(x => x.ProductionLocations != null)
|
.Where(x => x.ProductionLocations != null)
|
||||||
.SelectMany(x => x.ProductionLocations)
|
.SelectMany(x => x.ProductionLocations)
|
||||||
|
@ -134,7 +134,7 @@ namespace MediaBrowser.Api.Reports
|
||||||
/// <returns> The result community ratings. </returns>
|
/// <returns> The result community ratings. </returns>
|
||||||
private ReportStatResult GetResultCommunityRatings(ReportStatResult result, BaseItem[] items, int topItem = 5)
|
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)
|
items.Where(x => x.CommunityRating != null && x.CommunityRating > 0)
|
||||||
.GroupBy(x => x.CommunityRating)
|
.GroupBy(x => x.CommunityRating)
|
||||||
.OrderByDescending(x => x.Count())
|
.OrderByDescending(x => x.Count())
|
||||||
|
@ -156,7 +156,7 @@ namespace MediaBrowser.Api.Reports
|
||||||
/// <returns> The result genres. </returns>
|
/// <returns> The result genres. </returns>
|
||||||
private ReportStatResult GetResultGenres(ReportStatResult result, BaseItem[] items, int topItem = 5)
|
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)
|
items.SelectMany(x => x.Genres)
|
||||||
.GroupBy(x => x)
|
.GroupBy(x => x)
|
||||||
.OrderByDescending(x => x.Count())
|
.OrderByDescending(x => x.Count())
|
||||||
|
@ -178,7 +178,7 @@ namespace MediaBrowser.Api.Reports
|
||||||
/// <returns> The result parental ratings. </returns>
|
/// <returns> The result parental ratings. </returns>
|
||||||
private ReportStatResult GetResultParentalRatings(ReportStatResult result, BaseItem[] items, int topItem = 5)
|
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)
|
items.Where(x => x.OfficialRating != null)
|
||||||
.GroupBy(x => x.OfficialRating)
|
.GroupBy(x => x.OfficialRating)
|
||||||
.OrderByDescending(x => x.Count())
|
.OrderByDescending(x => x.Count())
|
||||||
|
@ -200,16 +200,26 @@ namespace MediaBrowser.Api.Reports
|
||||||
/// <returns> The result persons. </returns>
|
/// <returns> The result persons. </returns>
|
||||||
private ReportStatResult GetResultPersons(ReportStatResult result, BaseItem[] items, int topItem = 5)
|
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)
|
foreach (var item in t)
|
||||||
{
|
{
|
||||||
var ps = items.Where(x => x.People != null && x.SupportsPeople).SelectMany(x => x.People)
|
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)
|
.GroupBy(x => x.Name)
|
||||||
.OrderByDescending(x => x.Count())
|
.OrderByDescending(x => x.Count())
|
||||||
.Take(topItem);
|
.Take(topItem);
|
||||||
if (ps != null && ps.Count() > 0)
|
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
|
ps.Select(x => new ReportStatItem
|
||||||
{
|
{
|
||||||
Name = x.Key,
|
Name = x.Key,
|
||||||
|
@ -229,7 +239,7 @@ namespace MediaBrowser.Api.Reports
|
||||||
/// <returns> The result production years. </returns>
|
/// <returns> The result production years. </returns>
|
||||||
private ReportStatResult GetResultProductionYears(ReportStatResult result, BaseItem[] items, int topItem = 5)
|
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)
|
items.Where(x => x.ProductionYear != null && x.ProductionYear > 0)
|
||||||
.GroupBy(x => x.ProductionYear)
|
.GroupBy(x => x.ProductionYear)
|
||||||
.OrderByDescending(x => x.Count())
|
.OrderByDescending(x => x.Count())
|
||||||
|
@ -251,7 +261,7 @@ namespace MediaBrowser.Api.Reports
|
||||||
/// <returns> The result studios. </returns>
|
/// <returns> The result studios. </returns>
|
||||||
private ReportStatResult GetResultStudios(ReportStatResult result, BaseItem[] items, int topItem = 5)
|
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)
|
items.SelectMany(x => x.Studios)
|
||||||
.GroupBy(x => x)
|
.GroupBy(x => x)
|
||||||
.OrderByDescending(x => x.Count())
|
.OrderByDescending(x => x.Count())
|
||||||
|
|
|
@ -125,5 +125,55 @@
|
||||||
"HeaderImagePrimary": "Primary",
|
"HeaderImagePrimary": "Primary",
|
||||||
"HeaderImageBackdrop": "Backdrop",
|
"HeaderImageBackdrop": "Backdrop",
|
||||||
"HeaderImageLogo": "Logo",
|
"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",
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue