Skip to content
This repository has been archived by the owner on Jun 9, 2021. It is now read-only.

ZiRO-Bot/zi-i18n

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Releases

No releases published

Packages

No packages published

Languages