[Zope3-dev] Job Board Example

Barry A. Warsaw barry@zope.com
Mon, 17 Jun 2002 23:34:10 -0400


>>>>> "GvR" == Guido van Rossum <guido@python.org> writes:

    >> I'm have an internal debate about using implicit vs. explicit
    >> message ids.  GNU gettext has a strong preference towards
    >> implicit msgids, especially because for explicit msgids, you
    >> need a third piece of information in the .po file, the original
    >> source message.  Otherwise it's difficult to know what to put
    >> in the msgstr.  Improving the tools (e.g. talgettext.py which
    >> generated the original en/*/jobboard.po file) would help, and
    >> moving to a full web-based translation service as Stephan is
    >> developing would go a long way toward making explicit msgids
    >> more manageable.

    GvR> How does talgettext.py know which explicit msgids to pick?

talgettext.py actually runs the same generation/interpretation process
over the .pt files as would happen during rendering.  It throws away
the output because it isn't needed.  Explicit msgids are easy because
they're always the value of the i18n:translate attribute.

Implicit msgids are tougher because you have to interpret and capture
the contents of the tag.  talgettext.py currently ignores expressions
like tal:replace="context/@@object_name which may or may not be the
right thing -- it's ok if there is an i18n:name attr too because it'd
just get replaced with ${name} in the msgid.

For a while I've thought that explicit msgids are a better way to go,
and I think Stephan agrees, but they aren't a great match with
gettext.  Hopefully though, the gettext approach is just an interim
step, because I think we can do better with a more Zope-ish approach.
Then we may want to require explicit msgids, although they can be
convenient for markup like:

    <th i18n:translate="approve">Approve</th>

since you can write that as

    <th i18n:translate="">Approve</th>

explicit-is-better-than-implicit-ly y'rs,
-Barry