Code::Blocks

Developer forums (C::B DEVELOPMENT STRICTLY!) => Contributions to C::B => Topic started by: gd_on on July 31, 2019, 05:00:22 pm

Title: Errors in C::B that affect translations
Post by: gd_on on July 31, 2019, 05:00:22 pm
These problems have been discovered by Swen Kupke when triing to adapt the german translation of C::B. May be present already since a long time, but I have not remarked them before.

Translating "&Edit" put some menu items at the wrong place, at the end of the "File" menu.
The problem comes from ccmanager.cpp, line 303 : should be _("&Edit") not wxT("&Edit")                => misplaced Show tooltips, Next call tip, Previous call tip in other languages than original English.

Translating "R&ecent file" put also some menu items at the wrong place.
The problem apparently comes from projectsimporter.cpp, line 73 : should be _("R&ecent files") not _T("R&ecent files") : wrong menuId result.

Strings Open... and &Open.... There is a potential problem with the test in line 140 in HexEditor.cpp : if ( label.Contains( _("Open...")) )
If in a translation file, the & is not in front of the 1rst letter, it will not work. For example in French, &Ouvrir... and Ouvrir... will be OK, but  &Ouvrir... and O&uvrir... won't ( for example because the translator has already used the O in another place and choosen to place the _ under the u (for Alt usage)).
More subtle with this same string : The current german file for "&Open..." contains "Öffnen…" and for "Open..." contains "Öffnen...". There is no &, but the problem is not here : it's the difference between "…" (1 character) and "..." (3 characters) which cause the problem in the test at line 140 in HexEditor.cpp. Here, correcting the translation file is sufficient, but may be the test could be less content dependent. Not obvious with this & character ! And there are other menu strings containing "Open..." !

Also in HexEditor.cpp, not an error but could be better, the string "Open With Hex Editor" appears 3 times but with 2 different cases (lines 111, 142 and 144) which needs 2 different translations strings. Only one could be better.

gd_on


Title: Re: Errors in C::B that affect translations
Post by: oBFusCATed on July 31, 2019, 06:36:51 pm
Post a patch please. I don't have time to turn your description into a patch and commit it.
Also I don't have any available translations to test the changes.
Title: Re: Errors in C::B that affect translations
Post by: gd_on on July 31, 2019, 07:34:32 pm
Here are a patch, for 3 cpp files.
In HexEditor, the problem with Open... and &Open... is not treated : need more reflexion.

gd_on
Title: Re: Errors in C::B that affect translations
Post by: gd_on on August 01, 2019, 11:16:22 am
Code: [Select]
Also I don't have any available translations to test the changes.
You'll find all you need for testing inside http://forums.codeblocks.org/index.php/topic,1022.msg159075.html#msg159075
and more precisely in https://translations.launchpad.net/codeblocks-gd

gd_on
Title: Re: Errors in C::B that affect translations
Post by: oBFusCATed on August 02, 2019, 04:04:48 pm
In svn. If you have other fixes it is best to post patches.