22 lines
852 B
C#
22 lines
852 B
C#
namespace StellaOps.Localization;
|
|
|
|
/// <summary>
|
|
/// Provides translation bundles from a specific source (embedded JSON, remote API, etc.).
|
|
/// Providers are loaded in priority order: lower priority values are loaded first and
|
|
/// overwritten by higher-priority providers.
|
|
/// </summary>
|
|
public interface ITranslationBundleProvider
|
|
{
|
|
/// <summary>
|
|
/// Priority: lower = loaded first (overwritten by higher).
|
|
/// Common embedded = 0, service embedded = 10, remote/DB = 100.
|
|
/// </summary>
|
|
int Priority { get; }
|
|
|
|
/// <summary>Load all translation key-value pairs for a locale.</summary>
|
|
Task<IReadOnlyDictionary<string, string>> LoadAsync(string locale, CancellationToken ct);
|
|
|
|
/// <summary>Which locales this provider can serve.</summary>
|
|
Task<IReadOnlyList<string>> GetAvailableLocalesAsync(CancellationToken ct);
|
|
}
|