Detailed Description

This class allows to get translations for strings.

In wxWidgets this class manages message catalogs which contain the translations of the strings used to the current language. Unlike wxLocale, it isn't bound to locale. It can be used either independently of, or in conjunction with wxLocale. In the latter case, you should initialize wxLocale (which creates wxTranslations instance) first; in the former, you need to create a wxTranslations object and Set() it manually.

Unlike wxLocale, wxTranslations' primary mean of identifying language is by its "canonical name", i.e. ISO 639 code, possibly combined with ISO 3166 country code and additional modifiers (examples include "fr", "en_GB" or "ca@valencia"; see wxLocale::GetCanonicalName() for more information). This allows apps using wxTranslations API to use even languages not recognized by the operating system or not listed in wxLanguage enum.

All loaded catalogs will be used for message lookup by GetString() for the current locale.

Bu default, i.e. if msgIdLanguage is not given, msgid strings are assumed to be in English and written only using 7-bit ASCII characters. If you have to deal with non-English strings or 8-bit characters in the source code, see the instructions in Writing Non-English Applications.

Parameters

domain

The catalog domain to add.

msgIdLanguage

Specifies the language of "msgid" strings in source code (i.e. arguments to GetString(), wxGetTranslation() and the _() macro). It is used if AddCatalog() cannot find any catalog for current language: if the language is same as source code language, then strings from source code are used instead.

Returns

true if catalog was successfully loaded, false otherwise (which might mean that the catalog is not found or that it isn't in the correct format).

Specifies the language of "msgid" strings in source code (i.e. arguments to GetString(), wxGetTranslation() and the _() macro). It is used if AddCatalog() cannot find any catalog for current language: if the language is same as source code language, then strings from source code are used instead.

msgIdCharset

Lets you specify the charset used for msgids in sources in case they use 8-bit characters (e.g. German or French strings).

Returns

true if catalog was successfully loaded, false otherwise (which might mean that the catalog is not found or that it isn't in the correct format).

The language is determined from the preferred UI language or languages list the user configured in the OS. Notice that this may or may not correspond to the default locale as obtained from wxLocale::GetSystemLanguage(); modern operation systems (Windows Vista+, OS X) have separate language and regional (= locale) settings.

Parameters

domain

The catalog domain to look for.

msgIdLanguage

Specifies the language of "msgid" strings in source code (i.e. arguments to GetString(), wxGetTranslation() and the _() macro).

The language is determined from the preferred UI language or languages list the user configured in the OS. Notice that this may or may not correspond to the default locale as obtained from wxLocale::GetSystemLanguage(); modern operation systems (Windows Vista+, OS X) have separate language and regional (= locale) settings.

Parameters

domain

The catalog domain to look for.

msgIdLanguage

Specifies the language of "msgid" strings in source code (i.e. arguments to GetString(), wxGetTranslation() and the _() macro).