l10n approach for bzr

Barry Warsaw barry at canonical.com
Tue Mar 18 02:49:04 GMT 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mar 17, 2008, at 5:20 PM, Harald Meland wrote:

> [Barry Warsaw]
>
> Hi, Barry!

Hi Harald!  So cool to see the satellites converge again. :)

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

That's an interesting idea.  Yet another problem solved by another  
level of indirection. :)

- -Barry

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)

iEYEARECAAYFAkffLaEACgkQ2YZpQepbvXG+TACcCNCdXreslBHd2hdMMwN92h/k
RR4AoJGufvJ0uNsabzgcXM7lgC6BF/WM
=sNjr
-----END PGP SIGNATURE-----



More information about the bazaar mailing list