Developer forums (C::B DEVELOPMENT STRICTLY!) > Contributions to C::B
Code::Blocks' translation
Ganbito:
I am new to poEdit, but it seems that you are right, poEdit cannot interpret directly .mo files.
I started with the directories of the locales that are created at the moment, and there is no "/es-ES/" so I started trying with "/es/". But, as it seems not to work, I start trying "es_ES" (locales uses underscore), but I also try "es-ES" and some other similar locales that I remmember from my tests with other linux distributions (Debian, Opensuse, Fedora...). Then I have tried to copy spanish "codeblocks.mo" to all the locales just for try... and nothing works.
At the end, I tried the path that appers in this link http://wiki.codeblocks.org/index.php?title=Internationalization: /usr/X11R6/share/locale/<lang>/LC_MESSAGES/, but it seems that it is not the path that Ubuntu uses for internationalization.
In the wiki says that we have to edit a source file, but I have thinked that in this case it is not necessary, and I have installed Code::Blocks from .deb files build for us by Xaviou (http://forums.codeblocks.org/index.php/topic,8688.msg63302.html#msg63302).
PD: I will continue using C::B even if I cannot translate it, because it is (for me) the best IDE for C++ and wxWidgets at the moment (and I have tested all that I found).
Ganbito:
I started with internationalization under my own project and, after no little pain, I get it to work and then: "Well, now that I know how to make wxWidgets internationalization work, let's have a look on Code::Blocks's source code about internationalization".
I downloaded the source through svn and opened it with C::B. I found the function "Initlocale()" where it seems that you start the locales. I see that you add a "path" to search catalog that I don't knew what was it so I added a simple "wxMessageBox(path, wxT("path"));" to see what was it. That wxMessageBox said (after "make install"):
--- Code: ---/usr/share/codeblocks/locale
--- End code ---
So putting the ".mo" file to the default folder "/usr/share/locale/<language>" do nothing for C::B. Then I put "_codeblocks-es.mo" to "/usr/share/codeblocks/locale" and it works!
I realised that the name of the ".mo" is not important, it works fine at least if you have only 1 ".mo" in that folder. I think that happens because I do not choose a particular language in "Settings->Environment...", but "Available languages". I also test that putting the ".mo" to a subfolder "es/LC_MESSAGES" or "es_ES/LC_MESSAGES" make it not to work.
The subfolder "locale" under "/usr/share/codeblocks" has to be created manually, it has not been created by the installation.
I think that the wiki have to be changed to reflect this for new users.
Ganbito:
I reinstalled my SO updating it to Ubuntu 8.04.1 (64 bits).
Unfortunately, Code::Blocks localization does not work with this version. It seems that is not a problem of Code::Blocks itself, because it works well under the previous Ubuntu version, but I thought that I should tell you about that.
gd_on:
I wanted to update my French version of Code::Blocks, but I have several problems :
1) pot file on launchpad site is too old and does not reflect actual code status. I've heard an update will be done with 8.02 version, but apparently it has not been done.
2) pot files on svn trunk are also outdated.
3) I thought I could use extract.bat and extract.bash files from svn, but this last one use a -P option in grep. My grep does not support this (I'm on windows xp with mingw32 4.2.1 tools, msys...). I'm able to do this in 2 times, first on .cpp files only and secondly on .h files only (but adding grep filters to avoid files containing svn-base or html in their names).
4) Some items or labels are now placed in .xrc files (for example in project_menu_import.xrc). Apparently, xgettext does not recognize those files and I don't know if it's possible to use it to extract those item and put them in a .pot file. I tried, but without success.
5) finally, if I want to use my .mo file on an other computer running Linux, I have not found where to put it. I tried in /usr/share/codeblock/locale as proposed earlier by Ganbito. It worked with Redhat 5, but administrators have been obliged to downgrade in Redhat 4.7 for compatibilies reasons with other sofwares. If I put my codeblocks.mo as previously in that folder, it does not work, and others places suggested by Ganbito does not work too. So, where is supposed to be placed this file in linux ? Depends of the distribution, the version ? Not clear for me.
gd_on
Jenna:
Do you know http://wiki.codeblocks.org/index.php?title=Internationalization ?
It's a litlle bit outdated, but extraction should work.
The batch-file can easily be adapted for linux.
To fetch all strings use also "-k_T" as option for "xgettext".
No changes to sourcecode have to be made.
Try "/usr/share/codeblocks/locale/[your_language]" (for german I use "/usr/share/codeblocks/locale/de_DE/codeblocks.mo") .
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version