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 !
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.1.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.1.tar.gz.
File metadata
- Download URL: simple-localization-1.0.1.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 |
a610f90b6cacfbac9119ea377c19d8b4c87897084aa9cf2dd2ba0541460b4c89
|
|
| MD5 |
ee956c4469c162d1c2dc0ddda3a95a2a
|
|
| BLAKE2b-256 |
8f0e834af846409fffd639a96667a1a4f734cb09fc2219eb75d29e3618f53e1e
|
File details
Details for the file simple_localization-1.0.1-py3-none-any.whl.
File metadata
- Download URL: simple_localization-1.0.1-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 |
7e1c057885ea40eee01d1d2be7ff1681f433ae53ee9f5c4d885f0cb58e647b8b
|
|
| MD5 |
7073be23ce51882afd89828568740807
|
|
| BLAKE2b-256 |
543540b8011f9b1ff2724b7691d07c172d20b6b5fc92fe1aa50d1e44c85e5445
|