Lizerium.Localization.Toolkit 1.0.5

dotnet add package Lizerium.Localization.Toolkit --version 1.0.5
                    
NuGet\Install-Package Lizerium.Localization.Toolkit -Version 1.0.5
                    
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="Lizerium.Localization.Toolkit" Version="1.0.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Lizerium.Localization.Toolkit" Version="1.0.5" />
                    
Directory.Packages.props
<PackageReference Include="Lizerium.Localization.Toolkit" />
                    
Project file
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 Lizerium.Localization.Toolkit --version 1.0.5
                    
#r "nuget: Lizerium.Localization.Toolkit, 1.0.5"
                    
#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 Lizerium.Localization.Toolkit@1.0.5
                    
#: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=Lizerium.Localization.Toolkit&version=1.0.5
                    
Install as a Cake Addin
#tool nuget:?package=Lizerium.Localization.Toolkit&version=1.0.5
                    
Install as a Cake Tool

Lizerium.Localization.Toolkit

All-in-one localization package for .NET projects that use .resx translation files.

It includes:

  • Lizerium.Localization.Core as the runtime dependency;
  • an incremental source generator that creates Generated.Localization.Localization;
  • analyzer diagnostics for missing localization keys;
  • a Visual Studio CodeFix that creates missing .resx entries from code;
  • AI CodeFix support for normal and interpolated C# strings;
  • WPF XAML runtime localization through {loc:Loc Key};
  • optional Visual Studio inline hints for generated C# localization calls.

Install

<PackageReference Include="Lizerium.Localization.Toolkit" Version="1.0.0" />

Project Setup

<ItemGroup>
  <AdditionalFiles Include="Resources\Localization\*.resx" />
  <Content Include="Resources\Localization\*.resx">
    <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
  </Content>
</ItemGroup>

Expected files:

Resources/
  Localization/
    Strings.en.resx
    Strings.ru.resx

Usage

using Lizerium.Localization.Core;
using L = Generated.Localization.Localization;

LocalizationService.Instance.Configure(
    Path.Combine(AppContext.BaseDirectory, "Resources", "Localization"));
LocalizationService.Instance.ChangeLanguage("en");

var title = L.MainWindow.Title();

For WPF XAML values, add the namespace:

xmlns:loc="clr-namespace:Lizerium.Localization.Core;assembly=Lizerium.Localization.Core"

and use RESX keys directly:

<Button Content="{loc:Loc MainWindow_Button_English}" />
<TextBlock Text="{loc:Loc MainWindow_Title}" />

For parameterized values, use _Format keys with placeholders:

<data name="MainWindow_Message_Format" xml:space="preserve">
  <value>Current folder: {0}</value>
</data>

CodeFix

Write the generated call first, then use Ctrl + . -> Create localization key. Calls with arguments create _Format keys and TODO {0} {1} placeholder values.

The AI CodeFix also appears on string literals and interpolated strings:

var text = "Hello World";
var details = $"Log directory: {AppContext.BaseDirectory} | {5}";

For interpolated strings, the resource value is stored as Log directory: {0} | {1} and the generated call receives the original interpolation expressions as arguments.

The NuGet analyzer reads AI server settings from environment variables:

LIZERIUM_OLLAMA_URL
LIZERIUM_OLLAMA_MODEL
LIZERIUM_OLLAMA_GENERATE_ENDPOINT
LIZERIUM_LIBRETRANSLATE_URL

Direct consumers of Lizerium.AI.LocalizationAssistant.Core can use AiLocalizationOptions instead of hardcoded URLs.

XAML Conversion

Lizerium.Localization.Core.XamlLocalizationService provides the shared conversion logic used by tooling:

var xaml = new XamlLocalizationService();
xaml.LocalizeText(
    "MainWindow.xaml",
    "English",
    "MainWindow_Button_English",
    "Resources/Localization");

It replaces XAML literals like Content="English" with Content="{loc:Loc MainWindow_Button_English}", adds xmlns:loc when missing, and writes keys to Strings.en.resx and Strings.ru.resx.

For an editor light bulb in Visual Studio 2022, build and install Lizerium.Localization.Xaml.Vsix. It offers Создать ключ локализации для XAML for selected XAML text or literal attribute values.

C# Editor Hints

For inline hints in C# files, build and install Lizerium.Localization.EditorHints.

src\Lizerium.Localization.EditorHints\bin\Release\net472\Lizerium.Localization.EditorHints.1.0.4.vsix

It shows .resx values next to generated calls such as L.MainWindow.Title() and writes diagnostics to %TEMP%/Lizerium.Localization.EditorHints.log.

Project repository: https://github.com/Lizerium/Lizerium.Localization.Toolkit

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.5 97 5/7/2026
1.0.4 91 5/6/2026
1.0.3 91 5/5/2026
1.0.2 88 5/5/2026
1.0.0 102 4/28/2026