wxCrafter generates some strings that are not translatable

Post here wxCrafter related issues / features / bugs
simo75
CodeLite Curious
Posts: 2
Joined: Thu Jan 22, 2015 6:53 pm
Genuine User: Yes
IDE Question: C++
Location: Italy
Contact:

wxCrafter generates some strings that are not translatable

Post by simo75 »

Hi everyone,
I was using wxFormBuilder for one of my old projects and I wanted to convert and import the gui into wxCrafter.
This was almost straightforward but I noticed that some text is missing from translation, in particular the code generated by wxCrafter for the classes wxFilePickerCtrl, wxFilePickerCtrl and wxRadioBox uses the wxT() macro instead of the translatable one _().

Here is an example of code generated by wxCrafter:

Code: Select all

m_filePicker1 = new wxFilePickerCtrl(this, wxID_ANY, wxEmptyString, wxT("Select a file"), wxT("*"), wxDefaultPosition, wxSize(-1,-1), wxFLP_DEFAULT_STYLE);

m_dirPicker1 = new wxDirPickerCtrl(this, wxID_ANY, wxEmptyString, wxT("Select a folder"), wxDefaultPosition, wxSize(-1,-1), wxDIRP_DEFAULT_STYLE);

wxArrayString m_radioBox21Arr;
m_radioBox21Arr.Add(wxT("First option"));
m_radioBox21Arr.Add(wxT("Second Option"));
m_radioBox21 = new wxRadioBox(this, wxID_ANY, _("My RadioBox"), wxDefaultPosition, wxSize(-1,-1), m_radioBox21Arr, 1, 0);
I think that the strings "Select a file" and "Select a folder" should be translatable so the options in radiobox "First option" and "Second Option". Those strings should be enclosed in the _() macro not inthe wxT() form.
Maybe there are other places where there is the same problem but I found these three classes so far.
DavidGH
CodeLite Plugin
Posts: 819
Joined: Wed Sep 03, 2008 7:26 pm
Contact:

Re: wxCrafter generates some strings that are not translatab

Post by DavidGH »

Hi,

You're right. In addition I found wxListBox and wxCheckListBox.

Thank you for reporting it. It should be fixed in the next wxCrafter release.

Regards,

David
simo75
CodeLite Curious
Posts: 2
Joined: Thu Jan 22, 2015 6:53 pm
Genuine User: Yes
IDE Question: C++
Location: Italy
Contact:

Re: wxCrafter generates some strings that are not translatab

Post by simo75 »

Thanks for your work.

Someone on this forum suggested to add an option to make the strings translatable or not (i.e. use _() macro or classic wxT() one). This is because gettext works the right way if use only english chracters but if you input text in a language that uses accented characters, umlauts and other special chars those chars are not rendered the right way in the final compiled program.
So, to not force someone that doesn't need multilanguage support to write the program in english and then translate all the strings in the language he needs, it would be a great addition to have a box to select whether you want the program to be translated or not.

Again, thanks a lot for your great work.
Simone
nezos
CodeLite Veteran
Posts: 59
Joined: Wed Dec 31, 2014 6:36 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: wxCrafter generates some strings that are not translatab

Post by nezos »

I've came up with the same problem in the wxStaticText control. Don't forget add this too to the list! My problem was with the greater or equal sign.

The check box would be a useful addition, cause if i add new controls and generate the code, i have to correct it with the _() macro.
User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: wxCrafter generates some strings that are not translatab

Post by eranif »

Can you give an example of the generated code? (just the relevant line)

Eran
Make sure you have read the HOW TO POST thread
nezos
CodeLite Veteran
Posts: 59
Joined: Wed Dec 31, 2014 6:36 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: wxCrafter generates some strings that are not translatab

Post by nezos »

Sorry i missed the reply.

Here is the code generated automatically from wxCrafter:

m_staticText30 = new wxStaticText(this, wxID_ANY, _("≤ Longitude ≤"), wxDefaultPosition, wxSize(-1,-1), 0);

Replacing _ with wxT works:

m_staticText30 = new wxStaticText(this, wxID_ANY, wxT("≤ Longitude ≤"), wxDefaultPosition, wxSize(-1,-1), 0);
Post Reply