Locale 0.0.11
dotnet add package Locale --version 0.0.11
NuGet\Install-Package Locale -Version 0.0.11
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="Locale" Version="0.0.11" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Locale" Version="0.0.11" />
<PackageReference Include="Locale" />
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 Locale --version 0.0.11
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Locale, 0.0.11"
#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 Locale@0.0.11
#: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=Locale&version=0.0.11
#tool nuget:?package=Locale&version=0.0.11
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
🌍 Locale
Multi-format localization library for .NET
Locale is a powerful .NET library for working with localization files. It supports 11 formats and provides services for scanning, diffing, validating, converting, generating, and auto-translating translation files.
✨ Features
- 🔍 Scan - Compare localization files across cultures, detect missing/orphan keys
- 📊 Diff - Side-by-side comparison with placeholder mismatch detection
- ✅ Check - Validate against configurable rules
- 🔄 Convert - Transform between 11 different formats
- 📝 Generate - Create skeleton target files from a base language
- 🌐 Translate - Auto-translate using 10 providers (including ChatGPT, Claude, Gemini)
📦 Installation
dotnet add package Locale
🚀 Quick Start
using Locale.Services;
using Locale.Models;
// Scan for translation gaps
var scanService = new ScanService();
var report = scanService.Scan("./locales", new ScanOptions
{
BaseCulture = "en",
TargetCultures = ["tr", "de", "fr"]
});
Console.WriteLine($"Missing: {report.MissingKeys.Count}, Orphan: {report.OrphanKeys.Count}");
// Compare two files
var diffService = new DiffService();
var diff = diffService.Diff("en.json", "tr.json");
// Validate files
var checkService = new CheckService();
var check = checkService.Check("./locales", new CheckOptions
{
Rules = ["no-empty-values", "consistent-placeholders"]
});
// Convert formats
var convertService = new ConvertService();
convertService.Convert("en.json", "en.yaml", new ConvertOptions { ToFormat = "yaml" });
// Generate skeleton files
var generateService = new GenerateService();
generateService.Generate("./locales", "./locales", new GenerateOptions
{
BaseCulture = "en",
TargetCulture = "tr"
});
📁 Supported Formats
| Format | Extensions | Description |
|---|---|---|
| JSON | .json |
Flat and nested JSON |
| YAML | .yaml, .yml |
Flat and nested YAML |
| RESX | .resx |
.NET XML resources |
| PO | .po |
GNU Gettext |
| XLIFF | .xlf, .xliff |
XLIFF 1.2 & 2.0 |
| SRT | .srt |
SubRip subtitles |
| VTT | .vtt |
WebVTT subtitles |
| CSV | .csv |
Comma-separated values |
| i18next | .i18n.json |
i18next nested JSON |
| Fluent | .ftl |
Mozilla Fluent FTL |
| VB | .vb |
VB resources (read-only) |
🌐 Translation Providers
| Provider | API Key | Default Model |
|---|---|---|
| ❌ | - | |
| DeepL | ✅ | - |
| Bing | ✅ | - |
| Yandex | ✅ | - |
| LibreTranslate | ⚪ | - |
| OpenAI | ✅ | gpt-4o-mini |
| Claude | ✅ | claude-3-5-sonnet-latest |
| Gemini | ✅ | gemini-2.0-flash |
| Azure OpenAI | ✅ | - |
| Ollama | ❌ | llama3.2 |
📖 Documentation
For full documentation, visit the GitHub repository.
📄 License
MIT License - see LICENSE for details.
| Product | Versions 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 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 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.
-
net10.0
- YamlDotNet (>= 16.3.0)
-
net8.0
- YamlDotNet (>= 16.3.0)
-
net9.0
- YamlDotNet (>= 16.3.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.