This is a simple python library/CLI tool to translate .po files using various APIs.
Project description
poTranslation
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 poTranslation
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/poTranslation
Issue Tracker: https://github.com/StevenGuo42/poTranslation/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.1a2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35747f49b989176a8dec6b46670b0a46f08537f3f21c0fd8315c22bd5f8d5770 |
|
MD5 | 040061f808874f4c23c938c6ea6d0449 |
|
BLAKE2b-256 | 4eb84879369124aeaa825e68f877df1ec2b808c647cbdb8e243976474ad94ff8 |