KebabGGbab.Localization
1.0.0
dotnet add package KebabGGbab.Localization --version 1.0.0
NuGet\Install-Package KebabGGbab.Localization -Version 1.0.0
<PackageReference Include="KebabGGbab.Localization" Version="1.0.0" />
<PackageVersion Include="KebabGGbab.Localization" Version="1.0.0" />
<PackageReference Include="KebabGGbab.Localization" />
paket add KebabGGbab.Localization --version 1.0.0
#r "nuget: KebabGGbab.Localization, 1.0.0"
#:package KebabGGbab.Localization@1.0.0
#addin nuget:?package=KebabGGbab.Localization&version=1.0.0
#tool nuget:?package=KebabGGbab.Localization&version=1.0.0
Localization
The library is designed to simplify the process of localizing applications, primarily desktop ones. Currently, the library supports changing the current UI language culture without restarting the application, a localization service (the current thread by default), support for multiple localization providers, and markup extensions for the WPF and AvaloniaUI frameworks.
Get Started
Localization can be installed using the NuGet package manager or the .NET CLI.
Install-Package KebabGGbab.Localization
Install-Package KebabGGbab.Localization.WPF
Install-Package KebabGGbab.Localization.AvaloniaUI
Example
Samples
There are short samples to run localization on supported frameworks.
Configure
If you use dependency injection, you can write your own extension to IServiceCollection by calling IServiceCollection.AddLocalization(), optionally passing the initial culture and localization service, and add a localization provider, such as the Resx file provider implemented in the library and added by calling IServiceCollection.AddResxLocalization(), passing the ResourceManager generated by the ResXFileCodeGenerator tool, as well as all supported cultures. For example:
public static class LocalizationExtensions
{
public static IServiceCollection AddLocalizationWithResx(this ServiceCollection services)
{
ArgumentNullException.ThrowIfNull(services);
services.AddLocalization(); // or services.AddLocalizationWPF() if you are developing a WPF application.
services.AddResxLocalization(StringsUI.ResourceManager, [CultureInfo.GetCultureInfo("ru-RU"), CultureInfo.GetCultureInfo("en-US")]);
return services;
}
}
xaml
Once the library is configured, you can use it in XAML. To do this, add the namespace:
- in WPF:
xmlns:l="clr-namespace:KebabGGbab.Localization.WPF;assembly=KebabGGbab.Localization.WPF"
- in AvaloniaUI:
xmlns:l="https://github.com/KebabGGbab"
and use it like this:
Title="{l:Localization MainWindowTitle}"
where MainWindowTitle is the resource key.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
NuGet packages (2)
Showing the top 2 NuGet packages that depend on KebabGGbab.Localization:
| Package | Downloads |
|---|---|
|
KebabGGbab.Localization.AvaloniaUI
Localization WPF and AvaloniaUI application |
|
|
KebabGGbab.Localization.WPF
Localization WPF and AvaloniaUI application |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 132 | 5/28/2026 |
Initialization of the Core project, as well as projects for the WPF and AvaloniaUI frameworks. Support for the following features: changing the current UI culture, culture service, UI culture change notifications, adding multiple localization providers, and localization via XAML markup extensions.