CodeWF.Avalonia.Lang.Generator 12.2.52

dotnet add package CodeWF.Avalonia.Lang.Generator --version 12.2.52
                    
NuGet\Install-Package CodeWF.Avalonia.Lang.Generator -Version 12.2.52
                    
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="CodeWF.Avalonia.Lang.Generator" Version="12.2.52">
  <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="CodeWF.Avalonia.Lang.Generator" Version="12.2.52" />
                    
Directory.Packages.props
<PackageReference Include="CodeWF.Avalonia.Lang.Generator">
  <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 CodeWF.Avalonia.Lang.Generator --version 12.2.52
                    
#r "nuget: CodeWF.Avalonia.Lang.Generator, 12.2.52"
                    
#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 CodeWF.Avalonia.Lang.Generator@12.2.52
                    
#: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=CodeWF.Avalonia.Lang.Generator&version=12.2.52
                    
Install as a Cake Addin
#tool nuget:?package=CodeWF.Avalonia.Lang.Generator&version=12.2.52
                    
Install as a Cake Tool

CodeWF.Avalonia.Lang.Generator

Avalonia 多语言方案的编译期源生成器:从语言资源(JSON / XML / RESX)生成强类型资源 Key 常量。Compile-time source generator producing strongly-typed language keys.

NuGet License

安装

生成器是编译期工具(DevelopmentDependency、netstandard2.0),引用时收进 PrivateAssets:

<PackageReference Include="CodeWF.Avalonia.Lang.Generator" Version="12.1.6.5" PrivateAssets="all" />

nuget.org 上并存现行 12.1.6.x 与已废弃的历史 12.2.x 两条版本线(后者版本号更大),浮动解析会命中旧线;请逐包精确钉版到 12.1.6.*。

生成器在编译器内运行,消费工程发布 NativeAOT/裁剪不受影响。运行时配合 CodeWF.Avalonia.Lang 与 CodeWF.Toolkit.Lang 的 I18nManager 使用。

用法

把语言资源文件加入 AdditionalFiles,生成器按扩展名自动识别 JSON / XML / RESX:

<ItemGroup>
  <AdditionalFiles Include="I18n\zh-CN.json" />
  <AdditionalFiles Include="I18n\en-US.json" />
</ItemGroup>

资源键需至少三段点分结构(如 Log.View.Copy),生成器按键的层级输出强类型常量类,键名拼写错误在编译期即被发现;多语言文件按键取并集,翻译仍只在资源文件中维护。

T4(Language.tt)是等价的编译后方案:生成代码提交入库、普通构建无需执行模板。两种方式二选一,不要同时手写维护一套映射。

文档

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • .NETStandard 2.0

    • No dependencies.

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
12.2.52 97 11/21/2026
12.2.0.1 55 11/25/2026
12.1.6.9 106 11/21/2026
12.1.6.8 90 11/20/2026
12.1.6.5 95 11/16/2026
12.1.6.4 129 11/12/2026
12.1.6.3 112 11/11/2026
12.1.6.2 107 11/10/2026
12.1.6.1 95 11/10/2026
12.1.5.11 97 11/10/2026
12.1.5.10 100 11/10/2026
12.1.5.9 104 11/10/2026
12.1.5.8 102 11/9/2026
12.1.5.7 92 11/9/2026
12.1.5.6 130 11/9/2026
12.1.5.4 98 11/8/2026
12.1.5.3 97 11/8/2026
12.1.5.2 150 11/8/2026
12.1.5.1 89 11/8/2026
Loading failed