A Experimental Internationalization System
Project description
zi-i18n
A Experimental Internationalization
example:
Translation
#in "example.py" file
from zi_i18n import I18n
i18n = I18n("locale", "en_US")
print(i18n.translate("example.text"))
#in "locale/en_US.zi.lang" file
<!example.text: "Test">
#output: Test
Pluralization
#in "example.py" file
from zi_i18n import I18n
i18n = I18n("locale", "en_US")
print(i18n.translate("example.plural", count=0))
print(i18n.translate("example.plural", count=1))
print(i18n.translate("example.plural", count=5))
#in "locale/en_US.zi.lang" file
<%example.plural: {"zero": "0", "one": "1", "many": ">= 2"}
#output:
# 0
# 1
# >= 2
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
zi-i18n-0.0.8.tar.gz
(3.9 kB
view details)
File details
Details for the file zi-i18n-0.0.8.tar.gz.
File metadata
- Download URL: zi-i18n-0.0.8.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56defe95da4fd40d853ef0383631d33a422af88337d6179cb442aac7418a9e56
|
|
| MD5 |
433b4fc2edb253980fbb9bcaf604997e
|
|
| BLAKE2b-256 |
aa76fba529a4427df4c51b299a4b0554a27aed5e7f20efe1d5067cf30ba6033b
|