Fix wxGETTEXT_IN_CONTEXT* with wxNO_IMPLICIT_WXSTRING_ENCODING

The call to wxGetTranslation() was ambiguous. Fix this by adding missing
wxASCII_STR() for all string literal arguments in wxGETTEXT_IN_CONTEXT
and wxGETTEXT_IN_CONTEXT_PLURAL, just as it is used in _().

Also test that all translation macros expand to compilable code
when wxNO_IMPLICIT_WXSTRING_ENCODING is enabled.

See #1312 and also #24916.

Closes #24925.
This commit is contained in:
Lauri Nurmi
2024-11-01 16:35:06 +01:00
committed by Vadim Zeitlin
parent 6bcbcf9d09
commit a47b560fd4
2 changed files with 10 additions and 2 deletions
+8
View File
@@ -413,4 +413,12 @@ TEST_CASE("wxNO_IMPLICIT_WXSTRING_ENCODING", "[string]")
#endif
wxLogSysError(wxASCII_STR("Bogus error for testing"));
// Check that all translation macros expand to compilable
// code also when wxNO_IMPLICIT_WXSTRING_ENCODING is enabled.
_("some text");
wxPLURAL("singular", "plural", 2);
wxGETTEXT_IN_CONTEXT("context", "text");
wxGETTEXT_IN_CONTEXT_PLURAL("context", "singular", "plural", 3);
}