Translate en/messages.json to other locales.
Project description
> translate.py
Translate en/messages.json to other locales automatically.
Installation
pip install translate.py
Usage
Run the CLI:
translate-msgs
If no options are provided, the CLI will:
- Prompt for
en/messages.jsonkeys to ignore - Search for closest
_localesdirectory - Translate
en/messages.jsonto target languages
Options
Options can be set using command-line arguments:
| Option | Description |
|---|---|
--include-langs |
Comma-separated list of languages to include (e.g. `en,es,fr") |
--exclude-langs |
Comma-separated list of languages to exclude (e.g. en,es) |
--ignore-keys |
Comma-separated list of keys to ignore (e.g. appName,author) |
--locales-dir |
Name of the folder containing locale files (default: _locales) |
--provider |
Translation provider to use |
--init |
Create a .config.json file to store your defaults |
--no-wizard |
Skip interactive prompts during start-up |
Config file
- Use
--initto createtranslate.py.config.jsonin your project root to set default options - CLI arguments always override config file
Example
translate-msgs --include-langs=fr,es --ignore-keys=appName,author
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file translate_messages-1.0.1.tar.gz.
File metadata
- Download URL: translate_messages-1.0.1.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c08ab27a9e04f52241d448cc5f5ac02c60ec80c983c85b4730fd7fe97b22d1e
|
|
| MD5 |
cce990cda0a961611d8025b4cdef5a01
|
|
| BLAKE2b-256 |
2ae637713d18ca6a34b548712404fb3207f52aa1ddfaa0207aadc3d7841dae6d
|
File details
Details for the file translate_messages-1.0.1-py3-none-any.whl.
File metadata
- Download URL: translate_messages-1.0.1-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ebb2c0ec9090b1150d9453afa6e26814184bcc0b8baec5062d160d0a23a5f6f8
|
|
| MD5 |
8a3b31094dffffe44e3ec12367cb69e4
|
|
| BLAKE2b-256 |
3bc3cc309f408b7e56195fd659ba2555f2864c0573d1e6e162e14e12959dc2ff
|