A simple localization package
Project description
Simple localization package for Python
Setup:
-
Create a localization folder wherever you want in your project.
-
Add localization files inside. This package use
.jsonfiles.Example:
(localization/en_EN.json)
{ "GREETINGS": "Hello !", "GOODBYE": "Goodbye !" }
(localization/fr_FR.json)
{ "GREETINGS": "Bonjour !", "GOODBYE": "Au revoir !" }
Usage
from simple_localization import LocalizationManager
localization = LocalizationManager('../localization', 'en_EN')
It's as simple as that !
>>> localization['GREETINGS']
Hello !
You can change the language of an already existing LocalizationManager object using change_language:
>>> localization['GREETINGS']
Hello !
>>> localization.change_language("fr_FR")
>>> localization['GREETINGS']
Bonjour !
Links
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
simple-localization-1.0.2.tar.gz
(15.0 kB
view details)
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 simple-localization-1.0.2.tar.gz.
File metadata
- Download URL: simple-localization-1.0.2.tar.gz
- Upload date:
- Size: 15.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38de941fb08457da4cad63835e830e6c574cc57f810c87be40b19140d4485d80
|
|
| MD5 |
94cb5a402f5b17f979c200b0bccebb3a
|
|
| BLAKE2b-256 |
6f9477f8108d6fc2b148572dcad572725ac02b3be07610803793032845064413
|
File details
Details for the file simple_localization-1.0.2-py3-none-any.whl.
File metadata
- Download URL: simple_localization-1.0.2-py3-none-any.whl
- Upload date:
- Size: 15.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56b85c99f7a71c6fc0cdc2639903059fee12ac8702708837529ed44136fe63d3
|
|
| MD5 |
a0e3cbf502214f964df29407d47d0323
|
|
| BLAKE2b-256 |
b14f582968be0a61a1de90b03e781f747fbe9dd2714af05945a3dd48f144e6ef
|