Also accept wide string literals as translation macro arguments (PR #25063)

32 views
Skip to first unread message

Lauri Nurmi

unread,
Jan 10, 2025, 11:57:39 AM1/10/25
to wx-...@googlegroups.com, Subscribed

Not accepting them was an undeliberate regression introduced in PR #24957. There weren't any such calls in wx's own tests or samples, so now adding some to the internat sample to prevent a similar regression in the future.

Pointed out by @tobiolo.


You can view, comment on, or merge this pull request online at:

  https://github.com/wxWidgets/wxWidgets/pull/25063

Commit Summary

  • 9fa1a4d Also accept wide string literals as translation macro arguments

File Changes

(2 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25063@github.com>

VZ

unread,
Jan 11, 2025, 9:59:02 AM1/11/25
to wx-...@googlegroups.com, Subscribed

@vadz commented on this pull request.


In samples/internat/internat.cpp:

> @@ -320,6 +320,12 @@ MyFrame::MyFrame()
     macro_menu->Append(INTERNAT_MACRO_8, wxGETTEXT_IN_CONTEXT_PLURAL("context_2", "sing", "plur", 1));
     macro_menu->Append(INTERNAT_MACRO_9, wxGETTEXT_IN_CONTEXT_PLURAL("context_2", "sing", "plur", 2));
 
+    // Also wide strings can be used:

Shouldn't this rather go into tests/allheaders.cpp as the other checks you added there?

Or, perhaps, move all of these checks to tests/intl/intltest.cpp?


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25063/review/2544858373@github.com>

Lauri Nurmi

unread,
Jan 11, 2025, 2:14:38 PM1/11/25
to wx-...@googlegroups.com, Subscribed

@lanurmi commented on this pull request.


In samples/internat/internat.cpp:

> @@ -320,6 +320,12 @@ MyFrame::MyFrame()
     macro_menu->Append(INTERNAT_MACRO_8, wxGETTEXT_IN_CONTEXT_PLURAL("context_2", "sing", "plur", 1));
     macro_menu->Append(INTERNAT_MACRO_9, wxGETTEXT_IN_CONTEXT_PLURAL("context_2", "sing", "plur", 2));
 
+    // Also wide strings can be used:

Shouldn't this rather go into tests/allheaders.cpp as the other checks you added there?

allheaders.cpp is special, because it defines wxNO_IMPLICIT_WXSTRING_ENCODING, and therefore doesn't test the regular use case. I also hypothesized that wide strings are inherently incompatible with wxASCII_STR, which the wrappers call in that case, but didn't test what actually happens.

Or, perhaps, move all of these checks to tests/intl/intltest.cpp?

Yes, the new ones I added to the sample can be moved.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25063/review/2545133995@github.com>

Lauri Nurmi

unread,
Jan 11, 2025, 2:15:19 PM1/11/25
to wx-...@googlegroups.com, Push

@lanurmi pushed 1 commit.

  • e9ae3e6 fixup! Also accept wide string literals as translation macro arguments


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25063/before/9fa1a4dacb8748ffe75ec9ed2754f9f207b3e124/after/e9ae3e67782968c1065e42a588011a55277b9601@github.com>

VZ

unread,
Jan 11, 2025, 4:59:09 PM1/11/25
to wx-...@googlegroups.com, Push

@vadz pushed 1 commit.

  • e3d210d fixup! Implement wxTextCtrl::SearchText() in wxQt


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25063/before/e9ae3e67782968c1065e42a588011a55277b9601/after/e3d210d87ff87bc56ebb81419cde614bfc995c2c@github.com>

VZ

unread,
Jan 11, 2025, 5:16:01 PM1/11/25
to wx-...@googlegroups.com, Push

@vadz pushed 1 commit.

  • 723b359 fixup! Also accept wide string literals as translation macro arguments


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25063/before/e3d210d87ff87bc56ebb81419cde614bfc995c2c/after/723b359eecb2c8aa3c2b7e66a819bb0c8feff1ed@github.com>

VZ

unread,
Jan 11, 2025, 5:16:58 PM1/11/25
to wx-...@googlegroups.com, Subscribed

@vadz commented on this pull request.


In samples/internat/internat.cpp:

> @@ -320,6 +320,12 @@ MyFrame::MyFrame()
     macro_menu->Append(INTERNAT_MACRO_8, wxGETTEXT_IN_CONTEXT_PLURAL("context_2", "sing", "plur", 1));
     macro_menu->Append(INTERNAT_MACRO_9, wxGETTEXT_IN_CONTEXT_PLURAL("context_2", "sing", "plur", 2));
 
+    // Also wide strings can be used:

So actually it's important to have these tests in allheaders.cpp too because this should compile with wxNO_IMPLICIT_WXSTRING_ENCODING as well, isn't it?


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25063/review/2545299700@github.com>

Lauri Nurmi

unread,
Jan 12, 2025, 6:31:23 PM1/12/25
to wx-...@googlegroups.com, Subscribed

@lanurmi commented on this pull request.


In samples/internat/internat.cpp:

> @@ -320,6 +320,12 @@ MyFrame::MyFrame()
     macro_menu->Append(INTERNAT_MACRO_8, wxGETTEXT_IN_CONTEXT_PLURAL("context_2", "sing", "plur", 1));
     macro_menu->Append(INTERNAT_MACRO_9, wxGETTEXT_IN_CONTEXT_PLURAL("context_2", "sing", "plur", 2));
 
+    // Also wide strings can be used:

When you put it that way, yes. I suppose this PR is complete now, after your latest changes.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25063/review/2545553411@github.com>

VZ

unread,
Jan 13, 2025, 4:18:12 PM1/13/25
to wx-...@googlegroups.com, Subscribed

Closed #25063 via 5d8ea50.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25063/issue_event/15913026309@github.com>

Reply all
Reply to author
Forward
0 new messages