I have built an updated version of the .pot file, used to localize Code::Blocks. Here, chains have been extracted from SVN 5241.
To built it, I have made a compromise between intl.bat, found on the wiki (Internationalization, see earlier) and the file extract.bash found on Code::Block SVN (in i18n folder).
On my Windows PC, as in SVN file, extract.bash is launched by an extract.bat file (but it's easy to have a pure .bat file, without bash !).
To use this .bash file on Windows, you need :
- bash.exe (a tool from bash Msys, found with MinGW32 on sourceforge)
- grep.exe, xargs (tools from Msys Core, found with MinGW) : the version I have does not support -P option (as used in extract.bash from i18n folder from Code::Blocks SVN), so I have to use it twice, first to work on .cpp files, and then on .h files separately)
- find.exe (a tool in findutils, found with MinGW)
- xgettext, msgcat (tools from gettext, found with MinGW but also with poedit software) : I use only the --keyword=_ option, and not --keyword=_T because I think that only the first type of strings (those beginning only by _), need to be translated, not the second one (but may be I'm wrong !).
- wxrc (you can build it from wxWidgets, using the makefile.gcc found in wxWidgets\utils\wxrc (thanks to jens ! for helping me on that point). Wxrc uses wxmsw28u_gcc_cb.dll (or by default wxmsw28u_gcc_custom.dll depending how you customize config.gcc in wxWidgets\build\msw).
- poedit to translate and build the .mo file.
I copied .bat and .bash file within my codeblocks_svn folder at the same level than i18n folder. I called this folder i18n_gd (but it can be an other name).
Executables bash, grep, find, xgettext, msgcat, some libraries (.dll) used by xgettext (but found in the same folder than poedit), wxrc, wxmsw28u_gcc_cb.dll (or wxmsw28u_gcc_custom.dll), must be accessed with your path environment variable (in my case, I have a C:\MinGW\bin folder, declared within path, where all theses executables are put).
In my i18n_gd folder, I execute extract.bat. At the end, I obtain an All_codeblocks.pot file with all extracted character chains that may be translated. Don't worry if you see a few (many
) warnings. It's not very important.
I had also to delete a few lines, in the .pot file, containing "#, c-format" (without quotes) because, in poedit, some strings were not correctly interpreted when building .mo file.
wxrc extract also some chains with a beginning $$, thought it should certainly be $ (not double $).
Those 2 operations are done manually on the pot file in a text editor. This could certainly be done automatically, using some tool !!!
With poedit, you can then merge this .pot file with a previous codeblocks.po file (after saving the initial versions, one never knows !).
It works quite well, but I'm not totally satisfied with the result, because :
- I think that some character chains do not need to be translated, but are extracted anyway (especially some ones found in .xrc resource files) ;
- when merging in poedit, some strings have slightly changed from the previous .po file and poedit does not always make the good choice, but anyway consider them as approximate translations. The problem, is that those strings do not appear as translated in the .mo file, and it's frustrating because it's a sort of regression compared to the previous .mo file where they were correctly translated.
- some operations are still manual (changing $$ by $, and suppressing "#, c-format" lines).
Anyway, I think the result is quite good, but now there is a great work to verify, update and translate new strings.
If it was possible to merge this .pot file with the previous one on launchpad site, it could be easier to share the translation work.
In the different zip files, you'll find the .bat and .bash files, the file All_codeblocks.pot obtained, and a preversion of All_codeblocks.po file for French (there are still more than 900 strings to verify and/or translate !!!). :shock:
gd_on
[attachment deleted by admin]