.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2017 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc



.. _wx.TranslationsLoader:

==========================================================================================================================================
|phoenix_title|  **wx.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:`~wx.TranslationsLoader.LoadCatalog`  method. 

         



.. versionadded:: 2.9.1 
     







.. seealso:: :ref:`wx.FileTranslationsLoader`, :ref:`ResourceTranslationsLoader`  







|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>TranslationsLoader</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.TranslationsLoader_inheritance.png" alt="Inheritance diagram of TranslationsLoader" usemap="#dummy" class="inheritance"/></center>
   </div>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.TranslationsLoader.html" title="wx.TranslationsLoader" alt="" coords="5,5,165,35"/> </map> 
   </p>

|


|sub_classes| Known Subclasses
==============================

:ref:`wx.FileTranslationsLoader`, :ref:`ResourceTranslationsLoader`

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.TranslationsLoader.__init__`                                          Trivial default constructor.
:meth:`~wx.TranslationsLoader.GetAvailableTranslations`                          Implements :meth:`wx.Translations.GetAvailableTranslations` .
:meth:`~wx.TranslationsLoader.LoadCatalog`                                       Called to load requested catalog.
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: wx.TranslationsLoader(object)

   **Possible constructors**::

       TranslationsLoader()
       
   
   Abstraction of translations discovery and loading.



   .. method:: __init__(self)

      Trivial default constructor.                   





   .. method:: GetAvailableTranslations(self, domain)

      Implements :meth:`wx.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 :ref:`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:`wx.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: :ref:`MsgCatalog`



                  



      :returns: 

         Loaded catalog or ``None`` on failure.   







