H073.Local.Tool 2.0.0-alpha.1

Prefix Reserved
This is a prerelease version of H073.Local.Tool.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet tool install --global H073.Local.Tool --version 2.0.0-alpha.1
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local H073.Local.Tool --version 2.0.0-alpha.1
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=H073.Local.Tool&version=2.0.0-alpha.1&prerelease
                    
nuke :add-package H073.Local.Tool --version 2.0.0-alpha.1
                    

H073.Local.Tool

Command-line tools for H073.Local, the .NET localization library.

This is not a library you reference from code. It installs a program called hxloc onto your machine, which you run from a terminal or a CI job. It never ends up inside your application.

dotnet tool install -g H073.Local.Tool --prerelease

It does two things: check your translations for problems, and compile them into the compact binary format for shipping.


hxloc check — find broken translations before you ship

hxloc check ./Localization
Reference: _master

  de/ui
    error  'welcome' drops placeholder(s) {name} — they render as nothing
    error  'welcome' uses unknown placeholder(s) {player} — they render literally
    error  missing key 'menu.settings'

  pl/ui
    warn   'files' has no "few", "many" form(s); pl needs "one", "few", "many", "other"
    warn   key 'extra' is not in the reference

3 error(s), 2 warning(s).

Why you need this

The library reads a folder of JSON files, one folder per language. Nothing anywhere declares which keys are supposed to exist — each file simply lists what it happens to contain. So if English is missing a key that German has, no error is raised anywhere. At runtime the fallback language quietly covers for it, and the missing-key log only ever sees keys that something actually asked for. A key on a screen nobody opened during testing stays invisible until a user finds it.

hxloc check is the only thing that catches that before release.

What it reports

Severity
A key the reference has and this language does not error
A key this language has that the reference does not warning
A placeholder the translation dropped — it would render as nothing error
A placeholder the translation invented — it would render literally error
A plural category the language requires but the file lacks warning (error if other is missing)
A key with forms in the reference but a plain string here warning
Malformed JSON error
Two keys that collide internally error
A bank missing from a language entirely warning

The reference

Everything is compared against one catalogue. By default that is the _master folder if you have one, otherwise the language with the most keys. Override it:

hxloc check ./Localization --reference en

Options

--reference <code> Compare against this language instead of _master.
--strict Fail on warnings too, not just errors.
--quiet Print only the summary line.

In CI

The command exits with code 1 when it finds errors, so it fails a build:

- run: dotnet tool install -g H073.Local.Tool --prerelease
- run: hxloc check ./Localization

hxloc compile — build the binary format

hxloc compile ./Localization ./Localization.compiled
  de/ui                          412 keys      18,204 →     14,880 bytes
  en/ui                          412 keys      17,993 →     14,612 bytes

2 catalogue(s) → ./Localization.compiled   29,492 bytes, 82% of the JSON

It walks every language folder and turns each .json into a .bin, preserving the layout:

Localization/                     Localization.compiled/
├── _master/ui.json      →        ├── _master/ui.bin
├── de/ui.json           →        ├── de/ui.bin
└── en/ui.json           →        └── en/ui.bin

Ship the compiled folder and point Loc3Source at it. The JSON stays in source control and out of your package.

Run it as part of the build

<Target Name="CompileLocalization" BeforeTargets="Build"
        Condition="'$(Configuration)' == 'Release'">
  <Exec Command="hxloc compile ./Localization ./Localization.compiled" />
</Target>

This belongs in the build, not in your application. Compiling at startup would ship the JSON as well and pay the conversion cost on every launch — strictly worse than reading the JSON directly with JsonSource.

Options

--keys Keep key names in the output. Larger files, but missing-key reports name the key instead of a hash. Useful for internal test builds.
--language <code> Compile only this language. Repeatable.
--clean Delete the output folder first.
--quiet Print only errors.

What the compiler refuses to emit

Anything a reader could misinterpret fails the build instead: two keys whose hashes collide, a duplicate key, duplicate labels within one entry, a value over the format's limits, or a labelled entry with no category. All of them name the offending key.


Exit codes

0 Success. For check, no problems — or warnings only, without --strict.
1 check found errors; or compile failed on one or more catalogues.
2 Bad usage — missing arguments, unknown option, source folder does not exist.

Help

hxloc --help
hxloc --version

For the file format, the JSON layout and the library itself, see the H073.Local documentation.

Licence

Apache-2.0

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 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
2.0.0-alpha.2 69 8/18/2026
2.0.0-alpha.1 63 8/18/2026