Arb.NET.Generators 0.3.4

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

Arb.NET

This project adds .arb localization support to .NET applications.

RESX files suck:

  1. Are IDE dependent - the generated code is inconsistent

    • uses XML which belongs to 1980s
    • each IDE generates the code differently
    • each IDE sorts the entries differently
    • ResXManager is trying to make it manageable but I still did not enjoy using it.
    • Is the standard, but we are about to change that 😄
  2. Do not even support pluralization or parameterized keys

ARB files:

  1. Are easy to work with
    • the .arb files are just JSON files, so they are easy to edit and manage by us
    • they are also easy to edit and manage by AI without unnecessary tokens spent on boilerplate

How to:

  1. Install the package of your choice. (Any of the IDE extensions, Arb.NET.Generator for automatic source generated approach or Arb.NET.Tool for manual generation)

  2. Create a l10n.yaml file in the root of your project with the following content:

arb-dir: arbs # [REQUIRED] relative path to the directory containing your .arb files
template-arb-file: en.arb # [REQUIRED] the template .arb file (primary locale) that contains all the keys
output-class: L # [OPTIONAL] the name of the generated C# class that will contain the localization members
output-namespace: MyProject.Locale # [OPTIONAL] the namespace of the generated C# class

Or use the IDE integration to create the l10n.yaml (using the standard create/add item flow) file with the above content prefilled and documented.

  1. Create your .arb files in the specified directory (e.g. arbs/en.arb, arbs/cs.arb, etc.) with the following content:
{
  "@@locale": "en", # [REQUIRED] the locale of this .arb file
  "KeyName": "Localized Value", # entries in this format
  "ParametricKey": "Value with {param} placeholder", # for parametric keys, use {<name>} syntax
  "PluralKey": "{count, plural, =0{One item} other{{count} items}}" # for pluralization, use ICU syntax
}
  1. If using Arb.NET.Generator, the code will be generated automatically at build time. If using Arb.NET.Tool, run the tool to generate the code manually. The IDE extensions also generate the code when a change is detected.

  2. Profit!

Projects:

Arb.NET - shared lib for the lang code generation and the runtime support.

Arb.NET.Tool - an app to be installed as a tool and ran as a executable in projects that use Arb.NET. It will generate the lang code from the .arb files.

Arb.NET.Generator - Roslyn source generator that will generate the lang code from the .arb files at design time.

Arb.NET.Analyzers - analyzer project that provide quick fixes for missing arb keys.

Arb.NET.Examples/* - example projects to show how to use the library in different types of applications

Arb.NET.Test - a test project to test the code generation and the runtime support. It will be used to test the generated code and the runtime support. It will also be used to test the integration with the MAUI app.

IDE support:

Arb.NET.IDE.Jetbrains - a plugin for Rider

Arb.NET.IDE.VisualStudio - an extension for Visual Studio

Arb.NET.IDE.Common - shared code for the IDE extensions

License:

I do not care licence. (MIT) You can credit me. You can support me. I am not liable for anything.

If you are feeling generous:

<a href="https://www.buymeacoffee.com/Michal.MK" target="_blank"> <img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" > </a>

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • .NETStandard 2.0

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
0.3.4 93 4/15/2026
0.3.3 94 4/4/2026
0.3.2 87 3/30/2026
0.3.1 93 3/23/2026
0.3.0 89 3/19/2026
0.2.0 100 3/15/2026