[follow-up PATCH] Do not try to get "" translated

Martin Kolman mkolman at redhat.com
Fri Apr 4 15:08:26 UTC 2014


On Fri, 2014-04-04 at 16:57 +0200, Vratislav Podzimek wrote:
> Trying to get "" translated results in gettext throwing up on us the header of
> the .po file.
> 
> Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
> ---
>  pyanaconda/i18n.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/pyanaconda/i18n.py b/pyanaconda/i18n.py
> index 12ace35..3e6c248 100644
> --- a/pyanaconda/i18n.py
> +++ b/pyanaconda/i18n.py
> @@ -23,7 +23,7 @@ __all__ = ["_", "N_", "P_", "C_", "CN_", "CP_"]
>  
>  import gettext
>  
> -_ = lambda x: gettext.ldgettext("anaconda", x)
> +_ = lambda x: gettext.ldgettext("anaconda", x) if x else ""
>  N_ = lambda x: x
>  P_ = lambda x, y, z: gettext.ldngettext("anaconda", x, y, z)
>  
Just wow - this behavior places gettext right next to lvm tools and Grub
in the "user friendly" CLI utility ranking! :)
ACK!



More information about the anaconda-patches mailing list