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. You can also specify a codebase directory to scan and a list of directory names to exclude.

For help, run:

pofiletranslate --help

Here’s the updated README file section for the command-line arguments with the updated --exclude parameter:

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 any matching translations found.

License

This project is licensed under the MIT License.

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.1.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.1.0-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pofiletranslate-0.1.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.1.0.tar.gz
Algorithm Hash digest
SHA256 5345dacf8d291df0301619d5fad13a17c70c9d8f9486a673b8bdd77a52054c62
MD5 83025e4ae6752f2773c3f2319735a805
BLAKE2b-256 5fcb97f7e5ce1f66dcfd87b653fc42da9b1f1514661e353b711093e96d52ebec

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pofiletranslate-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f9a4c13bb9da2425146915755250f6a875a37856778e57f68a40e5328c20f52c
MD5 a25de54f2fbcd381ae80b1d0bece6ffd
BLAKE2b-256 7c093b6ea45136aff41be7ba21b7a6239f26a2d7c1262fe610db12dc27273dfe

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