Skip to main content

Translate en/messages.json to other locales.

Project description

> translate.py

Translate en/messages.json to other locales automatically.

Installation

pip install translate.py

Usage

Run the CLI:

translate-msgs

If no options are provided, the CLI will:

  1. Prompt for en/messages.json keys to ignore
  2. Search for closest _locales directory
  3. Translate en/messages.json to target languages

Options

Options can be set using command-line arguments:

Option Description
--include-langs Comma-separated list of languages to include (e.g. `en,es,fr")
--exclude-langs Comma-separated list of languages to exclude (e.g. en,es)
--ignore-keys Comma-separated list of keys to ignore (e.g. appName,author)
--locales-dir Name of the folder containing locale files (default: _locales)
--provider Translation provider to use
--init Create a .config.json file to store your defaults
--no-wizard Skip interactive prompts during start-up

Config file

  • Use --init to create translate.py.config.json in your project root to set default options
  • CLI arguments always override config file

Example

translate-msgs --include-langs=fr,es --ignore-keys=appName,author

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

translate_messages-1.0.1.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

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

translate_messages-1.0.1-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file translate_messages-1.0.1.tar.gz.

File metadata

  • Download URL: translate_messages-1.0.1.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for translate_messages-1.0.1.tar.gz
Algorithm Hash digest
SHA256 3c08ab27a9e04f52241d448cc5f5ac02c60ec80c983c85b4730fd7fe97b22d1e
MD5 cce990cda0a961611d8025b4cdef5a01
BLAKE2b-256 2ae637713d18ca6a34b548712404fb3207f52aa1ddfaa0207aadc3d7841dae6d

See more details on using hashes here.

File details

Details for the file translate_messages-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for translate_messages-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ebb2c0ec9090b1150d9453afa6e26814184bcc0b8baec5062d160d0a23a5f6f8
MD5 8a3b31094dffffe44e3ec12367cb69e4
BLAKE2b-256 3bc3cc309f408b7e56195fd659ba2555f2864c0573d1e6e162e14e12959dc2ff

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