.. include:: headings.inc .. _TranslationsLoader: ========================================================================================================================================== |phoenix_title| **TranslationsLoader** ========================================================================================================================================== Abstraction of translations discovery and loading. This interface makes it possible to override wxWidgets' default catalogs loading mechanism and load ``MO`` files from locations other than the filesystem (e.g. embed them in executable). Implementations must implement the :meth:`~TranslationsLoader.LoadCatalog` method. .. versionadded:: 2.9.1 .. seealso:: :ref:`FileTranslationsLoader`, `ResourceTranslationsLoader` | |class_hierarchy| Inheritance Diagram ===================================== Inheritance diagram for class **TranslationsLoader** .. raw:: html

Inheritance diagram of TranslationsLoader

| |sub_classes| Known Subclasses ============================== :ref:`FileTranslationsLoader`, `ResourceTranslationsLoader` | |method_summary| Methods Summary ================================ ================================================================================ ================================================================================ :meth:`~TranslationsLoader.__init__` Trivial default constructor. :meth:`~TranslationsLoader.GetAvailableTranslations` Implements :meth:`Translations.GetAvailableTranslations` . :meth:`~TranslationsLoader.LoadCatalog` Called to load requested catalog. ================================================================================ ================================================================================ | |api| Class API =============== .. class:: TranslationsLoader(object) Abstraction of translations discovery and loading. **Possible constructors**:: TranslationsLoader() .. method:: __init__(self) Trivial default constructor. .. method:: GetAvailableTranslations(self, domain) Implements :meth:`Translations.GetAvailableTranslations` . :param `domain`: :type `domain`: string :rtype: `list of strings` .. method:: LoadCatalog(self, domain, lang) Called to load requested catalog. If the catalog is found, :meth:`LoadCatalog` should create `MsgCatalog` instance with its data and return it. The caller will take ownership of the catalog. :param `domain`: Domain to load. :type `domain`: string :param `lang`: Language to look for. This is "canonical name" (see :meth:`Locale.GetCanonicalName` ), i.e. ``ISO`` 639 code, possibly combined with country code or additional modifiers (e.g. "fr", "en_GB" or "ca@valencia"). :type `lang`: string :rtype: `MsgCatalog` :returns: Loaded catalog or ``None`` on failure.