Author Topic: Errors in C::B that affect translations  (Read 9007 times)

Offline gd_on

  • Lives here!
  • ****
  • Posts: 796
Errors in C::B that affect translations
« 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


« Last Edit: July 31, 2019, 05:49:06 pm by gd_on »
Windows 11 64 bits (23H2), svn C::B (last version or almost!), wxWidgets 3.2.4 (tests with 3.3), Msys2 Compilers 13.2.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Errors in C::B that affect translations
« Reply #1 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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline gd_on

  • Lives here!
  • ****
  • Posts: 796
Re: Errors in C::B that affect translations
« Reply #2 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
Windows 11 64 bits (23H2), svn C::B (last version or almost!), wxWidgets 3.2.4 (tests with 3.3), Msys2 Compilers 13.2.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).

Offline gd_on

  • Lives here!
  • ****
  • Posts: 796
Re: Errors in C::B that affect translations
« Reply #3 on: August 01, 2019, 11:16:22 am »
Code
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
Windows 11 64 bits (23H2), svn C::B (last version or almost!), wxWidgets 3.2.4 (tests with 3.3), Msys2 Compilers 13.2.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Errors in C::B that affect translations
« Reply #4 on: August 02, 2019, 04:04:48 pm »
In svn. If you have other fixes it is best to post patches.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]