[Zope3-dev] Job Board Example

Guido van Rossum guido@python.org
Mon, 17 Jun 2002 23:45:14 -0400


>     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.

Ah, it's much dumber than I thought.  You've already done all the hard
work (adding the i18n markup).

> 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.

It may be too late for the job board, but I think the choice of
explicit msgids may become very important.  I was confronted with a
whole slew of single-word messages, and I couldn't recall from which
parts of the interface they were.  There are several plausible
translations for e.g. "Submit" and they depend on the context.  It
would be good if more context was conveyed through the msgid (e.g. is
it a button label, a column heading, a menu entry, etc.).

> 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>

Does it lowercase the contents to get the msg-id?  What else does it
do?

In this case, I'd appreciated an explicit msgid with more context,
e.g. "approve-column-label".

--Guido van Rossum (home page: http://www.python.org/~guido/)