ILocalizationManager.cs 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. using System.Collections.Generic;
  2. using MediaBrowser.Model.Entities;
  3. namespace MediaBrowser.Model.Globalization
  4. {
  5. /// <summary>
  6. /// Interface ILocalizationManager.
  7. /// </summary>
  8. public interface ILocalizationManager
  9. {
  10. /// <summary>
  11. /// Gets the cultures.
  12. /// </summary>
  13. /// <returns><see cref="IEnumerable{CultureDto}" />.</returns>
  14. IEnumerable<CultureDto> GetCultures();
  15. /// <summary>
  16. /// Gets the countries.
  17. /// </summary>
  18. /// <returns><see cref="IEnumerable{CountryInfo}" />.</returns>
  19. IEnumerable<CountryInfo> GetCountries();
  20. /// <summary>
  21. /// Gets the parental ratings.
  22. /// </summary>
  23. /// <returns><see cref="IEnumerable{ParentalRating}" />.</returns>
  24. IEnumerable<ParentalRating> GetParentalRatings();
  25. /// <summary>
  26. /// Gets the rating level.
  27. /// </summary>
  28. /// <param name="rating">The rating.</param>
  29. /// <param name="countryCode">The optional two letter ISO language string.</param>
  30. /// <returns><see cref="int" /> or <c>null</c>.</returns>
  31. int? GetRatingLevel(string rating, string? countryCode = null);
  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. /// Returns the correct <see cref="CultureDto" /> for the given language.
  52. /// </summary>
  53. /// <param name="language">The language.</param>
  54. /// <returns>The correct <see cref="CultureDto" /> for the given language.</returns>
  55. CultureDto? FindLanguageInfo(string language);
  56. }
  57. }