Repository: archlinux/archinstall

Issue:
locale language only en_US
archlinux-2023.09.01-x86_64.iso


Discussion:
Could you describe the problem a bit more?
in archlinux-2023.09.01-x86_64.iso, locale language only has the en_US option, but multiple languages can be selected in archlinux-2023.08.01-x86_64.iso
Here is a preview of the options that appear.

[![locale-language.png](https://i.postimg.cc/635X4Jm7/locale-language.png)](https://postimg.cc/5HGGDG11)

When you type / , no option appears
Very interesting, I'll have a look 
@amonetlol I'm unable to reproduce this 
![image](https://github.com/archlinux/archinstall/assets/19396770/c8195741-bf7b-4aac-8e1d-51ef2c0c3566)
![image](https://github.com/archlinux/archinstall/assets/19396770/6119b827-fa6f-4fa9-911b-a9c21aff634c)
![image](https://github.com/archlinux/archinstall/assets/19396770/812804c6-24ab-4831-a540-16ad6ac6d704)


How do you run archinstall? Is it a special script? 
@svartkanin

I don't do anything special, just set the keyboard layout. However, if I go directly to archinstall it has the same result.

I recorded a video
[![archinstall](https://img.youtube.com/vi/A4sGlCxOjNU/maxresdefault.jpg)](https://youtu.be/A4sGlCxOjNU)

vmware-workstation: 17.0.2-2
Thanks for the video that was very helpful! 
Unfortunately I still can't reproduce this :thinking: 
I did the exact same steps as in the video on a  VM using the latest master and the current shipped version on the ISO but both seem to work fine. 

The locale languages are populated from the file `/etc/locale.gen` could you have a look at this file and see what's inside? 
@svartkanin 

![Locale.gen](https://github.com/archlinux/archinstall/assets/65382640/a20c837f-89be-49a3-b457-9e1dc911656c)

Found the problem. When the system is loading, some errors about cloud-init appear. This must be the reason for the generation of incomplete locale.gen

I manually inserted the pt_BR language in /etc/locale.gen and now it appears listed as an option.

![Screenshot_2023-09-18-17-06-26_3840x1080](https://github.com/archlinux/archinstall/assets/65382640/5631b7a9-cee8-445a-9464-c23c5ad30c48)


Yep seems like cloud-init initialised it that way, not something archinstall can do about 

Resolving patch:
diff --git a/archinstall/lib/locale/locale.py b/archinstall/lib/locale/locale.py
--- 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]:


Test patch: