l10n approach for bzr

John Arbash Meinel john at arbash-meinel.com
Mon Mar 17 21:00:07 GMT 2008


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

Mark Hammond wrote:
>> class MyError(BzrError):
>>
>>   _fmt = i18n("My Error says %(foo)s")
>>
>> We would instead do:
>>
>> class BzrError(...):
>>
>>   def __str__(self):
>>     l10nfmt = i18n(self._fmt)
>>     return l10nfmt % self.__dict__
>>
>>
>> And the alternative:
>>
>> class MyError(BzrError):
>>
>>   _fmt = i18n("M_BZR_MY_ERROR_FMT")
>>
>> Which gets exceptionally tricky if you are changing the 
>> number of %s you want to put in the string. You now have to 
>> go find the format, figure out that it has 3, add the 4th, etc.
> 
> Unless I'm missing something, it is already worse than that - you need to
> locate *all* existing translations and add the new insert (else a runtime
> error formatting the string will occur in some locales but not others) - and
> worse, you need to know *where* in the translated text the insert makes
> sense?
> 
>> So fairly long winded, but my view is that we should use 
>> English strings for the message ids, and that when the locale 
>> is English we shouldn't need any translating. Which means 
>> that when strings are cleaned up, they will get new message ids.
> 
> From a practical POV, when someone makes a change to the English version of
> a string, should we ask them to locate that string in *all* translations and
> remove them, to make it clear the translation is no longer used?  I doubt we
> would want the translation files to end up with the complete set of strings
> ever used now or in the past with no indication if the string is actually
> used in the current version.  Or is there another alternative that can help
> us keep these things in synch over time and detect old, unused translations
> for each locale?
> 
> Thanks,
> 
> Mark

I would think that the tool which goes through and finds all strings for
translation (in C world that is 'gettext' I think python has a similar
helper, which we would need to adapt since we don't want to use _() for
pythonic reasons.)

Anyway, I would guess that it would rebuild the full list from the
source code for each release. Rather than having it keep the existing
one and update it by delta.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH3tvXJdeBCYSNAAMRAlzsAKDA7V1G9GdGEkIZSFD1JTVDhP0a5QCguJl7
gAkaTi9w/CiJUtqkoZxLHvE=
=L7I5
-----END PGP SIGNATURE-----



More information about the bazaar mailing list