Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib
diff options
context:
space:
mode:
authorcodefiles <11915375+codefiles@users.noreply.github.com>2023-09-19 16:51:20 -0400
committerGitHub <noreply@github.com>2023-09-20 06:51:20 +1000
commit33d084f16a9055df0327930abe43f7b91429cf24 (patch)
treea4a2c9582ceb969c0dab687a9fe22ebdeefa0703 /archinstall/lib
parentc0ff55d55b855f6975f4e588f6368ccb2a4294ac (diff)
Use `SUPPORTED` file for locale options (#2069)
* Use `SUPPORTED` file for locale options * Add glibc to `PKGBUILD` depends
Diffstat (limited to 'archinstall/lib')
-rw-r--r--archinstall/lib/locale/locale.py23
1 files changed, 8 insertions, 15 deletions
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]: