X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7b36d72062f36cf09aef8979db3f00946127bcc8..81a4f8460c30608c44346322700c534c5bca4f13:/include/wx/intl.h diff --git a/include/wx/intl.h b/include/wx/intl.h index d7fb1637ee..aec71543fb 100644 --- a/include/wx/intl.h +++ b/include/wx/intl.h @@ -19,6 +19,8 @@ #include "wx/defs.h" #include "wx/string.h" +#if wxUSE_INTL + // ============================================================================ // global decls // ============================================================================ @@ -30,9 +32,13 @@ // gettext() style macro (notice that xgettext should be invoked with "-k_" // option to extract the strings inside _() from the sources) #ifndef WXINTL_NO_GETTEXT_MACRO - #define _(str) wxGetTranslation(_T(str)) + #define _(str) wxGetTranslation(wxT(str)) #endif +// another one which just marks the strings for extraction, but doesn't +// perform the translation (use -kwxTRANSLATE with xgettext!) +#define wxTRANSLATE(str) wxT(str) + // ---------------------------------------------------------------------------- // forward decls // ---------------------------------------------------------------------------- @@ -131,8 +137,21 @@ extern WXDLLEXPORT wxLocale* wxGetLocale(); inline const wxMB2WXbuf wxGetTranslation(const wxChar *sz) { wxLocale *pLoc = wxGetLocale(); - return pLoc ? pLoc->GetString(sz) : (const wxMB2WXbuf)sz; + if (pLoc) + return pLoc->GetString(sz); + else + return (const wxMB2WXbuf)sz; } +#else // !wxUSE_INTL + +#ifndef WXINTL_NO_GETTEXT_MACRO + #define _(str) (str) +#endif + +inline const wxChar *wxGetTranslation(const wxChar *sz) { return sz; } + +#endif // wxUSE_INTL/!wxUSE_INTL + #endif // _WX_INTLH__