Locale 0.0.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package Locale --version 0.0.3
                    
NuGet\Install-Package Locale -Version 0.0.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="Locale" Version="0.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Locale" Version="0.0.3" />
                    
Directory.Packages.props
<PackageReference Include="Locale" />
                    
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 Locale --version 0.0.3
                    
#r "nuget: Locale, 0.0.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 Locale@0.0.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=Locale&version=0.0.3
                    
Install as a Cake Addin
#tool nuget:?package=Locale&version=0.0.3
                    
Install as a Cake Tool

Locale

A powerful multi-format localization core library for .NET that supports scanning, diffing, validating, and transforming translation files.

Features

  • Multi-Format Support: JSON, YAML, RESX, PO/Gettext, XLIFF, SRT, VTT, CSV, i18next JSON, Fluent FTL, and VB resources
  • Scan Service: Compare localization files across cultures, detect missing/orphan keys and empty values
  • Diff Service: Compare two files with placeholder mismatch detection
  • Check Service: Validate against configurable rules (empty values, duplicates, orphans, placeholders, whitespace)
  • Convert Service: Transform between formats while preserving structure
  • Generate Service: Create skeleton target files from a base language
  • Watch Service: Monitor files for changes and auto-run scan/check
  • Translate Service: Auto-translate using external APIs (Google, DeepL, Bing, Yandex, LibreTranslate, OpenAI, Claude, Gemini, Azure OpenAI, Ollama)

Installation

dotnet add package Locale

Quick Start

using Locale.Services;
using Locale.Models;

// Scan for translation gaps
var scanService = new ScanService();
var scanReport = scanService.Scan("./locales", new ScanOptions
{
    BaseCulture = "en",
    TargetCultures = ["tr", "de"]
});

// Compare two files
var diffService = new DiffService();
var diffReport = diffService.Diff("en.json", "tr.json");

// Validate files
var checkService = new CheckService();
var checkReport = checkService.Check("./locales", new CheckOptions
{
    Rules = ["no-empty-values", "no-duplicate-keys"]
});

// Convert between formats
var convertService = new ConvertService();
var result = convertService.Convert("en.json", "en.yaml", new ConvertOptions
{
    ToFormat = "yaml"
});

// Generate skeleton files
var generateService = new GenerateService();
var generateResults = generateService.Generate("./locales", "./locales", new GenerateOptions
{
    BaseCulture = "en",
    TargetCulture = "tr"
});

Supported Formats

Format Extensions Description
JSON .json Flat and nested JSON structures
YAML .yaml, .yml Flat and nested YAML structures
RESX .resx .NET XML resource files
PO .po GNU Gettext translation files
XLIFF .xlf, .xliff XML Localization Interchange File Format (1.2 & 2.0)
SRT .srt SubRip subtitle files
VTT .vtt WebVTT subtitle files
CSV .csv Comma-separated values (key,value or multi-language)
i18next .i18n.json i18next-style nested JSON with namespace support
Fluent .ftl Mozilla Fluent FTL translation files
VB .vb Visual Basic resource wrappers (read-only, best-effort)

License

MIT License - see LICENSE for details.

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 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.

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
0.0.11 205 12/6/2025
0.0.10 360 12/4/2025
0.0.9 153 12/4/2025
0.0.8 152 12/4/2025
0.0.7 170 12/4/2025
0.0.6 160 12/4/2025
0.0.5 166 12/4/2025
0.0.4 170 12/4/2025
0.0.3 161 12/4/2025
0.0.2 171 12/4/2025
0.0.1 170 12/3/2025