[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nuxeo-localizer] How to create .po files
From: |
Gitte Wange |
Subject: |
Re: [Nuxeo-localizer] How to create .po files |
Date: |
Tue, 26 Feb 2002 18:59:34 +0100 |
tirsdag 26 februar 2002 18:53 skrev du:
> Gitte Wange wrote:
> >Hello,
> >
> >I new to Localizer (but familiar with gettext tough) ...
> >
> >I have created a product where I want to translate some daynames in the
> > class before returned to the UI.
> >
> >I have looked at the NuxWidgets product and seen how you created the
> >Multilingual class ... so now I now how the text actual gets translated ..
>
> Yesterday I released Localizer 0.8.1 (still unnounced in Zope.org), and
> the way that
> is currently used in NuxWidgets and that you've copied is deprecated. It
> still works
> and will work for a long while, however.
Okay - will try and install that instead then :-)
> 1. Remove the "Multilingual" stuff
>
> 2. At the beginning of the module, type:
>
> from Products.Localizer import Gettext
>
> _ = Gettext.translation(globals())
> N_ = Gettext.dummy
>
> 3. Translate your messages with "_(message)"
>
> 4. Somewhere in the module, type:
>
> N_('Monday')
> N_('Tuesday')
> ...
>
> 5. Run zgettext.py, it will work because 'Monday', etc.. are literals
> and because it recognizes the N_ function.
Hmm ... but I want to translate some variables ...
can't I do that ?
(I get the variables from e.g. DateTime.Month() )
> This is a well known problem, they're "Deferred translations", if you've
> some minutes read the relevant section of the Python documentation:
>
> http://www.python.org/doc/2.1.2/lib/node196.html
Will read it later tonight :-)
TIA,
Gitte Wange