ILocalizationManager.cs 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. using System.Collections.Generic;
  2. using System.Globalization;
  3. using MediaBrowser.Model.Entities;
  4. namespace MediaBrowser.Model.Globalization
  5. {
  6. /// <summary>
  7. /// Interface ILocalizationManager
  8. /// </summary>
  9. public interface ILocalizationManager
  10. {
  11. /// <summary>
  12. /// Gets the cultures.
  13. /// </summary>
  14. /// <returns><see cref="IEnumerable{CultureDto}" />.</returns>
  15. IEnumerable<CultureDto> GetCultures();
  16. /// <summary>
  17. /// Gets the countries.
  18. /// </summary>
  19. /// <returns><see cref="IEnumerable{CountryInfo}" />.</returns>
  20. IEnumerable<CountryInfo> GetCountries();
  21. /// <summary>
  22. /// Gets the parental ratings.
  23. /// </summary>
  24. /// <returns><see cref="IEnumerable{ParentalRating}" />.</returns>
  25. IEnumerable<ParentalRating> GetParentalRatings();
  26. /// <summary>
  27. /// Gets the rating level.
  28. /// </summary>
  29. /// <param name="rating">The rating.</param>
  30. /// <returns><see cref="int" /> or <c>null</c>.</returns>
  31. int? GetRatingLevel(string rating);
  32. /// <summary>
  33. /// Gets the localized string.
  34. /// </summary>
  35. /// <param name="phrase">The phrase.</param>
  36. /// <param name="culture">The culture.</param>
  37. /// <returns><see cref="string" />.</returns>
  38. string GetLocalizedString(string phrase, string culture);
  39. /// <summary>
  40. /// Gets the localized string.
  41. /// </summary>
  42. /// <param name="phrase">The phrase.</param>
  43. /// <returns>System.String.</returns>
  44. string GetLocalizedString(string phrase);
  45. /// <summary>
  46. /// Gets the localization options.
  47. /// </summary>
  48. /// <returns><see cref="IEnumerable{LocalizatonOption}" />.</returns>
  49. IEnumerable<LocalizationOption> GetLocalizationOptions();
  50. /// <summary>
  51. /// Checks if the string contains a character with the specified unicode category.
  52. /// </summary>
  53. /// <param name="value">The string.</param>
  54. /// <param name="category">The unicode category.</param>
  55. /// <returns>Wether or not the string contains a character with the specified unicode category.</returns>
  56. bool HasUnicodeCategory(string value, UnicodeCategory category);
  57. /// <summary>
  58. /// Returns the correct <see cref="Cultureinfo" /> for the given language.
  59. /// </summary>
  60. /// <param name="language">The language.</param>
  61. /// <returns>The correct <see cref="Cultureinfo" /> for the given language.</returns>
  62. CultureDto FindLanguageInfo(string language);
  63. }
  64. }