isomer.misc package

Miscellaneous utility functions for Isomer

class Domain(domain)[source]

Bases: object

Gettext domain capable of translating into all registered languages

__init__(domain)[source]

Initialize self. See help(type(self)) for accurate signature.

get(lang, msg)[source]

Return a message translated to a specified language

all_languages()[source]

Compile a list of all available language translations

i18n(msg, event=None, lang='en', domain='backend')[source]

Gettext function wrapper to return a message in a specified language by domain

To use internationalization (i18n) on your messages, import it as ‘_’ and use as usual. Do not forget to supply the client’s language setting.

l10n_log(*args, **kwargs)[source]

Log as L10N emitter

language_token_to_name(languages)[source]

Get a descriptive title for all languages

nested_map_find(d, keys)[source]

Looks up a nested dictionary by traversing a list of keys

nested_map_update(d, u, *keys)[source]

Modifies a nested dictionary by traversing a list of keys

print_messages(domain, msg)[source]

Debugging function to print all message language variants

sorted_alphanumerical(l, reverse=False)[source]

Sort the given iterable in the way that humans expect.