Author Topic: How to make a translation file useable  (Read 6732 times)

Offline eckard_klotz

  • Almost regular
  • **
  • Posts: 198
How to make a translation file useable
« on: October 07, 2013, 11:18:25 am »
Hello Everyone.

After creating a Launchpad account I was able to request C::B translation files they sent me the links to 2 files (as I requested):
  • _codeblocks-de.po
  • de_LC_MESSAGES_codeblocks.mo
And I want to use them together with the last nightly Build 9738 from 10th of October 2013 on WinXP SP3

First I added under C:\Documents and Settings\klotz\Application Data\codeblocks\share\codeblocks\locale a new folder de and saved both files there. But when I tried to select them in the dialogue Settings->Environment->View I was not able to do so since no German was shown in the list.
Then I played around with the filenames and I was able to see German in the list if I used:
  • _codeblocks-de.po
  • _codeblocks_de.mo

Now I was able to select German as Language. So I did and closed Code::Blocks again. But after starting it again I recognize no change. When I open the po-file I see that the content is a real translation as shown in Launchpad (100% and green). But even massages are still in English. I Also added under C:\Documents and Settings\klotz\Application Data\codeblocks\share\codeblocks\locale\de an additional folder LC_MESSAGES and placed the original files there with the same result.

Now I tried to find some Information in wiki and forum but to be honest its a little bit confusing you find a lot of discussions but until now I found now simple how to that describes how to deal with just downloaded files from Launchpad if the already contain the full translation.


For example under Internationalization in the wikihttp://wiki.codeblocks.org/index.php?title=Internationalization I found:

Quote
Let Code::Blocks support your language
If you want Code::Blocks to support your language, you must modify the file \codeblocks\src\src\appglobals.cpp.


I this really the truth, since this means I have to compile Code::Blocks again, right?

How ever It would be very helpful If You can provide a simple but complete description how to insert existing translation-files. Furthermore it may be a good Idea to provide the latest versions from Launchpad for example in your Sourcefoge project just as they are with now warrantee.

Best regards,

                      Eckard Klotz.



 




Offline gd_on

  • Lives here!
  • ****
  • Posts: 797
Re: How to make a translation file useable
« Reply #1 on: October 07, 2013, 12:55:33 pm »
To see a language in the list after introducing it in a folder, it's necessary to close and reopen C::B.
The .po file is not used by C::B, only the .mo is recognized (a sort of compiled file, obtained by using poedit for example).
I'm not sure that de name, as a subfolder of locale, is sufficient. In my case, for French, I use fr_FR. May be de_DE is good.
No need to modify appglobals.cpp.
Finally, the translations in Launchpad are so old that there are very few strings which are still good 2165 strings in Launchpad, but in last svn C::B version approximately 7300 strings !). The correspondence between the strings contained in C::B and in the English part of the .po (and the .mo) file must be exact (no case difference, no more spaces ...).
Myself, I maintain a French translation that you can find in http://forums.codeblocks.org/index.php/topic,1022.msg123327.html#msg123327, for the last published version.
May be you can find somewhere a more recent German translation.

gd_on
« Last Edit: October 07, 2013, 01:44:38 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 eckard_klotz

  • Almost regular
  • **
  • Posts: 198
Re: How to make a translation file useable
« Reply #2 on: October 07, 2013, 03:07:29 pm »
Hello Gd_On

Thanks for your reply.

Unfortunatly Im not able to decompress your files. But however I think you are right the files from Launchpad are to old.
I already downloaded poedit to make the files working but I wonder if this makes realy sense if the the strings to translate are still not stable.

Thus it would be very kind to get a comment from a c::b developer.

Best regards,
                   Eckard Klotz.



Offline gd_on

  • Lives here!
  • ****
  • Posts: 797
Re: How to make a translation file useable
« Reply #3 on: October 07, 2013, 03:18:24 pm »
My files have been compressed by a recent 7zip version.

And yes, It makes sense to translate C::B. It is stable enough, I think, but it's a product which evolves continuously. It's a living product.
In French, there is more than 99% strings which are translated. But strings that are not translated appears in English, so it's not a problem. You can continue to work while awaiting for updated translations.

gd_on
« Last Edit: October 07, 2013, 03:29:46 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 eckard_klotz

  • Almost regular
  • **
  • Posts: 198
Re: How to make a translation file useable
« Reply #4 on: October 07, 2013, 03:51:43 pm »
Hello Gd_On

It works now (not completly but good enough to see how it works)
You wrote:
Quote
I'm not sure that de name, as a subfolder of locale, is sufficient. In my case, for French, I use fr_FR. May be de_DE is good.
And this is the importent tip using de_DE as folder-name. One other importent thing is to add this folder to the right parent-folder. On a windows-mashine you have at least two locations ending with local (if you are working with a nightly):
  • C:\Documents and Settings\user\Application Data\codeblocks\share\codeblocks\locale
  • CodeBlock_NightlyBuildFolder\share\CodeBlocks\locale
And the nightly expects the translation-file in its own folder named local.

So thanks for your help. But I have still one question:
Is there somewhere a location that I just didN't found where all this is documented?
Best regards,
                  Eckard Klotz.

Offline gd_on

  • Lives here!
  • ****
  • Posts: 797
Re: How to make a translation file useable
« Reply #5 on: October 07, 2013, 07:46:57 pm »
For me, it's effectively in : C:\Program Files (x86)\CodeBlocks\share\CodeBlocks\locale\fr_FR.
I have found this information in the Wiki (but it's not really up to date), in the forum (more particularly in "Code::Blocks' translation" thread), and search on the web: how some other softs using wxwidgets are configured.
Nevertheless I don't remember if I have found an other simple document explaining where to put these files ? Sorry.

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 LucMorizur

  • Single posting newcomer
  • *
  • Posts: 3
  • My face drawn by Olive
    • My website – if I finish it some day...
Re: How to make a translation file useable
« Reply #6 on: January 03, 2014, 11:32:28 am »
Hi;

I apologize for this question, cause surely there's something I missed. But I can't figure out the procedure to make Code::Blocks use the translation file. The wiki "Internationalization" article, talking about \codeblocks\src\src\appglobals.cpp file, gives the feeling that codeblocks.mo file should be used before compiling the source code itself of Code::Blocks (appglobals.cpp can be found in source files of Code::Blocks, it does not appear in the binary release); yet your posts in the current thread give the feeling that just adding folder locale\fr_FR to C:\Documents and Settings\<user>\Application Data\codeblocks\share\codeblock\ (or to C:\Program Files\CodeBlocks\share\CodeBlocks ?) is enough. Yet once done I see nothing which could make Code::Blocks being displayed in the language I chose with the codeblocks.mo file I built thanks to poEdit.

What did I miss ??? ??
What a mess with those bloody computers |-(( ...

Offline gd_on

  • Lives here!
  • ****
  • Posts: 797
Re: How to make a translation file useable
« Reply #7 on: January 03, 2014, 12:03:39 pm »
The wiki article is rather old and not fully applicable to present C::B version.
Did you tried to use my own .mo file directly in C:\Program Files (x86)\CodeBlocks\share\CodeBlocks\locale\fr_FR (if you have C::B installed in  C:\Program Files (x86)) or for older 32 bit Windows version in C:\Program Files\CodeBlocks\share\CodeBlocks\locale\fr_FR (if you have C::B installed in  C:\Program Files).
It works like that for me (and for many other guys) and it should work for you because you are french apparently. Don't forget to choose the french language in Parameters/Environment/View.
I have also seen that sometimes there are problems if you don't have a write autorisation on C::B folders with Windows 7 or more. A little bit strange, but this happens sometimes, on some machines, and not systematically !

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 LETARTARE

  • Lives here!
  • ****
  • Posts: 531
  • L'ami de l'homme.The friend of man.
    • LETARTARE
Re: How to make a translation file useable
« Reply #8 on: January 03, 2014, 12:34:57 pm »
I confirm message gd_on.
I use its files and they work correctly.

If you want a tool to incorporate Code: Blocks:
http://forums.codeblocks.org/index.php/topic,18223.0.html
sincerely
CB-13483, plugins-sdk-2.25.0 : Collector-2.0.0, AddOnForQt-3.9.1
1-Win7 Business Pack1 64bits : wx-3.2.4, gcc-8.1.0,
2-OpenSuse::Leap-15.4-64bits : wx-3.2.4;gtk3, gcc-8.2.1,
=> !! The messages are translated by Deepl

Offline LucMorizur

  • Single posting newcomer
  • *
  • Posts: 3
  • My face drawn by Olive
    • My website – if I finish it some day...
Re: How to make a translation file useable
« Reply #9 on: January 03, 2014, 05:28:17 pm »
Many thanks gd_on and LETARTARE for your very quick replies :)

I knew I was missing something easy... Though, I really had the feeling that I inspected quite correctly the Settings > Environement > View tab... But, well, let's hope next time I'll be more efficient at reading  :-\ ...

Talk soon!
What a mess with those bloody computers |-(( ...