[rhinstaller/anaconda/pulls/109 f22-branch] Don't use $LANGUAGE if empty (#1222262)
vpodzime
installerbot-noreply at redhat.com
Mon May 18 14:55:30 UTC 2015
> @@ -1224,10 +1224,17 @@ if __name__ == "__main__":
> # ability to set the language and locale after startup. If any of, in
> # order, $LANGUAGE, $LC_ALL, or $LC_MESSAGES is in the environment, copy
> # the information to $LANG, and then clear the rest.
> - for varname in ("LANGUAGE", "LC_ALL", "LC_MESSAGES"):
> - if varname in os.environ:
> - os.environ["LANG"] = os.environ[varname] # pylint: disable=environment-modify
> - break
> +
> + # $LANGUAGE is a GNU gettext extension, and is defined as being used only
> + # if set to a nonempty value. Annoyingly, some programs (KDE) do set
> + # LANGUAGE to an empty value and then expect everyone not to use it.
> + if "LANGUAGE" in os.environ and os.environ["LANGUAGE"]:
> + os.environ["LANG"] = os.environ["LANGUAGE"] # pylint: disable=environment-modify
> + else:
> + for varname in ("LC_ALL", "LC_MESSAGES"):
> + if varname in os.environ:
> + os.environ["LANG"] = os.environ[varname] # pylint: disable=environment-modify
> + break
Why don't we want to do the same check for all the variables? Should ``LC_ALL=`` or ``LC_ALL=`` behave differently?
--
To view this pull request on github, visit https://github.com/rhinstaller/anaconda/pull/109#discussion_r30514618
More information about the anaconda-patches
mailing list