News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

wxSmith issue about the generation of _T() or _()

Started by ollydbg, May 19, 2023, 05:23:38 AM

Previous topic - Next topic

ollydbg

I just found that by using the latest svn header version of code::blocks

Some generated code has changed from:

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


to

    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.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

ollydbg

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

So, only translate the text if is has some alphabetic chars. Nice feature!
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.