Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use SUPPORTED file for locale options #2069

Merged
merged 2 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ depends=(
'coreutils'
'cryptsetup'
'e2fsprogs'
'glibc'
'kbd'
'pciutils'
'procps-ng'
Expand Down
23 changes: 8 additions & 15 deletions archinstall/lib/locale/locale.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down