libbot.i18n.classes package¶
Submodules¶
libbot.i18n.classes.bot_locale module¶
- class libbot.i18n.classes.bot_locale.BotLocale(default_locale: str | None = 'en', locales_root: str | Path = PosixPath('locale'))[source]¶
Bases:
object
Small addon that can be used by bot clients’ classes in order to minimize I/O
- in_all_locales(key: str, *args: str) List[Any] [source]¶
Get value of the provided key and path in all available locales.
- Parameters:
key (str) – The last key of the locale’s keys path
*args (str) – Path to key like: dict[args][key]
- Returns:
List of values in all locales
- Return type:
List[Any]
- in_every_locale(key: str, *args: str) Dict[str, Any] [source]¶
Get value of the provided key and path in every available locale with locale tag.
- Parameters:
key (str) – The last key of the locale’s keys path
*args (str) – Path to key like: dict[args][key]
- Returns:
Locale is a key, and it’s value from locale file is a value
- Return type:
Dict[str, Any]