From a86b71899ec52c44ddc6c3018e8cc5e9d7ff4d62 Mon Sep 17 00:00:00 2001 From: Andrew Rabert Date: Thu, 27 Dec 2018 18:27:57 -0500 Subject: Add GPL modules --- MediaBrowser.Model/Globalization/CountryInfo.cs | 33 ++++++++++++ MediaBrowser.Model/Globalization/CultureDto.cs | 52 ++++++++++++++++++ .../Globalization/ILocalizationManager.cs | 63 ++++++++++++++++++++++ .../Globalization/LocalizatonOption.cs | 8 +++ 4 files changed, 156 insertions(+) create mode 100644 MediaBrowser.Model/Globalization/CountryInfo.cs create mode 100644 MediaBrowser.Model/Globalization/CultureDto.cs create mode 100644 MediaBrowser.Model/Globalization/ILocalizationManager.cs create mode 100644 MediaBrowser.Model/Globalization/LocalizatonOption.cs (limited to 'MediaBrowser.Model/Globalization') diff --git a/MediaBrowser.Model/Globalization/CountryInfo.cs b/MediaBrowser.Model/Globalization/CountryInfo.cs new file mode 100644 index 0000000000..16aea8436b --- /dev/null +++ b/MediaBrowser.Model/Globalization/CountryInfo.cs @@ -0,0 +1,33 @@ + +namespace MediaBrowser.Model.Globalization +{ + /// + /// Class CountryInfo + /// + public class CountryInfo + { + /// + /// Gets or sets the name. + /// + /// The name. + public string Name { get; set; } + + /// + /// Gets or sets the display name. + /// + /// The display name. + public string DisplayName { get; set; } + + /// + /// Gets or sets the name of the two letter ISO region. + /// + /// The name of the two letter ISO region. + public string TwoLetterISORegionName { get; set; } + + /// + /// Gets or sets the name of the three letter ISO region. + /// + /// The name of the three letter ISO region. + public string ThreeLetterISORegionName { get; set; } + } +} diff --git a/MediaBrowser.Model/Globalization/CultureDto.cs b/MediaBrowser.Model/Globalization/CultureDto.cs new file mode 100644 index 0000000000..6d79aaebb1 --- /dev/null +++ b/MediaBrowser.Model/Globalization/CultureDto.cs @@ -0,0 +1,52 @@ +using global::System; + +namespace MediaBrowser.Model.Globalization +{ + /// + /// Class CultureDto + /// + public class CultureDto + { + /// + /// Gets or sets the name. + /// + /// The name. + public string Name { get; set; } + + /// + /// Gets or sets the display name. + /// + /// The display name. + public string DisplayName { get; set; } + + /// + /// Gets or sets the name of the two letter ISO language. + /// + /// The name of the two letter ISO language. + public string TwoLetterISOLanguageName { get; set; } + + /// + /// Gets or sets the name of the three letter ISO language. + /// + /// The name of the three letter ISO language. + public string ThreeLetterISOLanguageName + { + get + { + var vals = ThreeLetterISOLanguageNames; + if (vals.Length > 0) + { + return vals[0]; + } + return null; + } + } + + public string[] ThreeLetterISOLanguageNames { get; set; } + + public CultureDto() + { + ThreeLetterISOLanguageNames = new string[] {}; + } + } +} diff --git a/MediaBrowser.Model/Globalization/ILocalizationManager.cs b/MediaBrowser.Model/Globalization/ILocalizationManager.cs new file mode 100644 index 0000000000..9c7a937f3b --- /dev/null +++ b/MediaBrowser.Model/Globalization/ILocalizationManager.cs @@ -0,0 +1,63 @@ +using System.Collections.Generic; +using MediaBrowser.Model.Entities; +using System.Globalization; + +namespace MediaBrowser.Model.Globalization +{ + /// + /// Interface ILocalizationManager + /// + public interface ILocalizationManager + { + /// + /// Gets the cultures. + /// + /// IEnumerable{CultureDto}. + CultureDto[] GetCultures(); + /// + /// Gets the countries. + /// + /// IEnumerable{CountryInfo}. + CountryInfo[] GetCountries(); + /// + /// Gets the parental ratings. + /// + /// IEnumerable{ParentalRating}. + ParentalRating[] GetParentalRatings(); + /// + /// Gets the rating level. + /// + /// The rating. + /// System.Int32. + int? GetRatingLevel(string rating); + + /// + /// Gets the localized string. + /// + /// The phrase. + /// The culture. + /// System.String. + string GetLocalizedString(string phrase, string culture); + + /// + /// Gets the localized string. + /// + /// The phrase. + /// System.String. + string GetLocalizedString(string phrase); + + /// + /// Gets the localization options. + /// + /// IEnumerable{LocalizatonOption}. + LocalizatonOption[] GetLocalizationOptions(); + + string RemoveDiacritics(string text); + + string NormalizeFormKD(string text); + + bool HasUnicodeCategory(string value, UnicodeCategory category); + + CultureDto FindLanguageInfo(string language); + } +} diff --git a/MediaBrowser.Model/Globalization/LocalizatonOption.cs b/MediaBrowser.Model/Globalization/LocalizatonOption.cs new file mode 100644 index 0000000000..61749cbc36 --- /dev/null +++ b/MediaBrowser.Model/Globalization/LocalizatonOption.cs @@ -0,0 +1,8 @@ +namespace MediaBrowser.Model.Globalization +{ + public class LocalizatonOption + { + public string Name { get; set; } + public string Value { get; set; } + } +} \ No newline at end of file -- cgit v1.2.3