A command line application that automatically translates the input sentence to multiple languages adds the translations to respective translation json files
Project description
multilingual
This is a command line application that automatically translates the input sentence to multiple languages and adds the translations to respective translation json files
You must run this script in the root folder where you keep your translation files. For now, this script assumes that you name your translations with the following patterns:
├───public // translations root folder
│ ├───de.json // {country-iso}.json
| ├───main_de.json // *_{country_iso}.json
│ └───main-de.json // *-{country_iso}.json
Installation
-
Make sure you have at least Python v3.10.2 installed.
-
Install the package:
$ pip install multilingual
- Go to the project folder where you keep your translation json files and run multilingual command with the sentence you want to translate:
$ cd {YOUR_PROJECT}/{TRANSLATIONS_DIR}`
$ multilingual "Sentence to be translated"
# SENTENCE_TO_BE_TRANSLATED : Sentence to be translated ---> en-gb.json
# SENTENCE_TO_BE_TRANSLATED : Frase a traducir ---> es.json
# SENTENCE_TO_BE_TRANSLATED : Phrase à traduire ---> fr.json
# SENTENCE_TO_BE_TRANSLATED : 번역 될 문장 ---> ko.json
# SENTENCE_TO_BE_TRANSLATED : Satz, um übersetzt zu werden ---> de.json
# SENTENCE_TO_BE_TRANSLATED : Sentence to be translated ---> en.json
# SENTENCE_TO_BE_TRANSLATED : 要翻译的句子 ---> zh.json
- You can optionally specify your own key for your translation:
$ multilingual "Sentence to be translated" --key=TRANSLATION
# TRANSLATION: Sentence to be translated ---> main-en-gb.json
# TRANSLATION: Frase a traducir ---> main-es.json
# TRANSLATION: Phrase à traduire ---> main-fr.json
# TRANSLATION: 번역 될 문장 ---> main-ko.json
# TRANSLATION: Satz, um übersetzt zu werden ---> main-de.json
# TRANSLATION: Sentence to be translated ---> main-en.json
# TRANSLATION: 要翻译的句子 ---> main-zh.json
Requirements
- Python 3.10.2
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file multilingual-0.1.1.tar.gz.
File metadata
- Download URL: multilingual-0.1.1.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.12 CPython/3.10.2 Darwin/21.2.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95272cecee64aee6109d5fd936f3fc045d18b0300d9d5883de08ea2102084ad6
|
|
| MD5 |
786fb3555ff866eea9f105358c358940
|
|
| BLAKE2b-256 |
def933df758096a6aeeb4acb8a5bab1515ef6b02a9d36688c21746a885e18f11
|
File details
Details for the file multilingual-0.1.1-py3-none-any.whl.
File metadata
- Download URL: multilingual-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.12 CPython/3.10.2 Darwin/21.2.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2272e1e84dfb1500a3ced315d3c57eec5eef561ac2ade5b36f26f99bf10769bd
|
|
| MD5 |
50d4519ffc23d0f207bfdc6edb059b6d
|
|
| BLAKE2b-256 |
1bad128a3c4f60945d2d70b752b5cae5f9198bd7add65b1fa7b5bbfd5a3e0bd1
|