This is a simple python library/CLI tool to translate .po files using various APIs.
Project description
poTranslator
Description
This is a simple python library/CLI tool to translate .po
files using various APIs.
Installation
Install and update using pip:
pip install -U poTranslator
Usage
Create a .env
file in your working directory or parent directory with the following content:
TRANSLATOR_SERVICE=YOUR_TRANSLATOR_SERVICE
API_KEY=YOUR_API_KEY
API_REGION=YOUR_API_REGION
NOTE: TRANSLATOR_SERVICE currently supports
MS
only.API_REGION
is optional for some services.
Command Line Interface Example
potranslate --help
poTranslate ./messages.po -s en -d zh -f
Options:
-s, --source-language TEXT Source language for translation. [default: en]
-d, --dest-language TEXT Destination language for translation. [default: (load from .po file)]
-l, --lang TEXT Programming langrage of formatted string. [default: python]
-f, --file PATH Path to the output file. [default: {po_file_path}]
-e, --env PATH Path to the env file. [default: (load from cwd and parent dir)]
-F, --force Force translation of all entries.
-v, --verbose Enable verbose output.
-q, --quiet Suppress output.
-w, --write Write to the file. [default: True]
-h, --help Show this message and exit.
Roadmap
- Multiple translation services support
Challenge: Some services require an glossary to be created before translation for formatted strings with placeholders.
Distributed under the BSD 3-Clause License. See LICENSE
for more information.
Links
Source Code: https://github.com/StevenGuo42/poTranslator
Issue Tracker: https://github.com/StevenGuo42/poTranslator/issues
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
Hashes for poTranslation-0.0.1a1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7209b521b68d3a835f0c7e92c0bba0b8ebaa8e989916507301391e97128d5a77 |
|
MD5 | 906c9027b0be3d4b52449723c2c406b1 |
|
BLAKE2b-256 | ef7afd92ca682b7bb81a39ef5a1afa61d0a12d3a87426b310e84661d09390a92 |