Translation problem for some strings?
Thomas De Schampheleire
patrickdepinguin at gmail.com
Sat Jun 17 20:13:21 UTC 2017
Hi,
[..]
>>
>> I will dig deeper in this commit to see if I can find the real problem.
>
> It seems the root cause is the presence of an old .mo file for English:
> kallithea/i18n/en/LC_MESSAGES/kallithea.mo
>
> It seems that in the TurboGears2 case, this file is loaded along,
> causing different behavior for some strings: if the string already
> existed in that .mo file ('Pull Requests') then the translation would
> be taken from that file (which is thus English -> English). For
> strings that did not exist in that .mo file ('My Pull Requests') this
> old file does not have a match, and the next file is attempted, in
> this case the real language, e.g. fr or ru.
>
> I assume, but have not verified explicitly, that under Pylons that
> file did not get loaded.
>
> Neither have I checked why TG2 is loading an English translation file
> when e.g. French language is requested.
>
> In any case, can we get rid of that old English file? All other files
> were removed, and this one preserved, with following commit:
>
> # HG changeset patch
> # User Mads Kiilerich <madski at unity3d.com>
> # Date 1428367884 -7200
> # Tue Apr 07 02:51:24 2015 +0200
> # Node ID 7d6c4bd58abd55e6e29fb240421b30f7e067aef6
> # Parent 04682d9fb33aff0cca53d1236e7a50f6b48f828c
> i18n: don't include .mo files in the repo - build them on demand
>
> (We do however keep the english .mo for now to preserve backwards
> compatibility.)
I dug deeper and found that TurboGears2 by default respects the
language requested by the browser, unlike Pylons did.
The 'lang' setting in the ini file is then merely a fallback. In my
case, I had English as preferred language, and while testing I had set
'lang = fr' in the ini file. As a result, strings were first looked up
in the old English translation file, and strings not found there were
searched in the French file. The result was a mix of languages.
I will send a patch series that:
- removes the old .mo file
- adds documentation / settings for this changed internationalization
under TurboGears2.
/Thomas
More information about the kallithea-general
mailing list