Use `SUPPORTED` file for locale options (#2069)
* Use `SUPPORTED` file for locale options * Add glibc to `PKGBUILD` depends
This commit is contained in:
parent
c0ff55d55b
commit
33d084f16a
1
PKGBUILD
1
PKGBUILD
|
|
@ -16,6 +16,7 @@ depends=(
|
|||
'coreutils'
|
||||
'cryptsetup'
|
||||
'e2fsprogs'
|
||||
'glibc'
|
||||
'kbd'
|
||||
'pciutils'
|
||||
'procps-ng'
|
||||
|
|
|
|||
|
|
@ -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]:
|
||||
|
|
|
|||
Loading…
Reference in New Issue