Code::Blocks Forums

User forums => Help => Topic started by: ollydbg on May 19, 2023, 05:23:38 am

Title: wxSmith issue about the generation of _T() or _()
Post by: ollydbg on May 19, 2023, 05:23:38 am
I just found that by using the latest svn header version of code::blocks

Some generated code has changed from:

Code
    ComboBoxBaudRate = new wxComboBox(ConfigPanel, ID_COMBOBOX1, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, 0, wxTE_PROCESS_ENTER, wxDefaultValidator, _T("ID_COMBOBOX1"));
    ComboBoxBaudRate->Append(_("110"));

to

Code
    ComboBoxBaudRate->Append(_T("110"));

I mean the _() is changed to _T().

Is that by design? Any ideas?

I think the choice option should be translated, so I think _() is the correct option.
Title: Re: wxSmith issue about the generation of _T() or _()
Post by: ollydbg on May 19, 2023, 07:25:40 am
OK, I think I have found the reason.

It is in this code:

- wxSmith: Do not add _() to strings without alphabetic chars. arnholm/codeblocks_sfmirror@60e1e7d (https://github.com/arnholm/codeblocks_sfmirror/commit/60e1e7d955b92be21e832df3074c0f8523e2e979)

So, only translate the text if is has some alphabetic chars. Nice feature!