[prev in list] [next in list] [prev in thread] [next in thread] 

List:       klik-devel
Subject:    [klik-devel] Fwd: Re:  Translation of the cmg_kfile plugin
From:       Lionel Tricon <lionel.tricon () free ! fr>
Date:       2007-11-25 19:40:28
Message-ID: 200711252040.28383.lionel.tricon () free ! fr
[Download RAW message or body]


----------  Forwarded Message  ----------

Subject: Re: [klik-devel] Translation of the cmg_kfile plugin
Date: dimanche 25 novembre 2007
From: Lionel Tricon <lionel.tricon@free.fr>
To: probono <probono@myrealbox.com>

On Sunday 25 November 2007 20:16:18 probono wrote:
> Hi all,
>
> since we are such an international team we should try to get the
> python parts translated as well... i18n using PO files?
>
> probono

From a french tutorial :

You need to extract all sentences you want to translate :
xgettext -a sudokuban.py

You get a po file that yoiu translate in the target language. The next step 
consist to add _() between each sentence you want to translate into the 
python source code.

After, you add the following into your source code :

import gettext
pathname = os.path.dirname(sys.argv[0])
localdir = os.path.abspath(pathname) + "/locale"
gettext.install("messages", localdir)

Then, you transform the po file into a binary format (.mo) :

msgfmt messages.po

And you copy both files (or only the last one ?) into the following directory 
(adapt it) :

/home/leviathan/sudokuban/locale/fr_FR/LC_MESSAGES/

Voilą,
but i don't know if it works :-) not tested it with python ..
Lionel

-------------------------------------------------------
_______________________________________________
klik-devel mailing list
klik-devel@kde.org
https://mail.kde.org/mailman/listinfo/klik-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic