[PATCH v2] Do not translate empty strings, gettext translates them Do not translate empty strings, gettext translates them into system information (basically PO file header)

Vojtěch Trefný vtrefny at redhat.com
Thu Nov 13 20:53:17 UTC 2014


Dne 13.11.2014 v 21:03 Anne Mulhern napsal(a):
>
>
>
> ----- Original Message -----
>> From: "Vojtech Trefny" <vtrefny at redhat.com>
>> To: anaconda-patches at lists.fedorahosted.org
>> Sent: Thursday, November 13, 2014 1:24:58 PM
>> Subject: [PATCH v2] Do not translate empty strings,	gettext translates them Do not translate empty strings,	gettext
>> translates them into system information (basically PO file	header)
>>
>> ---
>>   blivet/i18n.py | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/blivet/i18n.py b/blivet/i18n.py
>> index 1f07266..1042688 100644
>> --- a/blivet/i18n.py
>> +++ b/blivet/i18n.py
>> @@ -45,8 +45,8 @@ N_ = lambda x: x
>>   # evaluated on every call.
>>   # pylint: disable=unnecessary-lambda
>>   if six.PY2:
>> -    _ = lambda x: _get_translations().ugettext(x)
>> +    _ = lambda x: _get_translations().ugettext(x) if x != "" else u""
>>       P_ = lambda x, y, z: _get_translations().ungettext(x, y, z)
>>   else:
>> -    _ = lambda x: _get_translations().gettext(x)
>> +    _ = lambda x: _get_translations().gettext(x) if x != "" else ""
>>       P_ = lambda x, y, z: _get_translations().ngettext(x, y, z)
>> --
>> 2.1.0
>>
>> _______________________________________________
>> anaconda-patches mailing list
>> anaconda-patches at lists.fedorahosted.org
>> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
>>
> Something strange happened to your commit message, but other than that, ack.
>
> - mulhern
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
Oh, how that happened? I was so focused on doing the reply-to right way, 
I totally missed this. Hope the v3 version is finally ok.

V


More information about the anaconda-patches mailing list