Lizerium.Localization.Ai.Analyzer 1.0.5

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

Lizerium.Localization.Ai.Analyzer

Roslyn analyzer and AI CodeFix provider for Lizerium.Localization.Toolkit.

The analyzer detects localizable C# text and offers a CodeFix that asks the AI localization service for translations, writes keys to Strings.en.resx and Strings.ru.resx, and replaces source text with generated localization API calls.

Install

<PackageReference Include="Lizerium.Localization.Analyzer" Version="1.0.0"
                  OutputItemType="Analyzer"
                  ReferenceOutputAssembly="false"
                  PrivateAssets="all" />

Project Setup

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

Diagnostics

ID Meaning
AI001 Localizable C# string or interpolated string was detected

CodeFix

Use Ctrl + . -> Create localization key (AI).

For a plain string:

var text = "Hello World";

the CodeFix creates a key such as MainWindow_Render_Text1, writes AI-generated en and ru values, and replaces the literal with:

var text = L.MainWindow.Render.Text1();

For an interpolated string:

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

the CodeFix stores the resource value as Log directory: {0} | {1} and replaces the source with:

var details = L.MainWindow.Render.Text2(AppContext.BaseDirectory, 5);

If the local AI service is unavailable or returns incomplete data, the CodeFix falls back to the original source text so the project remains compilable.

AI Server Configuration

The analyzer is distributed through the NuGet/toolkit package, so it cannot use a normal application settings file. Configure its AI servers with environment variables before starting Visual Studio:

LIZERIUM_OLLAMA_URL=http://localhost:11434
LIZERIUM_OLLAMA_MODEL=qwen2.5:7b
LIZERIUM_OLLAMA_GENERATE_ENDPOINT=/api/generate
LIZERIUM_LIBRETRANSLATE_URL=http://localhost:5000
LIZERIUM_AI_TIMEOUT_SECONDS=30

If variables are not set, these same values are used as defaults. Lizerium.AI.LocalizationAssistant.Core also exposes AiLocalizationOptions for direct NuGet usage from custom tools or applications.

XAML

Plain Roslyn analyzers do not provide native quick actions inside the Visual Studio XAML editor. XAML conversion is exposed through Lizerium.Localization.Core.XamlLocalizationService and the WPF {loc:Loc Key} markup extension. A VSIX or editor command can reuse that service to convert selected XAML text and write RESX keys.

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 96 5/7/2026
1.0.4 89 5/6/2026
1.0.3 92 5/5/2026
1.0.2 86 5/5/2026