GNU gettext and python

Bernhard Herzog herzog at online.de
Wed Jun 16 16:17:14 EDT 1999


Dan Ohnesorg <dan at feld.cvut.cz> writes:

> I will internazionalize one application written python. My favoite
> tool
> is gettext. I have found some support for gettext, most recent in
> py-gnome package. It works well but  only for simple strings like
> "Hello
> world". The the application uses multi-line string (it is listserv),
> like
> '''From: %s
> To: %s
> 
> llll
> kkkk
> jjjj
> '''
> 
> etc. 
> 
> But I am not able to bring this strings into getext. The format of
> .po
> files does not expect string like this and when I use many single
> line
> strings, the application does not find the localized version of
> messages.
> 
> Is here someone, who has solved this? Or has some sugestion?

You can put multi-line messages into po-files like this (taken from
Sketch):

#: ../Sketch/UI/styledlg.py:175
msgid ""
"The name `%(name)s' is already used.\n"
"Please choose another one."
msgstr ""
"Der Name »%(name)s« ist bereits vergeben.\n"
"Bitten wählen Sie einen Anderen"

It certainly works for me under Linux/glibc2.

HTH


-- 
Bernhard Herzog	  | Sketch, a python based drawing program
herzog at online.de  | http://www.online.de/home/sketch/




More information about the Python-list mailing list