The simple library for i18n support.
Project description
i21y
i21y (a.k.a internationalization.py) is library for support i18n in Python. It is easy to use.
Features:
- Zero dependencies by default
- Simple design
- Tools to Simplify Keys
Installation
Normal: pip install i21y
YAML support: pip install i21y[yaml]
Fast JSON (by orjson) support: pip install i21y[fast-json]
Example
Basic
from i21y import Translator
from i21y.loaders.json import Loader
t = Translator(Loader("locale"))
assert t("main.responses.not_found", locale="ja") == "見つからなかった。"
Advanced
from i21y import locale_str
LONG_KEY = locale_str("very.long.locale.key.yeah_so_long")
print(LONG_KEY.but_easy_to_use) # very.long.locale.key.yeah_so_long.but_easy_to_use
assert t(LONG_KEY.but_easy_to_use, locale="ja") == "とても長いキーでも簡単に使える。"
Documentation
See the documentation for usage and details.
License
i21y is licensed under the MIT license.
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
i21y-0.2.0.tar.gz
(10.9 kB
view hashes)
Built Distribution
i21y-0.2.0-py3-none-any.whl
(11.4 kB
view hashes)