Locale.CLI
0.0.11
dotnet tool install --global Locale.CLI --version 0.0.11
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
dotnet tool install --local Locale.CLI --version 0.0.11
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=Locale.CLI&version=0.0.11
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
nuke :add-package Locale.CLI --version 0.0.11
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
🖥️ Locale.CLI
Cross-platform CLI tool for localization management
Locale.CLI is a powerful command-line tool for managing localization files. Scan, diff, validate, convert, generate, watch, and auto-translate across 11 formats with support for 10 translation providers including AI (ChatGPT, Claude, Gemini).
📦 Installation
dotnet tool install -g Locale.CLI
🚀 Quick Start
# Scan for translation gaps
locale scan ./locales --base en --targets tr,de,fr
# Compare two files
locale diff en.json tr.json
# Validate with CI exit codes
locale check ./locales --ci
# Convert between formats
locale convert en.json en.yaml
# Generate skeleton files
locale generate tr --from en --in ./locales --out ./locales
# Watch for changes
locale watch ./locales --base en --mode scan
# Auto-translate with AI
locale translate tr --from en --in ./locales --provider openai --api-key YOUR_KEY
📋 Commands
| Command | Description |
|---|---|
scan |
Compare localization files across cultures |
diff |
Compare two localization files |
check |
Validate against configurable rules |
convert |
Transform between formats |
generate |
Create skeleton target files |
watch |
Monitor files for changes |
translate |
Auto-translate using external APIs |
✅ Validation Rules
locale check ./locales --rules no-empty-values,consistent-placeholders --ci
| Rule | Description |
|---|---|
no-empty-values |
Flag empty or whitespace-only values |
no-duplicate-keys |
Flag duplicate keys |
no-orphan-keys |
Flag keys missing from base culture |
consistent-placeholders |
Ensure placeholders match |
no-trailing-whitespace |
Flag trailing whitespace |
🌐 Translation Providers
# Free providers
locale translate tr --from en --in ./locales --provider google
locale translate tr --from en --in ./locales --provider ollama --model llama3.2
# API providers
locale translate tr --from en --in ./locales --provider deepl --api-key KEY
locale translate tr --from en --in ./locales --provider openai --api-key KEY
locale translate tr --from en --in ./locales --provider claude --api-key KEY
locale translate tr --from en --in ./locales --provider gemini --api-key KEY
| 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 |
📁 Supported Formats
JSON, YAML, RESX, PO/Gettext, XLIFF (1.2 & 2.0), SRT, VTT, CSV, i18next JSON, Fluent FTL, and VB resources.
📖 Documentation
For full documentation and examples, 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.
This package has no dependencies.