aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model/Globalization
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Model/Globalization')
-rw-r--r--MediaBrowser.Model/Globalization/CountryInfo.cs33
-rw-r--r--MediaBrowser.Model/Globalization/CultureDto.cs52
-rw-r--r--MediaBrowser.Model/Globalization/ILocalizationManager.cs63
-rw-r--r--MediaBrowser.Model/Globalization/LocalizatonOption.cs8
4 files changed, 156 insertions, 0 deletions
diff --git a/MediaBrowser.Model/Globalization/CountryInfo.cs b/MediaBrowser.Model/Globalization/CountryInfo.cs
new file mode 100644
index 000000000..16aea8436
--- /dev/null
+++ b/MediaBrowser.Model/Globalization/CountryInfo.cs
@@ -0,0 +1,33 @@
+
+namespace MediaBrowser.Model.Globalization
+{
+ /// <summary>
+ /// Class CountryInfo
+ /// </summary>
+ public class CountryInfo
+ {
+ /// <summary>
+ /// Gets or sets the name.
+ /// </summary>
+ /// <value>The name.</value>
+ public string Name { get; set; }
+
+ /// <summary>
+ /// Gets or sets the display name.
+ /// </summary>
+ /// <value>The display name.</value>
+ public string DisplayName { get; set; }
+
+ /// <summary>
+ /// Gets or sets the name of the two letter ISO region.
+ /// </summary>
+ /// <value>The name of the two letter ISO region.</value>
+ public string TwoLetterISORegionName { get; set; }
+
+ /// <summary>
+ /// Gets or sets the name of the three letter ISO region.
+ /// </summary>
+ /// <value>The name of the three letter ISO region.</value>
+ public string ThreeLetterISORegionName { get; set; }
+ }
+}
diff --git a/MediaBrowser.Model/Globalization/CultureDto.cs b/MediaBrowser.Model/Globalization/CultureDto.cs
new file mode 100644
index 000000000..6d79aaebb
--- /dev/null
+++ b/MediaBrowser.Model/Globalization/CultureDto.cs
@@ -0,0 +1,52 @@
+using global::System;
+
+namespace MediaBrowser.Model.Globalization
+{
+ /// <summary>
+ /// Class CultureDto
+ /// </summary>
+ public class CultureDto
+ {
+ /// <summary>
+ /// Gets or sets the name.
+ /// </summary>
+ /// <value>The name.</value>
+ public string Name { get; set; }
+
+ /// <summary>
+ /// Gets or sets the display name.
+ /// </summary>
+ /// <value>The display name.</value>
+ public string DisplayName { get; set; }
+
+ /// <summary>
+ /// Gets or sets the name of the two letter ISO language.
+ /// </summary>
+ /// <value>The name of the two letter ISO language.</value>
+ public string TwoLetterISOLanguageName { get; set; }
+
+ /// <summary>
+ /// Gets or sets the name of the three letter ISO language.
+ /// </summary>
+ /// <value>The name of the three letter ISO language.</value>
+ 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 000000000..9c7a937f3
--- /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
+{
+ /// <summary>
+ /// Interface ILocalizationManager
+ /// </summary>
+ public interface ILocalizationManager
+ {
+ /// <summary>
+ /// Gets the cultures.
+ /// </summary>
+ /// <returns>IEnumerable{CultureDto}.</returns>
+ CultureDto[] GetCultures();
+ /// <summary>
+ /// Gets the countries.
+ /// </summary>
+ /// <returns>IEnumerable{CountryInfo}.</returns>
+ CountryInfo[] GetCountries();
+ /// <summary>
+ /// Gets the parental ratings.
+ /// </summary>
+ /// <returns>IEnumerable{ParentalRating}.</returns>
+ ParentalRating[] GetParentalRatings();
+ /// <summary>
+ /// Gets the rating level.
+ /// </summary>
+ /// <param name="rating">The rating.</param>
+ /// <returns>System.Int32.</returns>
+ int? GetRatingLevel(string rating);
+
+ /// <summary>
+ /// Gets the localized string.
+ /// </summary>
+ /// <param name="phrase">The phrase.</param>
+ /// <param name="culture">The culture.</param>
+ /// <returns>System.String.</returns>
+ string GetLocalizedString(string phrase, string culture);
+
+ /// <summary>
+ /// Gets the localized string.
+ /// </summary>
+ /// <param name="phrase">The phrase.</param>
+ /// <returns>System.String.</returns>
+ string GetLocalizedString(string phrase);
+
+ /// <summary>
+ /// Gets the localization options.
+ /// </summary>
+ /// <returns>IEnumerable{LocalizatonOption}.</returns>
+ 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 000000000..61749cbc3
--- /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