wxResourceTranslationsLoader Class Reference | wxWidgets

| Version: 3.2.11

Loading...
Searching...
No Matches
Protected Member Functions | List of all members
wxResourceTranslationsLoader Class Reference

`#include </cygdrive/c/Users/Hamis/Cygwin-packaging/wxWidgets3.2/wxWidgets3.2-3.2.11-1.x86_64/src/wxWidgets-3.2.11/interface/wx/translation.h>`

Inheritance diagram for wxResourceTranslationsLoader:
[legend]

## Detailed Description

This loader makes it possible to load translations from Windows resources.

If you wish to store translation MO files in resources, you have to enable this loader before calling wxTranslations::AddAvailableCatalog():

wxTranslations::Get()->SetLoader(new wxResourceTranslationsLoader);
wxResourceTranslationsLoader
This loader makes it possible to load translations from Windows resources.
Definition translation.h:449
wxTranslations::SetLoader
void SetLoader(wxTranslationsLoader *loader)
Changes loader use to read catalogs to a non-default one.
wxTranslations::Get
static wxTranslations * Get()
Returns current translations object, may return NULL.

Translations are stored in resources as compiled MO files, with type set to "MOFILE" (unless you override GetResourceType()) and name consisting of the domain, followed by underscore, followed by language identification. For example, the relevant part of .rc file would look like this:

myapp_de MOFILE "catalogs/de/myapp.mo"
myapp_fr MOFILE "catalogs/fr/myapp.mo"
myapp_en_GB MOFILE "catalogs/en_GB/myapp.mo"

This class is only available on Windows.

Since
  2.9.1

## Protected Member Functions
virtual wxString | GetResourceType () const
| Returns resource type to use for translations.
virtual WXHINSTANCE | GetModule () const
| Returns handle of the module to load resources from.

## Additional Inherited Members
Public Member Functions inherited from wxTranslationsLoader
| wxTranslationsLoader ()
| Trivial default constructor.
virtual wxMsgCatalog * | LoadCatalog (const wxString &domain, const wxString &lang)=0
| Called to load requested catalog.
virtual wxArrayString | GetAvailableTranslations (const wxString &domain) const =0
| Implements wxTranslations::GetAvailableTranslations().

## Member Function Documentation

## ◆ GetModule()

virtual WXHINSTANCE wxResourceTranslationsLoader::GetModule | ( |  | ) | const
| protectedvirtual

Returns handle of the module to load resources from.

By default, the main executable is used.

## ◆ GetResourceType()

virtual wxString wxResourceTranslationsLoader::GetResourceType | ( |  | ) | const
| protectedvirtual

Returns resource type to use for translations.

Default type is "MOFILE".