Lizerium.Localization.Toolkit
1.0.0
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 Lizerium.Localization.Toolkit --version 1.0.0
NuGet\Install-Package Lizerium.Localization.Toolkit -Version 1.0.0
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.0" />
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.0" />
<PackageReference Include="Lizerium.Localization.Toolkit" />
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.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Lizerium.Localization.Toolkit, 1.0.0"
#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.0
#: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.0
#tool nuget:?package=Lizerium.Localization.Toolkit&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Lizerium.Localization.Toolkit
All-in-one localization package for .NET projects that use .resx translation files.
It includes:
Lizerium.Localization.Coreas 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
.resxentries from code.
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 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.
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.
-
net8.0
- Lizerium.Localization.Core (>= 1.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.