Use `SUPPORTED` file for locale options (#2069)

* Use `SUPPORTED` file for locale options

* Add glibc to `PKGBUILD` depends
This commit is contained in:
codefiles 2023-09-19 16:51:20 -04:00 committed by GitHub
parent c0ff55d55b
commit 33d084f16a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 13 deletions

View File

@ -16,6 +16,7 @@ depends=(
'coreutils'
'cryptsetup'
'e2fsprogs'
'glibc'
'kbd'
'pciutils'
'procps-ng'

View File

@ -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()
locales = []
for entry in entries:
text = entry.replace('#', '').strip()
if text == '':
break
locales.append(text)
with open('/usr/share/i18n/SUPPORTED') as file:
for line in file:
if line != 'C.UTF-8 UTF-8\n':
locales.append(line.rstrip())
locales.reverse()
return locales
return locales
def list_x11_keyboard_languages() -> Iterator[str]: