Arb.NET.Generators 0.3.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Arb.NET.Generators --version 0.3.0
                    
NuGet\Install-Package Arb.NET.Generators -Version 0.3.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="Arb.NET.Generators" Version="0.3.0" />
                    
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.0" />
                    
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.0
                    
#r "nuget: Arb.NET.Generators, 0.3.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 Arb.NET.Generators@0.3.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=Arb.NET.Generators&version=0.3.0
                    
Install as a Cake Addin
#tool nuget:?package=Arb.NET.Generators&version=0.3.0
                    
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 hated it.
    • Is the standard, but we are about to change that 😄
  2. Does not even support pluralization

How to:

  1. Install the packge of your choice. (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 # [REQUIRED] the name of the generated C# class that will contain the localization members
output-namespace: MyProject.Locale # [REQUIRED] the namespace of the generated C# class
  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, one {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.

  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.Examples/* - example projects to show how to use the library in different types of applications, currently a CLI example only.

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 (WIP):

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

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

Future:

Arb.NET.Analyzers - analyzer project that will aid users in some way etc...

License:

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

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