nuxeo-localizer
[Top][All Lists]
Advanced

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

Re: [Nuxeo-localizer] Re: zwiki i18n progress, questions


From: Simon Michael
Subject: Re: [Nuxeo-localizer] Re: zwiki i18n progress, questions
Date: Thu, 30 May 2002 21:25:49 -0700
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.1

Juan David Ibáñez Palomar <address@hidden> writes:
> eehh..  not sure to understand, _() should be sensitive to web
> browser settings, actually language negotiation is orthogonal
> to the rest of the system, so you don't have to do anything
> with it.

Ok, that sounds cool. So my plan is to generate big po files for all
strings in the product code and in the zwikidotorg template files, and at
runtime have both product code and zwikidotorg dtml code use them. I
think I'll need to expose _() as page.gettext() for the dtml.

> I'd like to setup a testing instance here to help you to solve
> these problems. Please, checkin the ".po" files. Also, if you

done

> want more help from me I would be happy to contribute (as my
> time permits), my userid in SourceForge is "jdavid".

thanks, I have added you as a developer.

>>- how best to mark large multiline strings ?
>
> In DTML with <dtml-gettext>...</dtml-gettext>
>
> In Python, I'm not sure, have you tried """...""". Perhaps
> zgettext will need some work to support this.

It recognized """...""" but left some odd indentation in the .po file
which scared me off. It might not be a problem.

>>- should common html/dtml be separated out ?
>
> Not sure to understand, an example??

Here's the current edit conflict dialog::

        return MessageDialog(
            title=titlestr,
            message="""
            <b>%s</b>
            <p>
            %s.
            %s:
            <ol>
            <li>%s
            <li>%s
            <li>%s
            <li>%s
            <li>%s.
            </ol>
            %s,
            <p>
            %s.
            """ % (
            titlestr,
            _("Someone else has saved this page while you were editing"),
            _("To resolve the conflict, do this"),
            _("Click your browser's back button"),
            _("Copy your recent edits to the clipboard"),
            _("Click your browser's refresh button"),
            _("Paste in your edits again, being mindful of the latest changes"),
            _("Click the Change button again"),
            _("or"),
            _("To discard your recent edit and start again, click OK"),
            ),

It would have been easier to treat it as one big string, but then the html
code appears in the po files and each translator has to take care to
preserve it. If this had complicated dtml making it hard just to read, it
would be worse. So I wondered if it's usual to do some work to separate
out just the strings needing translation.

>>- alternatives to zgettext.py ?
>
> 1. the standard gettext utilities, since 0.11.1 xgettext supports Python
>
> 2. pygettext, which is part of the Python since version 1.6 (I think)
>
> 3. xpot: http://www.iro.umontreal.ca/~pinard/po-utils/HTML/
>    (there's a Debian package)
>
> However, there're some reasons to use zgettext, for example it parses
> the "dtml-gettext" tag, and it automates some steps of the i18n of a
> Zope product that otherwise should be done manually.

what steps are those ? I guess I can look at the source.

>>- why doesn't mozilla show the translation ? (ns does)

this one I saw with my own zwiki translation

>>- why does mozilla give a blank page with localizer's select language menu ?
>>- why does ns give the unchanged page with localizer's select language menu ?

these I saw at http://nuxeo.org/localizer. Netscape works now (I think
enabling cookies did it); I still see the problem with mozilla 1.0rc2.

> Another issue, I've seen in the ZWiki's source strings like:
>
>   _("This page was renamed to")+" %s.\n" % (newid)
>
> This is not correct, because the position of "newid" could
> change in other languages, the right string would be:
>
>   _("This page was renamed to %s\n") % newid
>
> If there's more than one parameter you've to use formatted
> strings by name: "%(newid)s"

Aha, thanks for the tip. I am brand new to this stuff. All I can say is,
thank god for those who blazed this trail so the rest of us don't have to. :)

-Simon



reply via email to

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