gettext-spellchecker
gettext-spellchecker is a command line tool which checks the spell of msgid or msgstr strings in a gettext .po or .pot file.
It uses hunspell dictionaries.
It outputs the results to a CSV file or to colored output in the terminal.
Plural forms are checked; obsolete (#~) entries are skipped.
Installation
The hunspell Python module is compiled when installed, so it needs the hunspell development files first. In Debian and derivatives:
apt install libhunspell-dev
pip install gettext-spellchecker
From source code
git clone https://github.com/rgglez/gettext-spellchecker.git
cd gettext-spellchecker
pip install -e .
Execution
gettext-spellchecker --lang=de_DE -i examples/example_simple.po --check=msgstr
The exit code is 0 when no errors are found, 1 when possible spelling errors are found, and 2 on invalid arguments (for instance, a missing dictionary), so the tool can be used in CI pipelines or pre-commit hooks.
Command line options
--versionprints the version.--paththe path to hunspell dictionaries. Default: "/usr/share/hunspell".--langthe name of the hunspell dictionary of the language of the strings, without extension. Usually in the form xx_YY where xx is in ISO 639-1 format and YY in ISO 3166-1 alpha-2 format, but any dictionary present in--pathworks (e.g.de_DE_frami).-i,--inputthe path of the .po or .pot file.-o,--outputoptional path of the output file in CSV format.--checkwhich string do you want to check: 'msgid' or 'msgstr'. Default="msgid".
Dictionaries
This tool uses hunspell dictionaries.
In Debian and derivatives you install them with apt, for instance:
apt install hunspell-fr
Read your operating system's documentation to know how to install those packages from its repositories, or visit hunspell if you need to compile them by hand.
Development
make dev # editable install of the package and the dev tools
make check # lint, tests, build and twine check
The tests need the de_DE and en_US hunspell dictionaries (apt install hunspell-de-de hunspell-en-us).
Releases are published to PyPI by the Publish GitHub workflow when a vX.Y.Z tag is pushed (make release). Run make help for the other targets.
Notes
- Sample .po and .pot files are included in the
examplesdirectory. - Why gettext?
- First and most relevant reason: it uses the full strings in the original language as key, so I don't have to be searching for weird keys such as "page.title.hello" or "item.specification". If one translation doesn't exist, the original key string is used.
- It's a GNU standard, tried and trusted.
License
Copyright 2026 Rodolfo González González.
Apache License 2.0. Please read the LICENSE file.
Metadata
Release files for gettext-spellchecker 0.1.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 | |
|---|---|---|---|---|
| gettext_spellchecker-0.1.0.tar.gz | 12.0 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gettext_spellchecker-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 24.4 kB
Release files / gettext_spellchecker-0.1.0.tar.gz
| Download URL | gettext_spellchecker-0.1.0.tar.gz |
|---|---|
| Size | 12.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9d5907a49a0ab41274b8830f8b86026d4369470d22fd789e789b68b9102f3cc4
|
|
BLAKE2b-256 checksum How to use checksums |
dc9ff6870aff1862f30897a8bfc475f379f7684f568ae624b5a01419801132b1
|
| 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 23, 2026.
Transparency logRelease files / gettext_spellchecker-0.1.0-py3-none-any.whl
| Download URL | gettext_spellchecker-0.1.0-py3-none-any.whl |
|---|---|
| Size | 12.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
33b24365828f296047bdbb9d92c56097edae268d560f5c01c709f56a9c7b439f
|
|
BLAKE2b-256 checksum How to use checksums |
5922cee5896fb871ef9e49e9c6a6954ad325da5cf7d0497aae74fb3b4ba3258f
|
| 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 23, 2026.
Transparency logSecurity for gettext-spellchecker 0.1.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
All 2 files in this release have been uploaded with provenance metadata.
Attestation for gettext_spellchecker-0.1.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 23, 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.