Use wxASCII_STR() on string literals

Fix the build with wxNO_IMPLICIT_WXSTRING_ENCODING.
This commit is contained in:
Arrigo Marchiori
2019-10-22 12:34:29 +02:00
committed by Vadim Zeitlin
parent 65cbf40b7e
commit c86bcf962d
351 changed files with 965 additions and 950 deletions

View File

@@ -35,7 +35,11 @@
// --keyword="_" --keyword="wxPLURAL:1,2" options
// to extract the strings from the sources)
#ifndef WXINTL_NO_GETTEXT_MACRO
#ifndef wxNO_IMPLICIT_WXSTRING_ENCODING
#define _(s) wxGetTranslation((s))
#else
#define _(s) wxGetTranslation(wxASCII_STR(s))
#endif
#define wxPLURAL(sing, plur, n) wxGetTranslation((sing), (plur), n)
#endif
@@ -43,8 +47,13 @@
// them, you need to also add
// --keyword="wxGETTEXT_IN_CONTEXT:1c,2" --keyword="wxGETTEXT_IN_CONTEXT_PLURAL:1c,2,3"
// options to xgettext invocation.
#ifndef wxNO_IMPLICIT_WXSTRING_ENCODING
#define wxGETTEXT_IN_CONTEXT(c, s) \
wxGetTranslation((s), wxString(), c)
#else
#define wxGETTEXT_IN_CONTEXT(c, s) \
wxGetTranslation(wxASCII_STR(s), wxString(), c)
#endif
#define wxGETTEXT_IN_CONTEXT_PLURAL(c, sing, plur, n) \
wxGetTranslation((sing), (plur), n, wxString(), c)
@@ -143,7 +152,7 @@ public:
// find best translation language for given domain
wxString GetBestTranslation(const wxString& domain, wxLanguage msgIdLanguage);
wxString GetBestTranslation(const wxString& domain,
const wxString& msgIdLanguage = "en");
const wxString& msgIdLanguage = wxASCII_STR("en"));
// add standard wxWidgets catalog ("wxstd")
bool AddStdCatalog();
@@ -244,7 +253,7 @@ public:
protected:
// returns resource type to use for translations
virtual wxString GetResourceType() const { return "MOFILE"; }
virtual wxString GetResourceType() const { return wxASCII_STR("MOFILE"); }
// returns module to load resources from
virtual WXHINSTANCE GetModule() const { return NULL; }
@@ -297,7 +306,11 @@ inline const wxString& wxGetTranslation(const wxString& str1,
#if !defined(WXINTL_NO_GETTEXT_MACRO)
#if !defined(_)
#ifndef wxNO_IMPLICIT_WXSTRING_ENCODING
#define _(s) (s)
#else
#define _(s) wxASCII_STR(s)
#endif
#endif
#define wxPLURAL(sing, plur, n) ((n) == 1 ? (sing) : (plur))
#define wxGETTEXT_IN_CONTEXT(c, s) (s)