Internationalization library for comfortable usage
Project description
Internationalization.py
Provides simple and powerful i18n realization
Installation
With pip
pip install internationalization.py
Via Git
git clone https://github.com/cortelf/internationalization.py
cd internationalization.py
python setup.py install
Usage
Create directory for yaml files
mkdir yourdirectory
Write your yaml files
You can use .yml or .yaml file extensions
en.yml
hello_world: Hello World!
it.yml
hello_world: Ciao mondo!
In root of your app initialize singleton
from internationalization import Internationalization
from internationalization.loaders import YAMLLoader
i18n = Internationalization()
i18n.initialize(YAMLLoader("yourdirectory"))
It's ready to use in any place
from internationalization import Internationalization
i18n = Internationalization()
english = i18n.get_language("en")
italian = i18n.get_language("it")
print("English:", english.hello_world)
print("Italian:", italian.hello_world)
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
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 internationalization_py-0.1.4.tar.gz.
File metadata
- Download URL: internationalization_py-0.1.4.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.1 CPython/3.11.1 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8533e89c72c21e87f03c8184b289971b2bc8321f0caa7c77b9c02c97b8a67058
|
|
| MD5 |
7b3348e1f095cb8178d81f0821b07a60
|
|
| BLAKE2b-256 |
2c680478354ca468c5c7b1bb1709085ef875499aa8b53df9b79ac6bf9511f0ce
|
File details
Details for the file internationalization_py-0.1.4-py3-none-any.whl.
File metadata
- Download URL: internationalization_py-0.1.4-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.1 CPython/3.11.1 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec5f594c29fb1e3bec8d1233aa0537864d1cd2c5c5b46a2b8720fa857908b944
|
|
| MD5 |
4afebeeca9ff9b9612c782ecfebc7fc8
|
|
| BLAKE2b-256 |
624fa0befce318af217f325f8c9d0eadff8b606bcc336b83456993ef4a337439
|