Zonit.Extensions.Cultures
0.1.1
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Zonit.Extensions.Cultures --version 0.1.1
NuGet\Install-Package Zonit.Extensions.Cultures -Version 0.1.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Zonit.Extensions.Cultures" Version="0.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Zonit.Extensions.Cultures" Version="0.1.1" />
<PackageReference Include="Zonit.Extensions.Cultures" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Zonit.Extensions.Cultures --version 0.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Zonit.Extensions.Cultures, 0.1.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Zonit.Extensions.Cultures@0.1.1
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Zonit.Extensions.Cultures&version=0.1.1
#tool nuget:?package=Zonit.Extensions.Cultures&version=0.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Supporting language culture
Advanced language support for Blazor.
Nuget Package Abstraction
Install-Package Zonit.Extensions.Cultures.Abstractions
Nuget Package Extensions
Install-Package Zonit.Extensions.Cultures
Install
Add this in Routes.razor
@using Zonit.Extensions
<ZonitCulturesExtension />
Services in Program.cs
builder.Services.AddCulturesExtension();
App in Program.cs
app.UseCulturesExtension();
Example usage:
@page "/culture"
@using Zonit.Extensions.Cultures
@implements IDisposable
@inject ICultureProvider Culture
@Culture.Translate("Hello {0}", "user")
@code{
protected override void OnInitialized()
{
Culture.OnChange += StateHasChanged;
}
public void Dispose()
{
Culture.OnChange -= StateHasChanged;
}
}
API:
public interface ICultureProvider
{
/// <summary>
/// Returns the current culture in use in the BCP 47 standard
/// </summary>
public string GetCulture { get; }
/// <summary>
/// Returns the translation in the current language used
/// </summary>
/// <param name="content">Search string, example: �Hello {0}�</param>
/// <param name="args">Additional arguments, example: �User�</param>
/// <returns></returns>
public string Translate(string content, params object?[] args);
/// <summary>
/// Default time zone for the user
/// </summary>
/// <param name="utcDateTime"></param>
/// <returns></returns>
public DateTime ClientTimeZone(DateTime utcDateTime);
/// <summary>
/// Event that is triggered when the language is changed
/// </summary>
public event Action? OnChange;
/// <summary>
/// Date and time format
/// </summary>
public DateTimeFormatModel DateTimeFormat { get; }
}
public interface ICultureManager
{
/// <summary>
/// Get the current culture in use in the BCP 47 standard
/// </summary>
public string GetCulture { get; }
/// <summary>
/// Get the current time zone in use in the IANA standard
/// </summary>
public string GetTimeZone { get; }
/// <summary>
/// Get list of supported cultures
/// </summary>
public LanguageModel[] SupportedCultures { get; }
/// <summary>
/// Changing the default language
/// </summary>
/// <param name="culture">Language parameter in BCP 47 standard</param>
public void SetCulture(string culture);
/// <summary>
/// Changing the default time zone
/// </summary>
/// <param name="timeZone"></param>
public void SetTimeZone(string timeZone);
/// <summary>
/// Event that is triggered when the language is changed
/// </summary>
public event Action? OnChange;
}
public interface ITranslationManager
{
/// <summary>
/// Add one translation
/// </summary>
/// <param name="item"></param>
public void Add(Variable item);
/// <summary>
/// Add multiple translations
/// </summary>
/// <param name="items"></param>
public void AddRange(List<Variable> items);
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Hosting (>= 8.0.0)
- Zonit.Extensions.Cultures.Abstractions (>= 0.1.1)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Zonit.Extensions.Cultures:
Package | Downloads |
---|---|
Zonit.Services.Dashboard
Package Description |
|
Zonit.Services.Manager
Package Description |
|
Zonit.Services.Dashboard.Components
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
0.1.7 | 148 | 8/9/2025 |
0.1.6 | 155 | 7/31/2025 |
0.1.5 | 251 | 7/26/2025 |
0.1.4 | 298 | 7/26/2025 |
0.1.3 | 188 | 5/28/2025 |
0.1.2 | 368 | 1/29/2025 |
0.1.1 | 183 | 5/28/2024 |
0.1.0 | 130 | 5/27/2024 |
0.0.31 | 147 | 5/21/2024 |
0.0.30 | 127 | 5/20/2024 |
0.0.23 | 148 | 5/18/2024 |
0.0.21 | 153 | 5/16/2024 |
0.0.18 | 153 | 5/15/2024 |
0.0.17 | 148 | 5/15/2024 |
0.0.16 | 139 | 5/14/2024 |
0.0.15 | 139 | 5/14/2024 |