A CLI tool for automating PO file translations
Project description
PO files translator from local codebases
A simple CLI tool that scans a codebase for translations and updates a given PO file with the most likely translations. It automatically extracts the language from the PO file's name (for example, "ar.po" yields the language code "ar").
Installation
Clone the repository and install with pip:
pip3 install pofiletranslate
Usage
Run the tool by providing the full path to your PO file.
For help, run:
pofiletranslate --help
Command-Line Arguments
-
po_file_path(required): Full path to the PO file you want to process.
Example:/full/path/to/ar.po -
--depth(optional): Backtrack depth for computing the codebase directory. Defaults to4.
Example:--depth 3 -
--exclude(optional): Comma-separated list of directory names to exclude from the scan. Defaults to an empty string, meaning no directories are excluded.
Example:--exclude "dir1,dir2"- This will exclude the directories
dir1anddir2from the translation scan.
- This will exclude the directories
Example usage:
pofiletranslate /full/path/to/ar.po --depth 3 --exclude "dir1,dir2"
This example will process the ar.po file with a depth of 3 and will exclude
the directories dir1 and dir2 from the scan.
What It Does
The tool scans the specified codebase for PO files matching the derived language (e.g., "fr") and updates your provided PO file with the most likely translation. If for example state == 'statut' is found with 70% confidence and state == 'état' is found with 30% confidence, the tool will select 'statut'.
Project details
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 pofiletranslate-0.3.0.tar.gz.
File metadata
- Download URL: pofiletranslate-0.3.0.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f5c64b03674d2d58ed5847ef6accdd88cde16169cd4a33ca0662509ac52829de
|
|
| MD5 |
82b77bc3e56a4cc2017dda2045e94ca4
|
|
| BLAKE2b-256 |
a88d7850568715b71f3e1d4707f3f1ebb651826441bb56198da3397d9a15b669
|
File details
Details for the file pofiletranslate-0.3.0-py3-none-any.whl.
File metadata
- Download URL: pofiletranslate-0.3.0-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
099c28aa8bf5eb50b3e6e6963ff6a690f815d95c9022d7c8591e9c999a9ea966
|
|
| MD5 |
6a8d07ed1503e87bd653464ffd46ccd5
|
|
| BLAKE2b-256 |
7e1de26407ad425a6c4fefed1993e8b03b19fcee6fff4f2fed98992c65f33d5e
|