> translate-messages
Translate
en/messages.json(chrome.i18n format) to 100+ locales automatically.
Installation
pip install translate-messages
Usage
Run the CLI:
translate-messages [options] # or translatemsgs
If no options are passed, the CLI will:
- Prompt for message keys to ignore
- Auto-discover closest child
_localesdir - Translate found
en/messages.jsonto target languages
Note: Any messages.json in the chrome.i18n format can be used as a source file.
Options
Options can be set by using command-line arguments:
| Option | Description | Example |
|---|---|---|
-d, --locales-dir |
Name of the folder containing locale files (default: _locales) |
--locales-dir=_messages |
-t, --target-langs |
Comma-separated list of languages to translate to (default: all 100+ stable_locales) |
--target-langs=es,fr |
-k, --keys |
Comma-separated list of keys to translate (default: all found src keys missing in target files) | --keys=app_DESC,err_NOT_FOUND |
--exclude-langs |
Comma-separated list of languages to exclude | --exclude-langs=es,zh |
--exclude-keys |
Comma-separated list of keys to ignore | --exclude-keys=app_NAME,author |
--only-stable |
Only use stable locales (skip auto-discovery) | |
--config |
Use custom config file | --config=path/to/file |
init, -i, --init |
Create .translate-msgs.config.json5 in project root to store default options |
|
-f, --force |
Force overwrite of existing config file when using init |
|
-n, --no-wizard |
Skip interactive prompts during start-up | |
-h, --help |
Show help screen | |
-v, --version |
Show version | |
-V, --debug [target_config_key] |
Show debug logs | |
--docs |
Open docs URL |
Examples
Translate all keys except app_NAME from _locales/en/messages.json to all stable_locales:
translate-messages --ignore-keys=app_NAME # prompts for more keys to ignore
Translate app_DESC key from messges/en/messages.json to French:
translate-messages -n --keys=app_DESC --locales-dir=messages --target-langs=fr # no prompts
Translate app_DESC + err_NOT_FOUND keys from _msgs/en/messages.json to Spanish and Hindi:
translate-msgs -n -k app_DESC,err_NOT_FOUND -d _msgs -t es,hi # no prompts
Config file
Run translate-msgs --init to create .translate-msgs.config.json5 in your project root to set default options.
Example defaults:
{
"locales_dir": "_locales", // name of the folder containing locale files
"target_langs": "", // languages to translate to (e.g. "en,es,fr") (default: all 100+ supported locales)
"keys": "", // keys to translate (e.g. "app_DESC,err_NOT_FOUND")
"exclude_langs": "", // languages to exclude (e.g. "en,es")
"exclude_keys": "", // keys to ignore (e.g. "app_NAME,author")
"force": false, // force overwrite existing config file when using --init
"no_wizard": false // skip interactive prompts during start-up
}
Note: CLI arguments always override config file.
MIT License
Copyright © 2023–2026 Adam Lui.
Related
🈶 is-unicode-supported - Detect whether the terminal supports advanced Unicode.
🇨🇳 non-latin-locales - ISO 639-1 (2-letter) codes for non-Latin locales.
🇪🇸 latin-locales - ISO 639-1 (2-letter) codes for Latin locales.
{ } remove-json-keys - Simply remove JSON keys via CLI command.
Metadata
Release files for translate-messages 1.10.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| translate_messages-1.10.2.tar.gz | 22.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| translate_messages-1.10.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 47.5 kB
Release files / translate_messages-1.10.2.tar.gz
| Download URL | translate_messages-1.10.2.tar.gz |
|---|---|
| Size | 22.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
865a2931cfa4a2cd2364244953429179051a8bb144b815a6f9e66f77a5045996
|
|
BLAKE2b-256 checksum How to use checksums |
45afc0de56ee76bd86b2846a855bb5710567ec99d2124c6c86653e5679640a8d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jun 6, 2026.
Transparency logRelease files / translate_messages-1.10.2-py3-none-any.whl
| Download URL | translate_messages-1.10.2-py3-none-any.whl |
|---|---|
| Size | 25.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6cc3dc523d5c942fcc7365d1ebd486b3b08d4c37a5e8e7d145222ed1928a8077
|
|
BLAKE2b-256 checksum How to use checksums |
8a9966e868d4f8f9865a1041090ec1ce585a36e6924f860bd36f269d4285d7fb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jun 6, 2026.
Transparency log