A simple API for translating your programs
Project description
jdTranslationHelper
With jdTranslationHelper you can translate your programs. The translation files are .lang files which has ths format:
key=Hello World
test=This is a test
The files are in a folder named after the language code e.g. en_GB.lang
Here is a example how to use this API:
from jdTranslationHelper import jdTranslationHelper
translations = jdTranslationHelper()
translations.loadDirectory("/home/User/translations")
print(translatios.translate("test"))
If we place the above en_GB.lang file in /home/User/translations, it will print This is a test. You can create files for any language.
You can also call jdTranslationHelper with arguemnts:
lang=The language which should be loaded. If not specified, it will use the system language.
defaultLanguage=The language that will be usesd, if there is no file with the system language. Default is en_GB.
translate takes this argument:
default: That will be returned, if the given key doesn't exists.
You can get alls Strings with getStrings().
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
Built Distribution
File details
Details for the file jdTranslationHelper-3.3.tar.gz
.
File metadata
- Download URL: jdTranslationHelper-3.3.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | adff391644eba41677dbbae06c42acc2bbe5c1cb7ca3d7e9764be7328ede346e |
|
MD5 | 1a0bea06c124cb55aa300fec4f454e9c |
|
BLAKE2b-256 | 639ea5693f918b194f1f1969ec40ae274c4a5c5a0323b5758f80cc880bd8a561 |
File details
Details for the file jdTranslationHelper-3.3-py3-none-any.whl
.
File metadata
- Download URL: jdTranslationHelper-3.3-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e452c65cc31f461477492abc4aa68a86d208b7107c339de896359933c1ed46de |
|
MD5 | b4e04a2cd7174c73e4cd856a1ef6db5e |
|
BLAKE2b-256 | 8241540b221376f7e82b02273f8ffd778c789f7583db178ecea1fad9ba6bcda9 |