Yaml.Localizer 10.3.0

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

Yaml.Localizer

A tool for managing localized texts via a YAML definition file.

Usage

First, register YamlLocalizer in the services collection.

using Yaml.Localizer.DependencyInjection;

...

services.RegisterYamlLocalizer("{path-to-the-yaml-file}.yaml");

Ensure the YAML file has the correct format. NOTE: The default culture will be the first iso-code of the first message-id.

- Id: "{message-id}"
  Messages:
    {iso-code1}: "{text1}"
    {iso-code2}: "{text2}"
    ...

Example

- Id: "MSG_GREETING"
  Messages:
    es: "Hola"
    en: "Hello"

- Id: "MSG_GOODBYE"
  Messages:
    es: "Adiós"
    en: "Goodbye"

- Id: "MSG_MULTILINE_TEXT"
  Messages:
    es: |
      Esto es un mensaje con
      múltiples líneas
    en: |
      This is a
      multiline message

Then, in order to get a translated text for your app's current culture, you can do as in this example:

Example

[TestCase("es", "MSG_GREETING", "Hola")]
[TestCase("en", "MSG_GREETING", "Hello")]
[TestCase("en-GB", "MSG_GOODBYE", "Goodbye")]
public void CanTranslateExistingMessage(string culture, string msgId, string expected)
{
    // Arrange
    this.Localizer.UseCultureOrDefault(culture);
    
    // Act
    var result = this.Localizer[msgId];

    // Assert
    Assert.That(result, Is.EqualTo(expected));
}
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in 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
10.3.0 93 9/3/2026
10.2.1 107 7/31/2026
10.1.1 119 7/18/2026
10.0.4 140 5/17/2026
10.0.3 124 2/28/2026
10.0.2 116 1/18/2026
10.0.1 122 1/17/2026
10.0.0 144 1/17/2026