Skip to content

TranslateMixin

Sub classes

Name Children Inherits
TranslatableHeaderMixin
cutepandas.utils.i18n
Item model mixin: horizontal header labels from `HEADER`, translated.
ColumnProfileWidget
cutepandas.pandaswidgets.columnprofilewidget
Basic statistics and the most frequent values of one column of any frame.
    DataFrameWidget
    cutepandas.pandaswidgets.dataframewidget
    Viewer plus docks: index levels, columns, categories, column profile, attrs.

      🛈 DocStrings

      Keeps an optional translate callable; _tr(text) applies it.

      Classes using it implement retranslate() to re-show their labels.

      Source code in src/cutepandas/utils/i18n.py
      class TranslateMixin:
          """Keeps an optional `translate` callable; `_tr(text)` applies it.
      
          Classes using it implement `retranslate()` to re-show their labels.
          """
      
          _translate: Translate | None = None
      
          def _tr(self, text: str) -> str:
              return text if self._translate is None else self._translate(text)
      
          def set_translate(self, translate: Translate | None):
              """Use another translate callable (None: English) and re-show the labels."""
              self._translate = translate
              self.retranslate()
      
          def get_translate(self) -> Translate | None:
              return self._translate
      
          def retranslate(self):
              """Re-show the labels (after the translate callable changed its language)."""
      

      retranslate

      retranslate()
      

      Re-show the labels (after the translate callable changed its language).

      Source code in src/cutepandas/utils/i18n.py
      def retranslate(self):
          """Re-show the labels (after the translate callable changed its language)."""
      

      set_translate

      set_translate(translate: Translate | None)
      

      Use another translate callable (None: English) and re-show the labels.

      Source code in src/cutepandas/utils/i18n.py
      def set_translate(self, translate: Translate | None):
          """Use another translate callable (None: English) and re-show the labels."""
          self._translate = translate
          self.retranslate()
      

      :fa-brands-github: Show source on GitHub