repo creation with initial code after cloning public repo

This commit is contained in:
2026-02-19 07:36:25 -05:00
commit 460884fea3
2860 changed files with 650825 additions and 0 deletions
@@ -0,0 +1,33 @@
#nullable disable
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; }
}
}
@@ -0,0 +1,58 @@
#pragma warning disable CS1591
using System.Collections.Generic;
namespace MediaBrowser.Model.Globalization
{
/// <summary>
/// Class CultureDto.
/// </summary>
public class CultureDto
{
public CultureDto(string name, string displayName, string twoLetterISOLanguageName, IReadOnlyList<string> threeLetterISOLanguageNames)
{
Name = name;
DisplayName = displayName;
TwoLetterISOLanguageName = twoLetterISOLanguageName;
ThreeLetterISOLanguageNames = threeLetterISOLanguageNames;
}
/// <summary>
/// Gets the name.
/// </summary>
/// <value>The name.</value>
public string Name { get; }
/// <summary>
/// Gets the display name.
/// </summary>
/// <value>The display name.</value>
public string DisplayName { get; }
/// <summary>
/// Gets the name of the two letter ISO language.
/// </summary>
/// <value>The name of the two letter ISO language.</value>
public string TwoLetterISOLanguageName { get; }
/// <summary>
/// Gets 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.Count > 0)
{
return vals[0];
}
return null;
}
}
public IReadOnlyList<string> ThreeLetterISOLanguageNames { get; }
}
}
@@ -0,0 +1,73 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using MediaBrowser.Model.Entities;
namespace MediaBrowser.Model.Globalization;
/// <summary>
/// Interface ILocalizationManager.
/// </summary>
public interface ILocalizationManager
{
/// <summary>
/// Gets the cultures.
/// </summary>
/// <returns><see cref="IEnumerable{CultureDto}" />.</returns>
IEnumerable<CultureDto> GetCultures();
/// <summary>
/// Gets the countries.
/// </summary>
/// <returns><see cref="IReadOnlyList{CountryInfo}" />.</returns>
IReadOnlyList<CountryInfo> GetCountries();
/// <summary>
/// Gets the parental ratings.
/// </summary>
/// <returns><see cref="IReadOnlyList{ParentalRating}" />.</returns>
IReadOnlyList<ParentalRating> GetParentalRatings();
/// <summary>
/// Gets the rating level.
/// </summary>
/// <param name="rating">The rating.</param>
/// <param name="countryCode">The optional two letter ISO language string.</param>
/// <returns><see cref="ParentalRatingScore" /> or <c>null</c>.</returns>
ParentalRatingScore? GetRatingScore(string rating, string? countryCode = null);
/// <summary>
/// Gets the localized string.
/// </summary>
/// <param name="phrase">The phrase.</param>
/// <param name="culture">The culture.</param>
/// <returns><see cref="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><see cref="IEnumerable{LocalizationOption}" />.</returns>
IEnumerable<LocalizationOption> GetLocalizationOptions();
/// <summary>
/// Returns the correct <see cref="CultureDto" /> for the given language.
/// </summary>
/// <param name="language">The language.</param>
/// <returns>The correct <see cref="CultureDto" /> for the given language.</returns>
CultureDto? FindLanguageInfo(string language);
/// <summary>
/// Returns the language in ISO 639-2/T when the input is ISO 639-2/B.
/// </summary>
/// <param name="isoB">The language in ISO 639-2/B.</param>
/// <param name="isoT">The language in ISO 639-2/T.</param>
/// <returns>Whether the language could be converted.</returns>
public bool TryGetISO6392TFromB(string isoB, [NotNullWhen(true)] out string? isoT);
}
@@ -0,0 +1,18 @@
#nullable disable
#pragma warning disable CS1591
namespace MediaBrowser.Model.Globalization
{
public class LocalizationOption
{
public LocalizationOption(string name, string value)
{
Name = name;
Value = value;
}
public string Name { get; set; }
public string Value { get; set; }
}
}