ECOSYSTEM / I18N

Reference

Every public name of janelkit-i18n.

Ecosystem package janelkit-i18n Translation catalogs, plurals, locale-aware number, currency and date formats, and language switching at run time. pip install janelkit-i18n
I18N · PAGE 4 / 4~1 min read
Alpha / 0.2 — These pages document JanelKit 0.2 and its packages. Each series (0.1, 0.2…) may change the public API, always with migration notes: see Changes and migration. The website uses Svelte; the desktop examples use Python and JanelKit, not JavaScript.

Public names

Import them from janelkit_i18n.

NameDescription
tt(key, **params) translates key into the active language. Reactive in templates.
i18nLanguages and catalogs: load(folder), add(language, dict), set(language), reset(); language and rtl (from janelkit.locale), languages, default (the fallback language, "es"); formats number(x, decimals), currency(x, symbol), date(value, "short" | "long").
I18nThe type of i18n.
I18nErrorRaised for an invalid catalog or a language without a catalog.

Common mistakes

  • Do not import t or i18n from janelkit. Since 0.1.0 they come from janelkit_i18n.

English documentation based on the JanelKit source. For additional details, browse the source docs ↗.