Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: LETARTARE on November 25, 2022, 05:13:00 pm

Title: error translation in 'ccdebuginfo.cpp'
Post by: LETARTARE on November 25, 2022, 05:13:00 pm
In 'cb-13062\src\plugins\codecompletion\parser\ccdebuginfo.cpp:L202'

Code
txtFilter = new wxTextCtrl(Panel1, ID_TEXTCTRL1, _("*"), wxDefaultPosition, wxSize(401,21), 0, wxDefaultValidator, _T("ID_TEXTCTRL1"));

Who could change this code  ? :
Quote
_("*") => "*"
Title: Re: error translation in 'ccdebuginfo.cpp'
Post by: Miguel Gimenez on November 25, 2022, 05:27:06 pm
This line is generated automatically by wxSmith, we can remove the _() but it will be there again whenever the wxs is opened.

Making wxSmith smarter may be a solution: if the string is empty or it only contains symbols, numbers or whitespace do not surround it with _().
Title: Re: error translation in 'ccdebuginfo.cpp'
Post by: LETARTARE on November 25, 2022, 05:35:18 pm
@Miguel Gimenez
Thanks you.

I would wait for this improvement.
In the meantime I will try to filter this entry.
Title: Re: error translation in 'ccdebuginfo.cpp'
Post by: gd_on on November 25, 2022, 05:58:47 pm
There is another place where a single * is found: line 69 in \src\plugins\contrib\SpellChecker\wxspellchecker\tools\AspellDictionaryDownloader.cpp.
It can be corrected here.
Title: Re: error translation in 'ccdebuginfo.cpp'
Post by: Miguel Gimenez on November 25, 2022, 07:23:26 pm
That file is not part of any project. Anyway, I have removed _() from most strings (and added it to others) in r13069.
Title: Re: error translation in 'ccdebuginfo.cpp'
Post by: Miguel Gimenez on November 26, 2022, 10:04:38 am
r13070 removes _() in wxSmith-generated code if the string contains only non-alpha characters.
Title: Re: error translation in 'ccdebuginfo.cpp'
Post by: LETARTARE on November 26, 2022, 11:53:50 am
@Miguel Gimenez
The question has hardly been asked and the answer has arrived !!
I thank you for your permanent availability and your speed in solving problems.
I'm going back to the keyboard to test your solution with 'cb13071-wx321'
Title: Re: error translation in 'ccdebuginfo.cpp'
Post by: LETARTARE on November 26, 2022, 12:39:10 pm
How to regenerate the code of  "...\cb-13071\src\plugins\codecompletion\parser\ccdebuginfo.cpp" and "*.h" ?


Title: Re: error translation in 'ccdebuginfo.cpp'
Post by: Miguel Gimenez on November 26, 2022, 02:15:41 pm
If I understand correctly your question, open ccdenbuginfo.wxs from within C::B, change anything and revert the change. This will force rewriting of the cpp file.
Title: Re: error translation in 'ccdebuginfo.cpp'
Post by: LETARTARE on November 27, 2022, 04:52:44 pm
Yes, this is the procedure I followed, but without success !
In nightly builds 'cb-13074' the file 'ccdebuginfo.cpp' still has a '_("*")' in it

Essay with : Win-7, cb-13071, wx-321, gcc-810

I have analysed the modified code of 'wxscodinglang.cpp' and I propose the following modification
Quote
replace 'wxChar' by 'wxUniChar'  in line 196 :
Code
if (std::any_of(Source.begin(), Source.end(), [] (wxUniChar c) {return wxIsalpha(c);}))
This solved the problem in my configuration:
Code
 '_("*")' => _T("*")'
Good Sunday.
Title: Re: error translation in 'ccdebuginfo.cpp'
Post by: Miguel Gimenez on November 27, 2022, 05:41:39 pm
Strange, it worked here (wx3.2.1 32-bit). Fixed in r13077, thank you.
Title: Re: error translation in 'ccdebuginfo.cpp'
Post by: LETARTARE on November 27, 2022, 06:18:25 pm
I forgot: Win-7::64bits.
I would test tomorrow under Leap-15.4::64bits.