From 33d084f16a9055df0327930abe43f7b91429cf24 Mon Sep 17 00:00:00 2001 From: codefiles <11915375+codefiles@users.noreply.github.com> Date: Tue, 19 Sep 2023 16:51:20 -0400 Subject: Use `SUPPORTED` file for locale options (#2069) * Use `SUPPORTED` file for locale options * Add glibc to `PKGBUILD` depends --- PKGBUILD | 1 + archinstall/lib/locale/locale.py | 23 ++++++++--------------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 315256e3..c332d043 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -16,6 +16,7 @@ depends=( 'coreutils' 'cryptsetup' 'e2fsprogs' + 'glibc' 'kbd' 'pciutils' 'procps-ng' diff --git a/archinstall/lib/locale/locale.py b/archinstall/lib/locale/locale.py index c3294e83..90f20cc6 100644 --- a/archinstall/lib/locale/locale.py +++ b/archinstall/lib/locale/locale.py @@ -11,21 +11,14 @@ def list_keyboard_languages() -> Iterator[str]: def list_locales() -> List[str]: - with open('/etc/locale.gen', 'r') as fp: - locales = [] - # before the list of locales begins there's an empty line with a '#' in front - # so we'll collect the localels from bottom up and halt when we're donw - entries = fp.readlines() - entries.reverse() - - for entry in entries: - text = entry.replace('#', '').strip() - if text == '': - break - locales.append(text) - - locales.reverse() - return locales + locales = [] + + with open('/usr/share/i18n/SUPPORTED') as file: + for line in file: + if line != 'C.UTF-8 UTF-8\n': + locales.append(line.rstrip()) + + return locales def list_x11_keyboard_languages() -> Iterator[str]: -- cgit v1.2.3-70-g09d2