Rename context-specific translation macros and document them
Try to use more clear names for the macros and also try to make the sample more self-explanatory.
This commit is contained in:
@@ -454,6 +454,28 @@ public:
|
||||
*/
|
||||
#define wxPLURAL(string, plural, n)
|
||||
|
||||
/**
|
||||
Similar to _() but translates the string in the given context.
|
||||
|
||||
See the description of @c context argument of wxGetTranslation().
|
||||
|
||||
@see wxGETTEXT_IN_CONTEXT_PLURAL()
|
||||
|
||||
@since 3.1.1
|
||||
*/
|
||||
#define wxGETTEXT_IN_CONTEXT(context, string)
|
||||
|
||||
/**
|
||||
Similar to wxPLURAL() but translates the string in the given context.
|
||||
|
||||
See the description of @c context argument of wxGetTranslation().
|
||||
|
||||
@see wxGETTEXT_IN_CONTEXT()
|
||||
|
||||
@since 3.1.1
|
||||
*/
|
||||
#define wxGETTEXT_IN_CONTEXT_PLURAL(context, string, plural, n)
|
||||
|
||||
/**
|
||||
This macro doesn't do anything in the program code -- it simply expands to
|
||||
the value of its argument.
|
||||
@@ -515,6 +537,16 @@ public:
|
||||
also common in Unix world) syntax is provided: the _() macro is defined to
|
||||
do the same thing as wxGetTranslation().
|
||||
|
||||
If @a context is not empty (notice that this argument is only available
|
||||
starting from wxWidgets 3.1.1), item translation is looked up in the
|
||||
specified context. This allows to have different translations for the same
|
||||
string appearing in different contexts, e.g. it may be necessary to
|
||||
translate the same English "Open" verb differently depending on the object
|
||||
it applies to. To do this, you need to use @c msgctxt in the source message
|
||||
catalog and specify different contexts for the different occurrences of the
|
||||
string and then use the same contexts in the calls to this function (or
|
||||
wxGETTEXT_IN_CONTEXT() or wxGETTEXT_IN_CONTEXT_PLURAL() macros).
|
||||
|
||||
This function is thread-safe.
|
||||
|
||||
@note This function is not suitable for literal strings using wxT() macro
|
||||
@@ -527,7 +559,8 @@ public:
|
||||
@header{wx/intl.h}
|
||||
*/
|
||||
const wxString& wxGetTranslation(const wxString& string,
|
||||
const wxString& domain = wxEmptyString);
|
||||
const wxString& domain = wxEmptyString,
|
||||
const wxString& context = wxEmptyString);
|
||||
|
||||
/**
|
||||
This is an overloaded version of
|
||||
@@ -553,7 +586,8 @@ const wxString& wxGetTranslation(const wxString& string,
|
||||
*/
|
||||
const wxString& wxGetTranslation(const wxString& string,
|
||||
const wxString& plural, unsigned n,
|
||||
const wxString& domain = wxEmptyString);
|
||||
const wxString& domain = wxEmptyString,
|
||||
const wxString& context = wxEmptyString);
|
||||
|
||||
/**
|
||||
Macro to be used around all literal strings that should be translated.
|
||||
|
Reference in New Issue
Block a user