Set LANGUAGE env variable is set to a non-English locale (#83671)

Fixes: #83608

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
pull/81364/merge
Abhijeet Kasurde 4 months ago committed by GitHub
parent a3a92bcc13
commit 8e74cdc7b2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,3 @@
---
bugfixes:
- Set LANGUAGE environment variable is set to a non-English locale (https://github.com/ansible/ansible/issues/83608).

@ -1252,6 +1252,7 @@ def main():
LC_ALL=locale, LC_ALL=locale,
LC_MESSAGES=locale, LC_MESSAGES=locale,
LC_CTYPE=locale, LC_CTYPE=locale,
LANGUAGE=locale,
) )
module.run_command_environ_update = APT_ENV_VARS module.run_command_environ_update = APT_ENV_VARS

@ -188,7 +188,7 @@ def lang_env(module):
if not hasattr(lang_env, 'result'): if not hasattr(lang_env, 'result'):
locale = get_best_parsable_locale(module) locale = get_best_parsable_locale(module)
lang_env.result = dict(LANG=locale, LC_ALL=locale, LC_MESSAGES=locale) lang_env.result = dict(LANG=locale, LC_ALL=locale, LC_MESSAGES=locale, LANGUAGE=locale)
return lang_env.result return lang_env.result

@ -504,7 +504,7 @@ class UbuntuSourcesList(SourcesList):
if self.apt_key_bin: if self.apt_key_bin:
locale = get_best_parsable_locale(self.module) locale = get_best_parsable_locale(self.module)
APT_ENV = dict(LANG=locale, LC_ALL=locale, LC_MESSAGES=locale, LC_CTYPE=locale) APT_ENV = dict(LANG=locale, LC_ALL=locale, LC_MESSAGES=locale, LC_CTYPE=locale, LANGUAGE=locale)
self.module.run_command_environ_update = APT_ENV self.module.run_command_environ_update = APT_ENV
rc, out, err = self.module.run_command([self.apt_key_bin, 'export', key_fingerprint], check_rc=True) rc, out, err = self.module.run_command([self.apt_key_bin, 'export', key_fingerprint], check_rc=True)
found = bool(not err or 'nothing exported' not in err) found = bool(not err or 'nothing exported' not in err)

@ -68,7 +68,7 @@ def main():
dpkg = module.get_bin_path('dpkg', True) dpkg = module.get_bin_path('dpkg', True)
locale = get_best_parsable_locale(module) locale = get_best_parsable_locale(module)
DPKG_ENV = dict(LANG=locale, LC_ALL=locale, LC_MESSAGES=locale, LC_CTYPE=locale) DPKG_ENV = dict(LANG=locale, LC_ALL=locale, LC_MESSAGES=locale, LC_CTYPE=locale, LANGUAGE=locale)
module.run_command_environ_update = DPKG_ENV module.run_command_environ_update = DPKG_ENV
name = module.params['name'] name = module.params['name']

Loading…
Cancel
Save