[Freeipa-devel] [PATCH 46/46] ticket 1669 - improve i18n docstring extraction

Alexander Bokovoy abokovoy at redhat.com
Thu Aug 25 14:36:35 UTC 2011


On 25.08.2011 16:53, John Dennis wrote:
> On 08/25/2011 07:50 AM, Alexander Bokovoy wrote:
>> Read through whole patch. This is one of rare cases where gettext's use
>> of original text as translation id isn't helpful from both performance
>> (longer calculation of Id hash during run-time) and maintenance. Looks
>> like we have to live with that if Transifex is unable to work with
>> indirected translation ids -- that would mean authoritative original
>> text would be in 'en' translation, not as original translation id.
>>
>> If that can't be solved, I'm fine with this approach.
> 
> 
> To the best of my knowledge gettext can only use the original string as
> the message id. Transifex is built upon the gettext architecture. To the
> best of my knowledge gettext is the only i18n translation framework in
> use for the software in our distribution. I agree with you that hashing
> the original string for lookup is less than ideal but given the above I
> think we have to live with it. I'm not aware of any performance
> complaints due to the hashing, but I don't read the gettext mailing list.
Here is what we have now:
$ rpm -ql freeipa-python|grep locale
/usr/share/locale/bn_IN/LC_MESSAGES/ipa.mo
/usr/share/locale/de/LC_MESSAGES/ipa.mo
/usr/share/locale/es/LC_MESSAGES/ipa.mo
/usr/share/locale/fr/LC_MESSAGES/ipa.mo
/usr/share/locale/he/LC_MESSAGES/ipa.mo
/usr/share/locale/id/LC_MESSAGES/ipa.mo
/usr/share/locale/it/LC_MESSAGES/ipa.mo
/usr/share/locale/ja/LC_MESSAGES/ipa.mo
/usr/share/locale/kn/LC_MESSAGES/ipa.mo
/usr/share/locale/ko/LC_MESSAGES/ipa.mo
/usr/share/locale/pl/LC_MESSAGES/ipa.mo
/usr/share/locale/pt/LC_MESSAGES/ipa.mo
/usr/share/locale/pt_BR/LC_MESSAGES/ipa.mo
/usr/share/locale/ru/LC_MESSAGES/ipa.mo
/usr/share/locale/uk/LC_MESSAGES/ipa.mo
/usr/share/locale/zh_CN/LC_MESSAGES/ipa.mo
/usr/share/locale/zh_TW/LC_MESSAGES/ipa.mo

With translation id being a hash instead of original message all the
difference would be that there will be

/usr/share/locale/en/LC_MESSAGES/ipa.mo
/usr/share/locale/C/LC_MESSAGES/ipa.mo

This would have been enough if only gettext supported fallback between
language translations on the same domain. I.e. if Russian translation is
not available, try English one and if not, return translation Id. There
is discussion about similar cases in ambiguous translations of GUI
messages and solution proposed is a wrapper around gettext() to lookup
other means for fetching translations.

-- 
/ Alexander Bokovoy




More information about the Freeipa-devel mailing list