Geaux.Localization
1.4.0
See the version list below for details.
dotnet add package Geaux.Localization --version 1.4.0
NuGet\Install-Package Geaux.Localization -Version 1.4.0
<PackageReference Include="Geaux.Localization" Version="1.4.0" />
<PackageVersion Include="Geaux.Localization" Version="1.4.0" />
<PackageReference Include="Geaux.Localization" />
paket add Geaux.Localization --version 1.4.0
#r "nuget: Geaux.Localization, 1.4.0"
#:package Geaux.Localization@1.4.0
#addin nuget:?package=Geaux.Localization&version=1.4.0
#tool nuget:?package=Geaux.Localization&version=1.4.0
Geaux.Localization
Tenant-aware, culture-aware, database-backed localization for .NET 8+ and .NET 9 applications.
Geaux.Localization provides a complete end-to-end localization system for multi-tenant and multi-culture applications. It integrates with Entity Framework Core and ASP.NET Core to deliver database-backed translations that respect the current tenant and culture for every request.
Features
- Database-backed
IStringLocalizerimplementation with tenant and culture scoping [Localized]attribute for annotating model properties that require translation keys- EF Core
SaveChangesinterceptor that automatically upserts translations for annotated properties - Seeder utility to create default translations across assemblies
- DI extension for registering context, localizer, and supporting services from configuration
- Support for SQL Server, PostgreSQL, MySQL/MariaDB, and Sqlite providers
Installation
Add the package reference to your project:
dotnet add package Geaux.Localization
Enable XML documentation so DocFX and IntelliSense can consume the inline XML comments:
<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
Configuration
Add a Localization section to your appsettings.json:
{
"ConnectionStrings": {
"LocalizationDb": "Server=localhost;Database=GeauxLocalization;Trusted_Connection=True;"
},
"Localization": {
"DefaultCulture": "en-US",
"SupportedCultures": [ "en-US", "fr-FR" ],
"EnableCultureFallback": true,
"ConnectionStringName": "LocalizationDb",
"Provider": "SqlServer",
"MigrationsAssembly": "Geaux.Migrations"
}
}
Usage
Register the localization services in Program.cs:
using Geaux.Localization.Extensions;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddGeauxLocalization(builder.Configuration);
Annotate model properties that need translations:
using Geaux.Localization.Attributes;
public class Product
{
public string TenantId { get; set; } = "default";
[Localized(
key: "Product.Name",
errorMessageKey: "Product.Name.Required",
displayNameKey: "Product.Name.Label",
displayMessageKey: "Product.Name.Description")]
public string Name { get; set; } = string.Empty;
}
Translations are stored in the Translations table as rows identified by tenant, culture, and key. The
LocalizationSaveChangesInterceptor keeps entries in sync during EF Core save operations.
Provider mapping
| Provider value | EF Core call | Example |
|---|---|---|
| SqlServer | UseSqlServer |
"Provider": "SqlServer" |
| PostgreSql | UseNpgsql |
"Provider": "PostgreSql" |
| MySql/MariaDb | UseMySql |
"Provider": "MySql" |
| Sqlite | UseSqlite |
"Provider": "Sqlite" |
| LocalDb | UseSqlServer |
"Provider": "LocalDb" |
Documentation
Generate DocFX documentation (requires the docfx global tool):
dotnet tool install -g docfx
docfx docfx.json
The generated site will be available under the _site folder.
License
MIT License © Brent Lee Rigsby / GeauxCajunIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. 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 was computed. 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. |
-
net9.0
- Microsoft.EntityFrameworkCore (>= 9.0.11)
- Microsoft.EntityFrameworkCore.Relational (>= 9.0.11)
- Microsoft.EntityFrameworkCore.Sqlite (>= 9.0.11)
- Microsoft.EntityFrameworkCore.SqlServer (>= 9.0.11)
- Microsoft.Extensions.Configuration (>= 9.0.11)
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.11)
- Microsoft.Extensions.DependencyInjection (>= 9.0.11)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.11)
- Microsoft.Extensions.Localization (>= 9.0.11)
- Microsoft.Extensions.Localization.Abstractions (>= 9.0.11)
- Microsoft.Extensions.Options (>= 9.0.11)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 9.0.11)
- Npgsql.EntityFrameworkCore.PostgreSQL (>= 9.0.4)
- Pomelo.EntityFrameworkCore.MySql (>= 9.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Geaux.Localization:
| Package | Downloads |
|---|---|
|
Geaux.Localization.Admin
Geaux.Localization.Admin provides a plug‑and‑play Razor Class Library admin dashboard for managing localization keys, cultures, translations, and language packs. Includes CSV/JSON/ZIP export and import tooling, missing‑value repair, and multi‑tenant support. |
GitHub repositories
This package is not used by any popular GitHub repositories.