18 lines
501 B
C#
18 lines
501 B
C#
namespace StellaOps.Localization;
|
|
|
|
/// <summary>
|
|
/// Ambient locale for the current async call chain.
|
|
/// Set by the localization middleware, read by <see cref="T._t"/>.
|
|
/// </summary>
|
|
public static class LocaleContext
|
|
{
|
|
private static readonly AsyncLocal<string?> _current = new();
|
|
|
|
/// <summary>Current request locale (e.g., "de-DE"). Null falls back to default.</summary>
|
|
public static string? Current
|
|
{
|
|
get => _current.Value;
|
|
set => _current.Value = value;
|
|
}
|
|
}
|