A small package for translating Python applications
Project description
Linguarita
When gettext doesn't work and you are sick of writing your own language engine for every program, you came to the right place! Linguarita is a generic language engine retrieving translations from JSON files.
The changelog can be found at https://codeberg.org/lucien-rowan/linguarita/src/branch/main/CHANGELOG.md
Installing the module
You can either copy the source code and directly include linguarita.py into your program but I find that difficult. Instead, you can just open your virtual environment and type pip install linguarita-lucien-rowan
into the terminal.
Using the module
Basically, your project needs the following files:
- main.py (can be another name as well, just for execution)
- translations/(lang).json (the translations are stored in JSON files, just replace (lang) with the actual language like en for English, de for German or ua for Ukrainian)
The translations occur with linguarita.translateText(og_str, langcode)
with og_str being the string you want to translate (must be the same as in the JSON file) and the langcode being the filename of the JSON file before the dot.
Contributing
Of course, this module also needs some attention.
Which attention?
- Enhancing it with useful features
- Fixing the bugs that might occur
- Documenting its API
- Translating that documentation to other languages
- Implementing it into Python applications
While Linguarita is a simple module from its code, it might seem a bit hard to implement it in real life scenarios. Therefore, documentation and example applications will follow.
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
Hashes for linguarita_lucien-rowan-0.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1931f517fc20b2676494d1e73fd0ba5e6ff5aa265bcb11126ad4c550d0efe55 |
|
MD5 | f83784ba003dcaf0099912391fc131c3 |
|
BLAKE2b-256 | a70f25866c3cd8613f620a7597b4b54f21cea672f91ed1db5444c4cc6abbbd49 |
Hashes for linguarita_lucien_rowan-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a43c3405a464a05d86e1ba2bad8543ccee63335bd0cfb78547ed6851281a355 |
|
MD5 | 4b2efb213e607fc6ec3b1a56dc357bfa |
|
BLAKE2b-256 | e9957ca4189962381cd43af7e22081e59de6a0253e02ebc181f8b49477b589fb |