Skip to content

Commit

Permalink
Fix non-ASCII msgids with wxGETTEXT_IN_CONTEXT_PLURAL
Browse files Browse the repository at this point in the history
The compilation fix in PR wxWidgets#24925 aimed for the
wxNO_IMPLICIT_WXSTRING_ENCODING case presumably also has the
side effect of preventing non-ASCII (non-English) msgids with
wxGETTEXT_IN_CONTEXT_PLURAL, also in the regular case when
implicit encoding is permitted.

It is best to define wxGETTEXT_IN_CONTEXT_PLURAL separately for
both wxNO_IMPLICIT_WXSTRING_ENCODING and without it, similarly
to how wxGETTEXT_IN_CONTEXT is defined. For some reason it
was defined only once until now.
  • Loading branch information
Lauri Nurmi committed Nov 7, 2024
1 parent b21642b commit 3e95977
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion include/wx/translation.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,14 @@ using wxTranslationsHashMap = std::unordered_map<wxString, wxString>;
#ifndef wxNO_IMPLICIT_WXSTRING_ENCODING
#define wxGETTEXT_IN_CONTEXT(c, s) \
wxGetTranslation((s), wxString(), c)
#define wxGETTEXT_IN_CONTEXT_PLURAL(c, sing, plur, n) \
wxGetTranslation((sing), (plur), n, wxString(), c)
#else
#define wxGETTEXT_IN_CONTEXT(c, s) \
wxGetTranslation(wxASCII_STR(s), wxString(), wxASCII_STR(c))
#endif
#define wxGETTEXT_IN_CONTEXT_PLURAL(c, sing, plur, n) \
wxGetTranslation(wxASCII_STR(sing), wxASCII_STR(plur), n, wxString(), wxASCII_STR(c))
#endif

// another one which just marks the strings for extraction, but doesn't
// perform the translation (use -kwxTRANSLATE with xgettext!)
Expand Down

0 comments on commit 3e95977

Please sign in to comment.