From c699c546e4124da8c1978b86d1a424d24d3d77d6 Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Fri, 16 Aug 2019 17:31:47 +0200 Subject: Improve LocalizationManager --- MediaBrowser.Model/Globalization/CultureDto.cs | 1 + .../Globalization/ILocalizationManager.cs | 35 ++++++++++++++-------- 2 files changed, 24 insertions(+), 12 deletions(-) (limited to 'MediaBrowser.Model/Globalization') diff --git a/MediaBrowser.Model/Globalization/CultureDto.cs b/MediaBrowser.Model/Globalization/CultureDto.cs index f229f2055..a213d4147 100644 --- a/MediaBrowser.Model/Globalization/CultureDto.cs +++ b/MediaBrowser.Model/Globalization/CultureDto.cs @@ -38,6 +38,7 @@ namespace MediaBrowser.Model.Globalization { return vals[0]; } + return null; } } diff --git a/MediaBrowser.Model/Globalization/ILocalizationManager.cs b/MediaBrowser.Model/Globalization/ILocalizationManager.cs index a9ce60a2a..91d946db8 100644 --- a/MediaBrowser.Model/Globalization/ILocalizationManager.cs +++ b/MediaBrowser.Model/Globalization/ILocalizationManager.cs @@ -1,6 +1,5 @@ using System.Collections.Generic; using System.Globalization; -using System.Threading.Tasks; using MediaBrowser.Model.Entities; namespace MediaBrowser.Model.Globalization @@ -13,23 +12,26 @@ namespace MediaBrowser.Model.Globalization /// /// Gets the cultures. /// - /// IEnumerable{CultureDto}. - CultureDto[] GetCultures(); + /// . + IEnumerable GetCultures(); + /// /// Gets the countries. /// - /// IEnumerable{CountryInfo}. - Task GetCountries(); + /// . + IEnumerable GetCountries(); + /// /// Gets the parental ratings. /// - /// IEnumerable{ParentalRating}. + /// . IEnumerable GetParentalRatings(); + /// /// Gets the rating level. /// /// The rating. - /// System.Int32. + /// or null. int? GetRatingLevel(string rating); /// @@ -37,7 +39,7 @@ namespace MediaBrowser.Model.Globalization /// /// The phrase. /// The culture. - /// System.String. + /// . string GetLocalizedString(string phrase, string culture); /// @@ -50,13 +52,22 @@ namespace MediaBrowser.Model.Globalization /// /// Gets the localization options. /// - /// IEnumerable{LocalizatonOption}. - LocalizationOption[] GetLocalizationOptions(); - - string NormalizeFormKD(string text); + /// . + IEnumerable GetLocalizationOptions(); + /// + /// Checks if the string contains a character with the specified unicode category. + /// + /// The string. + /// The unicode category. + /// Wether or not the string contains a character with the specified unicode category. bool HasUnicodeCategory(string value, UnicodeCategory category); + /// + /// Returns the correct for the given language. + /// + /// The language. + /// The correct for the given language. CultureDto FindLanguageInfo(string language); } } -- cgit v1.2.3