l10n approach for bzr

Harald Meland harald.meland at usit.uio.no
Mon Mar 17 22:20:28 GMT 2008


[Barry Warsaw]

Hi, Barry!

> BTW, I've been musing about a source string format that went
> something like this:
>
> mymsg = _('563:User $user is subscribed to list $listname')
>
> So you the extractor matches (P<msgid>\d+):(P<english>.*) and of
> course the runtime _() function would do the same.  Maybe you can
> get the best of both worlds that way?

Alternatively, you could imagine defining a single "magic"
translation, which translates from English to message-ids.  The
runtime function would then do two lookups instead of one -- from
English to magic-language-where-everyone-speaks-in-message-ids, and
then from the magic language to the target language.

You'd get a (slight, I'd guess) performance hit, but would only need
to update the magic translation whenever the English in the source
code changed.

(I've never worked with translations, so I might have missed something
obvious in how the gettext technicalities work.)
-- 
Harald



More information about the bazaar mailing list