Author Topic: Code::Blocks' translation  (Read 489697 times)

Offline gd_on

  • Lives here!
  • ****
  • Posts: 767
Re: Code::Blocks' translation
« Reply #240 on: January 16, 2022, 10:12:46 am »
OK. So it's an other problem.
I tried different things as :
  • using directly the .mo file downloaded from launchpad;
  • download the .po from launchpad, compiling it with poedit, and using the .mo produced (with and without renaming it)
  • using my own .mo file ...
everything work as expected.

I also tried to rename a .mo file in .po, just to see what happens. C::B logically appears in English : no assert message.

So, I can't reproduce your behaviour.

One idea : Are you sure you use a wxWidgets version compiled with the same compiler version as your Code::Blocks build ?

There is also an other thing which look strange for me :
at line 405 in menucmn.cpp (located in C:\wxWidgets-3.1.5\src\common for me), I have :
Code
wxMenuItemList::compatibility_iterator node = m_items.Item(pos);
which does not correspond exactly to your indicated code lines. For me it's inside wxMenuBase::DoInsert (not in wxMenuBase::Insert)
Assert lines are 403 or 406. So, may be we have not exactly the same wxWidgets 3.1.5 version !)

Note : it's in wxWidgets 3.1.6 (trunk version, beta) that I have a wxcheck at line 405, inside wxMenuBase::Insert ! But, I still don't use it in C::B.
« Last Edit: January 16, 2022, 10:20:03 am by gd_on »
Windows 10 64 bits (22H2), svn C::B (last version or almost!), wxWidgets 3.2.1, Msys2 Compilers 12.2.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).

Offline LETARTARE

  • Lives here!
  • ****
  • Posts: 500
  • L'ami de l'homme.The friend of man.
Re: Code::Blocks' translation
« Reply #241 on: January 16, 2022, 10:45:54 am »
Thanks, your test is valuable.
I had downloaded 'wx-315' sources on the 'WXWidgets' website and had compiled using 'gcc-810' without problem until this test.

I will check everything today...
CB-13071, plugins-sdk-2.23.0 : Collector-1.7.7, AddOnForQt-3.4.9
1-Win7 Business Pack1 64bits : wx-3.2.1, gcc-8.1.0,
2-OpenSuse::Leap-15.4-64bits : wx-3.2.1;gtk3, gcc-8.2.1,
=> !! The messages are translated by Deepl

Offline gd_on

  • Lives here!
  • ****
  • Posts: 767
Re: Code::Blocks' translation
« Reply #242 on: January 16, 2022, 12:22:22 pm »
Also tested with last killerbot version (today's one), of course with all his given dlls (compiler and wxwidgets). It works as expected.
« Last Edit: January 16, 2022, 12:34:39 pm by gd_on »
Windows 10 64 bits (22H2), svn C::B (last version or almost!), wxWidgets 3.2.1, Msys2 Compilers 12.2.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).

Offline LETARTARE

  • Lives here!
  • ****
  • Posts: 500
  • L'ami de l'homme.The friend of man.
Re: Code::Blocks' translation
« Reply #243 on: January 17, 2022, 04:37:27 pm »
Thanks for your tests.

In doubt I recompiled 'wx-315' and the size of the result was different from the old one, even though I used the same source and the same compiler and the same build script ??
With this recompiled version, no more problem with your translation files compiled by 'Poedit'.

Thanks for the translations.
CB-13071, plugins-sdk-2.23.0 : Collector-1.7.7, AddOnForQt-3.4.9
1-Win7 Business Pack1 64bits : wx-3.2.1, gcc-8.1.0,
2-OpenSuse::Leap-15.4-64bits : wx-3.2.1;gtk3, gcc-8.2.1,
=> !! The messages are translated by Deepl

Offline rechtsanwaltsteyer

  • Single posting newcomer
  • *
  • Posts: 6
Code::Blocks' translation to German language
« Reply #244 on: July 24, 2022, 04:36:44 pm »
If somebody needs translation files to German language, feel free to follow this link an download the needed files:
https://www.dropbox.com/sh/bjuy411x4vv7ehm/AABgOFckrY5MklvvdLSLIAmHa?dl=0 
Greatings
Georg Michael Steyer, Rechtsanwalt

Offline gd_on

  • Lives here!
  • ****
  • Posts: 767
Re: Code::Blocks' translation
« Reply #245 on: November 10, 2022, 09:48:36 am »
A new updated version of my translatable string extracting tool can be found here.
It is able to scan new translatable strings in plugin scripts.
The english template on Launchpad has also been updated (https://launchpad.net/codeblocks-gd) [appoved but not still imported in the data base]
However, for translators, many of the new strings are only partial sentences. As the word order in the recomposed full sentences may depend on the language, it is advisable not to translate them and to wait for a future rework on them.
« Last Edit: November 10, 2022, 10:27:55 am by gd_on »
Windows 10 64 bits (22H2), svn C::B (last version or almost!), wxWidgets 3.2.1, Msys2 Compilers 12.2.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1203
Re: Code::Blocks' translation
« Reply #246 on: November 12, 2022, 12:09:42 pm »
Main plugin's manifest.xml contents appear in the POT, but not those from the contrib folder.

For example, the debuggergdb plugin's contents are in the POT, but those in regex_testbed from contrib are not.

With [r13017] you can see the difference, for example, in the Help -> Plugins menu.

In you bash file, the line
Code
find ../plugins | grep -F manifest | grep -F .xml | grep -v svn-base | grep -v .svn | xargs sed -n -e '/description/,/>/p' | sed '/author/d' | sed ':a;N;$!ba;s/\n/\\n/g' | sed 's/""//g' | sed 's/>\\n/>'"\\${nl}"'/g' | sed 's/"/\\"/g' | sed 's/&/\&/g' >  src_xml3.cpp 2>> log.txt
should be modified to do a recursive search (or add another line for plugins/contrib).

EDIT: why don't you use
Code
find ../plugins -name manifest.xml
instead of
Code
find ../plugins | grep -F manifest | grep -F .xml
« Last Edit: November 12, 2022, 02:00:30 pm by Miguel Gimenez »

Offline gd_on

  • Lives here!
  • ****
  • Posts: 767
Re: Code::Blocks' translation
« Reply #247 on: November 12, 2022, 06:23:54 pm »
Quote
EDIT: why don't you use
Code
find ../plugins -name manifest.xml
instead of

Code
find ../plugins | grep -F manifest | grep -F .xml


because there are a few manifest in Smartindent as manifest_cpp.xml, manifest_fortran.xml,... which are missed with only manifest.xml

Decoding an xml file is not so simple than a cpp or a .h file. I first extract lines containing some specific strings as description, author, ... to create a pseudo cpp file, here src_xml3.cpp. It needs some adjustments : that the reason of all the intermediate sed modifications. Then this pseudo cpp is concatenated and analyzed. Doing like that, the real origin of the string is lost, but normally it should be there. find itself do a recursive analysis.
Nevertheless, it's possible that I have missed something, a specific field, maybe the line containing "title" ?
In the regex_testbed manifest, the description "A testbed for regular expressions." is in the .pot file, and is translated in my po file. This proves that find does the recursive job...
Windows 10 64 bits (22H2), svn C::B (last version or almost!), wxWidgets 3.2.1, Msys2 Compilers 12.2.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1203
Re: Code::Blocks' translation
« Reply #248 on: November 12, 2022, 06:40:07 pm »
The title Regular expressions testbed does not appear, for example.

Offline gd_on

  • Lives here!
  • ****
  • Posts: 767
Re: Code::Blocks' translation
« Reply #249 on: November 12, 2022, 07:05:47 pm »
So, you mean that I should detect the "title" line in the manifest.xml? (or the "name" line? or both?)
Windows 10 64 bits (22H2), svn C::B (last version or almost!), wxWidgets 3.2.1, Msys2 Compilers 12.2.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1203
Re: Code::Blocks' translation
« Reply #250 on: November 12, 2022, 07:24:16 pm »
I think title, description, thanksto, license, name and version should need translation.I added _() to them in [r13015] and [r13016].

Title and description are a must.
Thanksto may be needed if it contains something like "My mother".
License may contain "Modified wcWidgets license"
Name is not too interesting, but may be needed.
Version will usually be numbers/dots, but it could contain other strings.

Curiously enough, title for CodeCompletion, DebuggerGDB and others appear in the POT, while others do not.

Offline gd_on

  • Lives here!
  • ****
  • Posts: 767
Re: Code::Blocks' translation
« Reply #251 on: November 13, 2022, 01:30:50 pm »
I think title, description, thanksto, license, name and version should need translation.I added _() to them in [r13015] and [r13016].

Title and description are a must.
Done
Quote
Thanksto may be needed if it contains something like "My mother".
Done
Quote
License may contain "Modified wcWidgets license"
Done, but as it is the last field, it works only if the text is on 1 line (it's always the case)
Quote
Name is not too interesting, but may be needed.
Not done.
Quote
Version will usually be numbers/dots, but it could contain other strings.
Not done
Quote
Curiously enough, title for CodeCompletion, DebuggerGDB and others appear in the POT, while others do not.
This is because the strings are also found in other files (as .cpp for example).

I also tried author but it's not easy:
  • One manifest (wxSmithAUI) contains characters with accents in the author name. xgettext does not like them. A workaround is to replace these characters with ascii one (no accents)
  • it is difficult to separate athor, authorMail and authorWeb fields. If the 1srt one may need a translation (in some cases where there is a co-author plus a small translatable text), others do not need translation
  • some names appear several times in the .pot file, just becase they are not stricly the same: a space, a !, a capital letter... Note that it is also the case for some other strings in other fields

You'll find attached a modified version of the batch file and the .pot generated. Need still some work...

gd_on
Windows 10 64 bits (22H2), svn C::B (last version or almost!), wxWidgets 3.2.1, Msys2 Compilers 12.2.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1203
Re: Code::Blocks' translation
« Reply #252 on: November 13, 2022, 01:56:10 pm »
Thank you.

"Not done" means "won't do"?. If yes, I will remove the _() from those fields in dlgaboutplugin.cpp.

Author usually does not need translation, unless it is something like "The wxWidgets team". I will remove accents from wxSmithAUI.
Author's mail and web will not need translation.

Quote
some names appear several times in the .pot file, just becase they are not stricly the same: a space, a !, a capital letter... Note that it is also the case for some other strings in other fields
This is a nightmare, but little can be done now. Another problem are wxSmith-generated strings, they always use _() even for numbers.

New code should be more translator-friendly, but currently it is not.

Offline gd_on

  • Lives here!
  • ****
  • Posts: 767
Re: Code::Blocks' translation
« Reply #253 on: November 13, 2022, 02:58:34 pm »
"Not done" means "won't do"?. If yes, I will remove the _() from those fields in dlgaboutplugin.cpp.
I think I can add but I think it's not needed. No real benefit.
Windows 10 64 bits (22H2), svn C::B (last version or almost!), wxWidgets 3.2.1, Msys2 Compilers 12.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: 767
Re: Code::Blocks' translation
« Reply #254 on: November 13, 2022, 06:54:52 pm »
A updated version of my translatable string extracting tool can be found here.
It is able to scan new translatable strings in manifest.
The english template on Launchpad has not been still updated (https://launchpad.net/codeblocks-gd).
My previous update was approved but not still imported in the data base. I cannot update more, I cannot also download a translation file: the download request is accepted but I don't receive the mail to download it. Is there a problem on launchpad ?
« Last Edit: November 13, 2022, 06:57:20 pm by gd_on »
Windows 10 64 bits (22H2), svn C::B (last version or almost!), wxWidgets 3.2.1, Msys2 Compilers 12.2.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).