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. 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., "ar") and updates your provided PO file with the most likely translation. If for example state == 'état' is found with 30% confidence and state == 'statut' is found with 70% 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.2.0.tar.gz (3.5 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.2.0-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pofiletranslate-0.2.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

Hashes for pofiletranslate-0.2.0.tar.gz
Algorithm Hash digest
SHA256 bfd174a4c2a692d87502b45210a7fbdf7ae42ec9c36a948818f08908ef606c2b
MD5 0cd03fbf1a4d2cad11d6c2cee45088a0
BLAKE2b-256 969d2ce93d5049c0781c58a96683ab907fa5fa28e6857c3346f785f45c762b90

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pofiletranslate-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4aae65be4b3c985b08f6d5874228c553d20c94ca1fd820a43c9d197b53a259e0
MD5 d706e187c1dbb13175b88b46b8cfd761
BLAKE2b-256 4f84226cc6262ea36a608f5f7a3b6245e76b08a63707505d407e444181aed342

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