Getting started
Localizer works with Go and Python CLIs in public GitHub repositories. For a
Cobra (v1.8 or later), kong or
urfave/cli v3 CLI, or a Typer,
Click or argparse CLI (Python 3.10 or later), one line translates the
whole command tree. Other CLIs call Init/init and use the
output helpers.
-
Connect your repository.
Add
.github/workflows/localizer.yml:name: Localizeron:push:branches: [main] # your default branchworkflow_dispatch:permissions:contents: writepull-requests: writeid-token: writeconcurrency:group: localizer # one run at a time: a second push waitscancel-in-progress: falsejobs:translations:runs-on: ubuntu-lateststeps:- uses: actions/checkout@v7- uses: snizyx/localizer/action@v0.7.0Then turn on Settings → Actions → General → Allow GitHub Actions to create and approve pull requests, and push. See the GitHub Action guide.
Install the Localizer GitHub App (called localedev on GitHub) on the repository. Nothing else is needed. See the GitHub App guide.
-
Merge the onboarding pull request. The first run opens Localize this CLI with Localizer, which adds
.localizer.ymlwith the default settings (configuration), the locales package with one catalog per language, and the one-line integration when Localizer finds exactly one place where your CLI runs. Otherwise the pull request tells you where to add it.locales/embed.goandlocales/ja.json,locales/de.json, …;localizer.Localize(root, locales.FS)right beforeroot.Execute(), and the module ingo.mod.
yourcli/locales/__init__.pyandyourcli/locales/ja.json,yourcli/locales/de.json, … inside your package (withsrc/layouts too);localizer.localize(app, "yourcli.locales")right before the app runs, andlocalizerinpyproject.toml’s dependencies. Regenerate your lock file if you keep one, and with setuptools make sure the JSON files are packaged ([tool.setuptools.package-data]).
-
Try it.
Terminal window go build -o yourcli .LANG=ja_JP.UTF-8 ./yourcli --helpLOCALIZER_LANG=de ./yourcli --helpLOCALIZER_LANG=qps ./yourcli --help # pseudo-localization: shows every string Localizer handlesTerminal window pip install -e . # or: uv syncLANG=ja_JP.UTF-8 yourcli --helpLOCALIZER_LANG=de yourcli --helpLOCALIZER_LANG=qps yourcli --help # pseudo-localization: shows every string Localizer handles -
Hook your own messages. Help and your framework’s errors are covered by the one line. For messages your code prints, wrap your output helpers with
localizer.T,localizer.Sprintf,localizer.Errororlocalizer.Writer(Go), orlocalizer.t,localizer.tfandlocalizer.error(Python). The integration guide shows how. -
Keep tests in English. Set
LOCALIZER_LANG=enwherever output is compared with golden files (for pytest, apytest_configurehook in the rootconftest.py). See Testing.
From now on, every push that changes user-facing strings updates the Update translations pull request.
© 2026 Snizyx Software LLC