ILocalizationManager.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using System.Collections.Generic;
  2. using MediaBrowser.Model.Entities;
  3. namespace MediaBrowser.Model.Globalization;
  4. /// <summary>
  5. /// Interface ILocalizationManager.
  6. /// </summary>
  7. public interface ILocalizationManager
  8. {
  9. /// <summary>
  10. /// Gets the cultures.
  11. /// </summary>
  12. /// <returns><see cref="IEnumerable{CultureDto}" />.</returns>
  13. IEnumerable<CultureDto> GetCultures();
  14. /// <summary>
  15. /// Gets the countries.
  16. /// </summary>
  17. /// <returns><see cref="IReadOnlyList{CountryInfo}" />.</returns>
  18. IReadOnlyList<CountryInfo> GetCountries();
  19. /// <summary>
  20. /// Gets the parental ratings.
  21. /// </summary>
  22. /// <returns><see cref="IReadOnlyList{ParentalRating}" />.</returns>
  23. IReadOnlyList<ParentalRating> GetParentalRatings();
  24. /// <summary>
  25. /// Gets the rating level.
  26. /// </summary>
  27. /// <param name="rating">The rating.</param>
  28. /// <param name="countryCode">The optional two letter ISO language string.</param>
  29. /// <returns><see cref="ParentalRatingScore" /> or <c>null</c>.</returns>
  30. ParentalRatingScore? GetRatingScore(string rating, string? countryCode = null);
  31. /// <summary>
  32. /// Gets the localized string.
  33. /// </summary>
  34. /// <param name="phrase">The phrase.</param>
  35. /// <param name="culture">The culture.</param>
  36. /// <returns><see cref="string" />.</returns>
  37. string GetLocalizedString(string phrase, string culture);
  38. /// <summary>
  39. /// Gets the localized string.
  40. /// </summary>
  41. /// <param name="phrase">The phrase.</param>
  42. /// <returns>System.String.</returns>
  43. string GetLocalizedString(string phrase);
  44. /// <summary>
  45. /// Gets the localization options.
  46. /// </summary>
  47. /// <returns><see cref="IEnumerable{LocalizationOption}" />.</returns>
  48. IEnumerable<LocalizationOption> GetLocalizationOptions();
  49. /// <summary>
  50. /// Returns the correct <see cref="CultureDto" /> for the given language.
  51. /// </summary>
  52. /// <param name="language">The language.</param>
  53. /// <returns>The correct <see cref="CultureDto" /> for the given language.</returns>
  54. CultureDto? FindLanguageInfo(string language);
  55. }