From 289aba403f16df685d81625c6767607b50c646d7 Mon Sep 17 00:00:00 2001 From: codefiles <11915375+codefiles@users.noreply.github.com> Date: Sun, 19 Jul 2026 13:32:40 -0400 Subject: [PATCH] Set LANG to fully qualified locale name --- archinstall/lib/installer.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index 985e16cde8..ca13cf1233 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -660,16 +660,12 @@ def set_locale(self, locale_config: LocaleConfiguration) -> bool: # in the first column of the entry; check for both cases. entry_re = re.compile(rf'#{lang}(\.{encoding})?{modifier} {encoding}') - lang_value = None for index, line in enumerate(locale_gen_lines): if entry_re.match(line): - uncommented_line = line.removeprefix('#') - locale_gen_lines[index] = uncommented_line + locale_gen_lines[index] = line.removeprefix('#') locale_gen.write_text(''.join(locale_gen_lines)) - lang_value = uncommented_line.split()[0] break - - if lang_value is None: + else: error(f"Invalid locale: language '{locale_config.sys_lang}', encoding '{locale_config.sys_enc}'") return False @@ -679,7 +675,7 @@ def set_locale(self, locale_config: LocaleConfiguration) -> bool: error(f'Failed to run locale-gen on target: {e}') return False - (self.target / 'etc/locale.conf').write_text(f'LANG={lang_value}\n') + (self.target / 'etc/locale.conf').write_text(f'LANG={lang}.{encoding}{modifier}\n') return True def set_timezone(self, zone: str) -> bool: