Traduire CLI interface
First, install the client program. The trd program is contained in the
traduire-cli package. I recommend using pipx
or something comparable:
pipx install traduire-cli
You need a configuration file, ~/.config/traduire.toml which contains one or
more records of the following form:
[[project]]
name = "Project name"
token = "asdf...-1"
url = "https://traduire.example.com/api/pofile/project-name/"
path = "..."
The name, token, and URL are taken from your Traduire installation. The path is
the folder where your local checkout of the project resides. The trd client
uses the configured path to automatically find the correct settings. Right now
there's no support forspecifying the necessary token and URL parameters
directly. (Contributions would be very welcome for this!)
Then, assuming you have your gettext .po files inside project/locale you
you should first ensure that they are up-to-date:
python manage.py makemigrations -a
Next, you can upload the pofiles to the Traduire server. All trd invocations
automatically find all *.po files in the provided folder and act on all of
them.
trd submit project/locale
After translating everything you can fetch all updates from the server:
trd get project/locale
You probably want to compile the catalogs now:
python manage.py compilemessages
Submitting pofiles only uses the msgid values except on the first submit.
Also, it doesn't delete obsolete strings. If you know what you're doing you can
replace the .po files on the server:
trd replace project/locale
The CLI currently doesn't support deleting translation catalogs, that's restricted to the administration interface.
Release files for traduire-cli 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| traduire_cli-0.0.5.tar.gz | 3.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| traduire_cli-0.0.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.6 kB
Release files / traduire_cli-0.0.5.tar.gz
| Download URL | traduire_cli-0.0.5.tar.gz |
|---|---|
| Size | 3.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f556d6e420af758d31ac85e277593209a9cd89225c2dda093554571fc2f2cec8
|
|
BLAKE2b-256 checksum How to use checksums |
656a30402c84928a7e6a7e1294ab51677fe85a4c4109e2f578a335b409b88b34
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-httpx/0.25.1
|
Release files / traduire_cli-0.0.5-py3-none-any.whl
| Download URL | traduire_cli-0.0.5-py3-none-any.whl |
|---|---|
| Size | 3.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
77a6bbdf15e0537cf4bb9e82160e0a9c7e6233e0d13d797c4c81177adda91b62
|
|
BLAKE2b-256 checksum How to use checksums |
8c25eb55b8ad0783a58d747587abd4a167e95c1344c16b70f2ef99a6030646ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-httpx/0.25.1
|