Skip to main content

Translate en/messages.json to other locales.

Project description

> translate-messages

Translate en/messages.json to other locales automatically.

Installation

pip install translate-messages

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-messages.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.2.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.2-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: translate_messages-1.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 e8c0bb77b581a4c54b8096747f5f764f3c385971645c43d8bb9c6ff44a86931b
MD5 6f70baf1f1662d74a13e75e8cfcdfb44
BLAKE2b-256 1283bbf042b520527b295ea6457d81cfb9c143f63f82b166fa81ef8a874ec13b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for translate_messages-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 612e67f7c072fd85ff1bc737d5b44b8499b9525d69af416a4a200ac5a8b40efd
MD5 302780a2c1664ff867d9a7e75f55f4f9
BLAKE2b-256 ec6bd786584b099889663054a5d66ae198e6b451374fe96fce1b9532275489a4

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