Class LocalStorageCultureStore
Stores the culture in the local storage of the browser. Used by standalone Blazor WebAssembly and Blazor Hybrid applications.
public sealed class LocalStorageCultureStore : ITlumachCultureStore
- Inheritance
-
LocalStorageCultureStore
- Implements
- Inherited Members
Constructors
LocalStorageCultureStore(IJSRuntime, TlumachBlazorOptions)
Initializes a new instance of the LocalStorageCultureStore class.
public LocalStorageCultureStore(IJSRuntime jsRuntime, TlumachBlazorOptions options)
Parameters
jsRuntimeIJSRuntimeThe JavaScript runtime.
optionsTlumachBlazorOptionsThe options, which supply the storage key.
Methods
LoadAsync(CancellationToken)
Loads the name of the stored culture.
public ValueTask<string?> LoadAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to cancel the operation.
Returns
SaveAsync(CultureInfo, CancellationToken)
Stores the culture.
public ValueTask SaveAsync(CultureInfo culture, CancellationToken cancellationToken = default)
Parameters
cultureCultureInfoThe culture to store.
cancellationTokenCancellationTokenA token to cancel the operation.
Returns
- ValueTask
A task that completes when the culture is stored.