[vdr] translation context handling in vdr >= 1.5.7
Anssi Hannula
anssi.hannula at gmail.com
Fri Aug 24 15:37:07 CEST 2007
Klaus Schmidinger wrote:
> On 08/23/07 13:48, Christian Wieninger wrote:
>> Hi,
>>
>> I just noticed a small change in the context handling of translations
>> since vdr-1.5.7. Till now it was possible to have e.g.
>>
>> const char AllowedChars[] = trNOOP("$
>> abcdefghijklmnopqrstuvwxyz0123456789-.,#~\\^$[]|()*+?{}/:%@&");
>>
>> Note the 2 '$'. The first one only helps to have the second one in the
>> translation and not to be interpreted as context.
>>
>> Previous implementations of I18nTranslate did only cut the context of
>> the english version. So the translation could look like this in i18n.c
>> or the po-files:
>>
>> // The allowed characters in strings:
>> { "$ abcdefghijklmnopqrstuvwxyz0123456789-.,#~\\^$[]|()*+?{}/:%@&",
>> " aäbcdefghijklmnoöpqrsßtuüvwxyz0123456789-.,#~\\^$[]|()*+?{}/:%@&",
>> " abcdefghijklmnopqrstuvwxyz0123456789-.,#~\\^$[]|()*+?{}/:%@&",
>> ...
>>
>> The current implementation cuts the translations too which results in
>>
>> "[]|()*+?{}/:%@&"
>>
>> Is this intended? If so, one could add the dummy '$' also at the
>> beginning of the translation, but has to handle this again for backwards
>> compatibility.
>>
>> If it's not intended the following patch should give the previous behaviour:
[...]
>
> gettext() may or may not return the original string, so if no translation
> is found, the context needs to be stripped.
[...]
For the record, gettext also has context support:
http://www.gnu.org/software/gettext/manual/gettext.html#Contexts
But if it needs too many changes, maybe it is not worth it.
--
Anssi Hannula
More information about the vdr
mailing list