spyder.api.translations
The gettext-based translation and internationalization (i18n) API for Spyder.
-
spyder.api.translations.get_translation(modname: str, dirname: str | None = None) → Callable[[str], str][source]
Return the translation callback for module modname.
- Parameters:
modname (str) – The module to get the translation callback for.
dirname (str | None, optional) – The directory name of the module, same as the module name by default.
- Returns:
The gettext translation callback for the given module.
- Return type:
Callable[[str], str]
-
spyder.api.translations._(x: str) → str
Translate a text string to the current language for a module.
- Parameters:
x (str) – The string to translate.
- Returns:
The translated string.
- Return type:
str