translation

Donn donn.ingle at gmail.com
Fri Dec 21 21:28:47 UTC 2007


> but in english : how could i make automatically a po.file ?
> I read the tutorial about localisation but there is no working example
> and i can't adapt it to kapp ?

Hi, I am currently changing my little app into an 18n one. It's not an easy 
job and takes a lot of time. The basic formula is this:

1. aptitude install gettext
2. Write your code, set the locale.
3. To make a pot file from the _("Strings in your app"):
xgettext -o yourtranslationfile.pot yourappname
4. Use kbabel (or a text editor) to edit that file - put all the French to 
English strings in there. Use French _("in your app like this") and put the 
English in the pot file
4. To make a .po file try this:
msginit -l en_ZA -i yourtranslationfile.pot -o yourtranslationfile.po
(Very slowly, makes the pot file -- or you could copy the .pot to .po)
5. To make a .mo file out of that:
msgfmt yourtranslationfile.po -oyourtranslationfile.mo
6. In your app's root folder make a folder called 'locales' and under it do 
this:
locales
 > en
  > LC_MESSAGES
   > yourtranslationfile.mo
 > fr
  > LC_MESSAGES
   > yourtranslationfile.mo

That's the 10 cents version - for a better overview search online for the GNU 
gettext manual and read it.

HTH
\d




More information about the kubuntu-users mailing list