Bogoware.Localization 0.5.3

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

Bogoware.Localization

Nuget Nuget Documentation

A .NET localization library where each message is a class — its name is the key, its properties are the placeholders. No magic strings, no naming conventions to memorize, no resource files to keep in sync.

Supported Platforms: .NET 8 | .NET 10

Documentation | CHANGELOG | NuGet: Core | NuGet: AspNetCore

Why Bogoware.Localization?

Most localization frameworks start with a string key — "errors.required_field" — and a separately maintained template — "{0} is required". You pick the key by convention, match positional arguments by hand, and hope everything stays consistent across languages and refactors.

What if the message itself were a type?

public class RequiredFieldError(string fieldName) : ILocalizable
{
    public string FieldName { get; } = fieldName;
}

The fully-qualified type name is the key. The properties are the placeholders. Rename a class and the compiler tells you; rename a property and the template follows. There is nothing to keep in sync by hand.

This is a well-established idea — types as messages — applied to localization. The result is a system that is type-safe by design and simple by default: one DI call registers everything, culture fallback works automatically, and you can swap providers without touching the rest of your code.

Key Features

  • Class-based message modeling — the type name is the key, properties are the placeholders
  • Culture fallback chain — exact → parent → invariant, automatic
  • Multi-level provider resolution — self, DI, registry, fallback
  • Nested localizationILocalizable properties are formatted recursively through the full resolution chain
  • JSON registry — load templates from embedded resources, files, or raw strings
  • JSON serialization converters — localize properties during serialization
  • ASP.NET Core integration — per-request culture resolution, automatic JSON response localization, and ProblemDetails support via Bogoware.Localization.AspNetCore
  • DI integration — single-call setup via IServiceCollection
  • Near-zero dependencies (core) — only Microsoft.Extensions.DependencyInjection.Abstractions and Microsoft.Extensions.Logging.Abstractions

Getting Started

dotnet add package Bogoware.Localization
// 1. Define a localizable type — this *is* the message
public class RequiredFieldError(string fieldName) : ILocalizable
{
    public string FieldName { get; } = fieldName;
}

// 2. Register with one DI call (scans assembly for JSON templates)
services.AddLocalization(typeof(RequiredFieldError).Assembly);

// 3. Format — culture fallback is automatic
var message = formatter.Format(new RequiredFieldError("Email"));
// → "'Email' is required" (en-US)
// → "'Email' è obbligatorio" (it-IT)

Learn More

Visit the documentation site for the Quick Start guide, detailed walkthroughs, and API reference.

License

MIT

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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 (1)

Showing the top 1 NuGet packages that depend on Bogoware.Localization:

Package Downloads
Bogoware.Localization.AspNetCore

ASP.NET Core integration for Bogoware.Localization — automatic per-request culture resolution and localized JSON serialization.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.5.3 103 3/20/2026
0.5.2 93 3/20/2026
0.5.1 141 3/9/2026
0.5.0 98 3/9/2026
0.4.0 104 2/20/2026
0.3.0 359 2/20/2026
0.2.0 112 2/20/2026
0.1.1 96 2/19/2026
0.1.0 93 2/19/2026