Lightweight, high-performance hierarchical JSON localization library (IStringLocalizer) and ISO-4217 multi-currency formatter for modern .NET applications.
📖 Framework Documentation: English Specification | Spécification en français
-
JsonStringLocalizer(IStringLocalizer) &JsonStringLocalizerFactory:- Thread-safe lazy loading and memory caching (
ConcurrentDictionary<string, Lazy<Dictionary<string, string>>>) of localized JSON resource files ({culture}.json). - Automatic recursive flattening of nested JSON hierarchies (e.g.,
{"Common": {"Save": "Save"}}$\rightarrow$ Common.Save). - Automatic fallback hierarchy: active culture
$\rightarrow$ primary fallback language$\rightarrow$ raw translation key. - Zero-reflection parsing with full support for JSON scalars and graceful tolerance of malformed or missing keys.
- Thread-safe lazy loading and memory caching (
-
ILanguageService&LanguageService:- Dynamic discovery of translation files in specified directories.
- Native display name formatting with flag emojis (e.g.
🇺🇸 English,🇫🇷 Français).
ICurrencyService&CurrencyService:- Preconfigured support for 15 international currencies (
EUR,USD,GBP,CHF,CAD,JPY,AUD,SEK,NOK,DKK,PLN,BRL,MAD,TND,DZD) with dynamic configuration overrides viaIConfiguration["Currencies:Supported"]. FormatAmount: Formats monetary values adhering to target culture standards and explicit minus signs (avoids accounting parenthesis notation).
- Preconfigured support for 15 international currencies (
- Extension Methods:
decimal.ToCurrency(currencyCode, includeCents, culture)helper extensions.
Add the package via the .NET CLI:
dotnet add package LocaleForge --version 1.1.1using System.Globalization;
using LocaleForge.Currencies;
using LocaleForge.Localization;
// 1. Currency formatting
var currencyService = new CurrencyService();
string formatted = currencyService.FormatAmount(1250.50m, "EUR", includeCents: true, culture: CultureInfo.GetCultureInfo("fr-FR"));
// Output: 1 250,50 €
// 2. JSON String Localization
var factory = new JsonStringLocalizerFactory("Resources/Locales");
var localizer = factory.Create("Common", "Resources/Locales");
string text = localizer["Buttons.Submit"];This project is licensed under the MIT License © 2026 curvecoder.