File tree Expand file tree Collapse file tree 3 files changed +18
-12
lines changed Expand file tree Collapse file tree 3 files changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -333,8 +333,18 @@ inline const wxString& wxGetTranslation(const char *str1,
333333 wxString (context, conv));
334334}
335335
336- #define wxTRANS_INPUT_STR (s ) wxASCII_STR(s)
337- #else
336+ // We can't construct wxString implicitly in this case, so use a helper.
337+ inline wxString wxTRANS_INPUT_STR (const char * s)
338+ {
339+ return wxString::FromAscii (s);
340+ }
341+
342+ inline wxString wxTRANS_INPUT_STR (const wchar_t * s)
343+ {
344+ return wxString (s);
345+ }
346+ #else // !wxNO_IMPLICIT_WXSTRING_ENCODING
347+ // We can rely on implicit conversion, so don't bother with the helper.
338348 #define wxTRANS_INPUT_STR (s ) s
339349#endif // wxNO_IMPLICIT_WXSTRING_ENCODING
340350
Original file line number Diff line number Diff line change @@ -421,4 +421,10 @@ TEST_CASE("wxNO_IMPLICIT_WXSTRING_ENCODING", "[string]")
421421 wxPLURAL (" singular" , " plural" , 2 );
422422 wxGETTEXT_IN_CONTEXT (" context" , " text" );
423423 wxGETTEXT_IN_CONTEXT_PLURAL (" context" , " singular" , " plural" , 3 );
424+
425+ // Also wide strings can be used:
426+ _ (L" item" );
427+ wxGETTEXT_IN_CONTEXT (L" context" , L" item" );
428+ wxPLURAL (L" sing" , L" plur" , 3 );
429+ wxGETTEXT_IN_CONTEXT_PLURAL (L" context" , L" sing" , L" plur" , 3 );
424430}
Original file line number Diff line number Diff line change @@ -796,14 +796,4 @@ TEST_CASE("wxUILocale::ShowSystem", "[.]")
796796 WARN (" Preferred UI languages:\n " << preferredLangsStr);
797797}
798798
799- // Not an actual test, but a way to ensure that wide string versions
800- // of translation macros are available and successfully compile.
801- static void EnsureWideStringVersionsOfMacrosExist () {
802- // Also wide strings can be used:
803- _ (L" item" );
804- wxGETTEXT_IN_CONTEXT (L" context" , L" item" );
805- wxPLURAL (L" sing" , L" plur" , 3 );
806- wxGETTEXT_IN_CONTEXT_PLURAL (L" context" , L" sing" , L" plur" , 3 );
807- }
808-
809799#endif // wxUSE_INTL
You can’t perform that action at this time.
0 commit comments