Translate your program to different languages.
Project description
langtranslator
This module allows you to translate your program to different languages. This is done by making a json with all the translations. For further information read the usage chapter.
Installing
pip install langtranslator
Usage
JSON File: { "info": {"languages": ["en", "ger", "fr"]}, "translations": { "string1": {"en": "This is a string.", "ger": "Das ist ein String.", "fr": "I dont know frech."}, "string2": {"en": "test", "ger": "abc", "fr": "bonjour"} } }
In info you specify the languages that are translated. In translations you specify the different translated strings.
Python: # How to initialize the module: from langtranslator import langtranslator translator = langtranslator.langtranslator("filename.json", "language")
# How to get strings in the specified language:
translator.get("stringKey")
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
File details
Details for the file langtranslator-1.0.3.tar.gz.
File metadata
- Download URL: langtranslator-1.0.3.tar.gz
- Upload date:
- Size: 1.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9118d0c6e8b85c55a300902149855a4ea1fe29a36bd08f9f8e53eedf36a30ef7
|
|
| MD5 |
71af0958aea0cd44f925aef516600d66
|
|
| BLAKE2b-256 |
69520ff75fa28f0937ad418dd225a0a9817db063ed6b688db9aeac6ed401b304
|