Update wxGetTranslation() documentation.

Document "i18n" trace mask.

Correct warning about [not] using wxT().

See #16714.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78258 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2014-12-09 12:51:56 +00:00
parent 6efc50fafd
commit 2fe72022e3

View File

@ -508,22 +508,26 @@ public:
/** /**
This function returns the translation of @a string in the current This function returns the translation of @a string in the current
@c locale(). If the string is not found in any of the loaded message @c locale().
catalogs (see @ref overview_i18n), the original string is returned. In
debug build, an error message is logged -- this should help to find the If the string is not found in any of the loaded message catalogs (see @ref
strings which were not yet translated. If @a domain is specified then only overview_i18n), the original string is returned. If you enable logging of
that domain/catalog is searched for a matching string. As this function is trace messages with "i18n" mask (using wxLog::AddTraceMask()) and debug
used very often, an alternative (and also common in Unix world) syntax is logging is enabled (see @ref overview_debugging), a message is also logged
provided: the _() macro is defined to do the same thing as in this case -- which helps to find the strings which were not yet
wxGetTranslation(). translated.
If @a domain is specified then only that domain/catalog is searched for a
matching string. As this function is used very often, an alternative (and
also common in Unix world) syntax is provided: the _() macro is defined to
do the same thing as wxGetTranslation().
This function is thread-safe. This function is thread-safe.
@note This function is not suitable for literal strings in Unicode builds @note This function is not suitable for literal strings using wxT() macro
since the literal strings must be enclosed in wxT() macro which makes since this macro is not recognised by @c xgettext, and so such
them unrecognised by @c xgettext, and so they are not extracted to strings are not extracted to the message catalog. Instead, use the
the message catalog. Instead, use the _() and wxPLURAL() macro for _() and wxPLURAL() macro for all literal strings.
all literal strings.
@see wxGetTranslation(const wxString&, const wxString&, unsigned, const wxString&) @see wxGetTranslation(const wxString&, const wxString&, unsigned, const wxString&)