Skip to main content

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 to 4.
    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 dir1 and dir2 from the translation scan.

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

pofiletranslate-0.4.0.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pofiletranslate-0.4.0-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file pofiletranslate-0.4.0.tar.gz.

File metadata

  • Download URL: pofiletranslate-0.4.0.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.32.3 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12

File hashes

Hashes for pofiletranslate-0.4.0.tar.gz
Algorithm Hash digest
SHA256 603aa70e29855f498d1c03a2d5e754166177803941da6099ea6b2d0327d6f86e
MD5 e1966e13c0060b7ca8820e44853ed6df
BLAKE2b-256 3e05e93d75f6c482c9ef3e2859e36e74ea4d4464ea47bc397a7b20ea987acc24

See more details on using hashes here.

File details

Details for the file pofiletranslate-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: pofiletranslate-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.32.3 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12

File hashes

Hashes for pofiletranslate-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 979defab80162dba56aab5b416443e6f72fa4e3bb4f7387e3ac4f7cf573ee15c
MD5 de2f83b0b866e29879f500baca561db7
BLAKE2b-256 a7aff941872423eea3735817b3e969a3432d778fa04fd3695d6e7675932d5894

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page