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
Release files for multilingual 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| multilingual-0.1.1.tar.gz | 3.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| multilingual-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.8 kB
Release files / multilingual-0.1.1.tar.gz
| Download URL | multilingual-0.1.1.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
95272cecee64aee6109d5fd936f3fc045d18b0300d9d5883de08ea2102084ad6
|
|
BLAKE2b-256 checksum How to use checksums |
def933df758096a6aeeb4acb8a5bab1515ef6b02a9d36688c21746a885e18f11
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.12 CPython/3.10.2 Darwin/21.2.0
|
Release files / multilingual-0.1.1-py3-none-any.whl
| Download URL | multilingual-0.1.1-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2272e1e84dfb1500a3ced315d3c57eec5eef561ac2ade5b36f26f99bf10769bd
|
|
BLAKE2b-256 checksum How to use checksums |
1bad128a3c4f60945d2d70b752b5cae5f9198bd7add65b1fa7b5bbfd5a3e0bd1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.12 CPython/3.10.2 Darwin/21.2.0
|