chki18n for Python
chki18n.cdget.com
The documentation site has every check, every option and every example. This README is the quick start.
chki18n checks that your i18n translation files agree with each other. Point it at a folder of JSON, name the language everything is compared against, and it reports what is missing, what was never translated and what broke without anyone noticing.
- Twenty-five checks — missing keys, empty values, strings nobody translated, mismatched interpolation placeholders, drifting terminology, and, pointed at your sources, keys nothing references and keys nothing defines. The full list is on the documentation site.
- Every layout — one file per locale, one folder per locale, or one file holding them all.
- CLI and library share one set of checks and one set of options.
- A report in the shape you need — grouped by language, check, file or nothing; rendered for a terminal, for
grep, as JSON, as Markdown or as GitHub Actions annotations; saved to a file on request. - No dependencies, fully typed, and
chki18n.corereaches no file system at all.
Install
pip install chki18n
Requires Python 3.10 or newer.
From the command line
chki18n ./locales --target en
Path ./locales
Target en
Locales en, ko
Layout single, 1 group, 10 keys
ko ──────────────────────────────────────────────────────────────────────── 1 error · 1 warning
ERROR NO_KEY (1)
The key exists in the target language but is missing here.
attr.folder en: "Folder"
WARN NOT_TRANSLATED_VALUE (1)
The value is identical to the target language, so the translation may be incomplete.
desc.no-str en: "12345"
Summary ───────────────────────────────────────────────────────────────────────────────────────
Compared 10 keys across 2 locales in 1 group. (3ms)
1 error · 1 warning
Clean: en
FAIL 1 error must be fixed before this passes.
Exits with 1 when an error level issue was found, so a CI job fails on it. chki18n --help lists every flag. Without installing it, pipx run chki18n ./locales --target en does the same thing.
--group-by decides what a section is (locale, code, group, file or none), --reporter decides the shape (pretty, list, json, markdown or github), and --output keeps a copy:
chki18n ./locales --target en --reporter json > report.json
chki18n ./locales --target en --output translation-report.md
From Python
Four entry points, depending on who owns the translations:
from chki18n import (
Entry,
Input,
Options,
analyze_translations,
check_translation_files,
create_analyzer,
load_translations,
)
# Check a directory once — the same thing the CLI does.
result = check_translation_files("./locales", Options(target="en"))
result.success # False
result.issues # every issue, with its level, key, locale and file
# Check data you already have, with no file system work at all.
analyze_translations(Input(locales={"en": en, "ko": ko}), Options(target="en"))
# Read a directory once, then check it as often as you like.
session = load_translations("./locales", Options(target="en"))
session.set("ko", "desc.hello", "안녕하세요") # the issues for that key
# Or let your own application own the values and ask only for a verdict.
create_analyzer(Options(target="en")).check_entry(
Entry(key="desc.hello", values={"en": "Hello {name}", "ko": "안녕하세요"})
)
# [Issue(code='NO_INTERPOLATION_KEY', level='error', locale='ko', ...)]
analyze_translations and create_analyzer do no file system work and are also importable as chki18n.core, which reaches no file system at all.
Every option is one keyword-only object, so a flag and its Python counterpart are the same thing. The loose forms a command line writes are accepted here too:
Options(
target="en",
ignore_checks=["SUSPICIOUS_LENGTH"], # or "SUSPICIOUS_LENGTH"
levels={"EMPTY_VALUE": "error"}, # or "EMPTY_VALUE=error"
key_case="kebab",
reporter="markdown",
)
The documentation site covers every check, every option and how to render a result.
Contributing
Anyone can contribute by reporting an issue or opening a pull request. See CONTRIBUTING.md.
License
Released under the MIT License.
Metadata
Release files for chki18n 1.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| chki18n-1.3.0.tar.gz | 100.4 kB | With provenance | Details for chki18n-1.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| chki18n-1.3.0-py3-none-any.whl | Python 3 | none | any | Details for chki18n-1.3.0-py3-none-any.whl |
Total release size: 191.6 kB
Release files / chki18n-1.3.0.tar.gz
| Download URL | chki18n-1.3.0.tar.gz |
|---|---|
| Size | 100.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fb9621520fc2e450660856119007484e9a463a654415139e970f9c781c912fed
|
|
BLAKE2b-256 checksum How to use checksums |
209acd5d7f529804b9280443e9c330f9b8e1e0438a1536787330574b9cd1dcf0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.
Transparency logRelease files / chki18n-1.3.0-py3-none-any.whl
| Download URL | chki18n-1.3.0-py3-none-any.whl |
|---|---|
| Size | 91.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
95bccbb3e1c3d134d7d2fdb9f349662fc126a514507d4da7c11286de7017abdf
|
|
BLAKE2b-256 checksum How to use checksums |
ffbb8e4e10b445f872bb66fc46b197650dc6cf69e073b7639de75d1fd34f5563
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.
Transparency logSecurity for chki18n 1.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for chki18n-1.3.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.