nuxeo-localizer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nuxeo-localizer] ZWiki internationalization


From: Juan David Ibáñez Palomar
Subject: Re: [Nuxeo-localizer] ZWiki internationalization
Date: Tue, 26 Feb 2002 11:48:16 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.8) Gecko/20020214

Simon Michael wrote:

Hi Juan,

just want to say thank you for your detailed how-to. I'm impatient to work
on this. Also,

_ = Gettext.translation(globals()) # or "gettext =
Gettext.translation(globals()) "
N_ = Gettext.dummy

....

_('Edit conflict!')


I don't see quite what's going on here, except string literals look easier
to type.. and did you say this is a standard idiom for i18n in python  ?


Hi,

Actually, it isn't a Python standard, but a Gettext convention.

The canocical name is "gettext(message)", but there's the convention
to use an underscore, so translating a message only needs to add three
characters. Look at the Gettext documentation:

http://www.gnu.org/manual/gettext/index.html

In particular the section "Preparing Program Sources".

You can use "gettext" or "_" (or something else, but then the extraction
tool won't work).


About Python, usually the translation function is either installed on the
builtins namespace or a module function. See the documentation for the
"gettext" module:

http://www.python.org/doc/2.1.2/lib/module-gettext.html

With an application like Zope installing in the namespace wouldn't work,
it must be in the module as it's now.


Cheers,

--
J. David Ib??ez, Nuxeo.com
Zope developer (http://www.zope.org)






reply via email to

[Prev in Thread] Current Thread [Next in Thread]