Skip to main content

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 hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page