diff --git a/include/wx/translation.h b/include/wx/translation.h index f877ed0a83..044b461f5a 100644 --- a/include/wx/translation.h +++ b/include/wx/translation.h @@ -61,6 +61,11 @@ // perform the translation (use -kwxTRANSLATE with xgettext!) #define wxTRANSLATE(str) str +// another one which just marks the strings, with a context, for extraction, +// but doesn't perform the translation (use -kwxTRANSLATE_IN_CONTEXT:1c,2 with +// xgettext!) +#define wxTRANSLATE_IN_CONTEXT(c, str) str + // ---------------------------------------------------------------------------- // forward decls // ---------------------------------------------------------------------------- @@ -345,6 +350,7 @@ inline const wxString& wxGetTranslation(const char *str1, #endif #define wxTRANSLATE(str) str +#define wxTRANSLATE_IN_CONTEXT(c, str) str // NB: we use a template here in order to avoid using // wxLocale::GetUntranslatedString() above, which would be required if diff --git a/interface/wx/translation.h b/interface/wx/translation.h index 88236d8eb4..1f325c4b73 100644 --- a/interface/wx/translation.h +++ b/interface/wx/translation.h @@ -521,6 +521,18 @@ public: */ #define wxTRANSLATE(string) +/** + This macro doesn't do anything in the program code -- it simply expands to + the value of its argument. + + Similar to wxTRANSLATE(), but with a context argument. Both the context and + string need to be string literals. Be sure to use the same context when + calling wxGetTranslation(). + + @since 3.1.7 +*/ +#define wxTRANSLATE_IN_CONTEXT(context, string) + /** This function returns the translation of @a string in the current @c locale(). diff --git a/locale/Makefile b/locale/Makefile index 12c96b63c9..d09f21fd30 100644 --- a/locale/Makefile +++ b/locale/Makefile @@ -16,7 +16,7 @@ XGETTEXT=xgettext XARGS=xargs # common xgettext args: C++ syntax, use the specified macro names as markers -XGETTEXT_ARGS=-C -k_ -kwxPLURAL:1,2 -kwxGETTEXT_IN_CONTEXT:1c,2 -kwxGETTEXT_IN_CONTEXT_PLURAL:1c,2,3 -kwxTRANSLATE -kwxGetTranslation --add-comments=TRANSLATORS: -j +XGETTEXT_ARGS=-C -k_ -kwxPLURAL:1,2 -kwxGETTEXT_IN_CONTEXT:1c,2 -kwxGETTEXT_IN_CONTEXT_PLURAL:1c,2,3 -kwxTRANSLATE -kwxTRANSLATE_IN_CONTEXT:1c,2 -kwxGetTranslation --add-comments=TRANSLATORS: -j # implicit rules %.mo: %.po