observable_translation
Module¶
Observable Translations for kivy that change when the language changes.
The functionality of this module is highly inspired by kivy-gettext-example <https://github.com/tito/kivy-gettext-example>.
-
class
kniteditor.localization.observable_translation.
ObservableTranslation
(translate)[source]¶ Bases:
kivy._event.Observable
This class allows kivy translations to be updated with the language.
-
__call__
(text)[source]¶ Call this object to translate text.
Parameters: text¶ (str) – the text to translate Returns: the text translated to the current language
-
__init__
(translate)[source]¶ Create a new translation object with a translation function.
Parameters: translate¶ – a callable that translates the text. Even when the language is changed, it returns the text for the currrent language.
-
__weakref__
¶ list of weak references to the object (if defined)
-