pysepal.i18n#

Message catalogues for pysepal applications.

A module binds its own directory of messages/<locale>/*.json and gets one lookup back. There is no global registration, so pysepal’s own strings and an application’s strings never collide.

from pathlib import Path from pysepal.i18n import catalog

messages = catalog(Path(__file__).parent)

Call messages.msg(...) for one message in the runtime scope’s locale, which current_locale() and set_locale() read and change.

Modules

binding

Bind a message directory, and resolve one message from it.

errors

The three ways a message lookup can fail.

flatten

Turn one nested message document into flat dotted keys.

formatting

Validate the named placeholders accepted in message templates.

loading

Read a messages/<locale>/*.json directory into immutable locale data.

locale_store

The locale as a Solara reactive, isolated by Solara's kernel context.

plurals

Cardinal plural categories from Babel's CLDR data.

problems

Compare translated messages with English identities and arguments.