prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  locale language only en_US
  archlinux-2023.09.01-x86_64.iso
  
  </issue>
  <code>
  [start of archinstall/lib/locale/locale.py]
  1 from typing import Iterator, List
  2 
  3 from ..exceptions import ServiceException, SysCallError
  4 from ..general import SysCommand
  5 from ..output import error
  6 
  7 
  8 def list_keyboard_languages() -> Iterator[str]:
  9 	for line in SysCommand("localectl --no-pager list-keymaps", environment_vars={'SYSTEMD_COLORS': '0'}):
  10 		yield line.decode('UTF-8').strip()
  11 
  12 
  13 def list_locales() -> List[str]:
  14 	with open('/etc/locale.gen', 'r') as fp:
  15 		locales = []
  16 		# before the list of locales begins there's an empty line with a '#' in front
  17 		# so we'll collect the localels from bottom up and halt when we're donw
  18 		entries = fp.readlines()
  19 		entries.reverse()
  20 
  21 		for entry in entries:
  22 			text = entry.replace('#', '').strip()
  23 			if text == '':
  24 				break
  25 			locales.append(text)
  26 
  27 		locales.reverse()
  28 		return locales
  29 
  30 
  31 def list_x11_keyboard_languages() -> Iterator[str]:
  32 	for line in SysCommand("localectl --no-pager list-x11-keymap-layouts", environment_vars={'SYSTEMD_COLORS': '0'}):
  33 		yield line.decode('UTF-8').strip()
  34 
  35 
  36 def verify_keyboard_layout(layout :str) -> bool:
  37 	for language in list_keyboard_languages():
  38 		if layout.lower() == language.lower():
  39 			return True
  40 	return False
  41 
  42 
  43 def verify_x11_keyboard_layout(layout :str) -> bool:
  44 	for language in list_x11_keyboard_languages():
  45 		if layout.lower() == language.lower():
  46 			return True
  47 	return False
  48 
  49 
  50 def set_kb_layout(locale :str) -> bool:
  51 	if len(locale.strip()):
  52 		if not verify_keyboard_layout(locale):
  53 			error(f"Invalid keyboard locale specified: {locale}")
  54 			return False
  55 
  56 		try:
  57 			SysCommand(f'localectl set-keymap {locale}')
  58 		except SysCallError as err:
  59 			raise ServiceException(f"Unable to set locale '{locale}' for console: {err}")
  60 
  61 		return True
  62 
  63 	return False
  64 
  65 
  66 def list_timezones() -> Iterator[str]:
  67 	for line in SysCommand("timedatectl --no-pager list-timezones", environment_vars={'SYSTEMD_COLORS': '0'}):
  68 		yield line.decode('UTF-8').strip()
  69
  [end of archinstall/lib/locale/locale.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: 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_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]:
  
verification_info: {"golden_diff": "diff --git a/archinstall/lib/locale/locale.py b/archinstall/lib/locale/locale.py\n--- a/archinstall/lib/locale/locale.py\n+++ b/archinstall/lib/locale/locale.py\n@@ -11,21 +11,14 @@\n \n \n def list_locales() -> List[str]:\n-\twith open('/etc/locale.gen', 'r') as fp:\n-\t\tlocales = []\n-\t\t# before the list of locales begins there's an empty line with a '#' in front\n-\t\t# so we'll collect the localels from bottom up and halt when we're donw\n-\t\tentries = fp.readlines()\n-\t\tentries.reverse()\n-\n-\t\tfor entry in entries:\n-\t\t\ttext = entry.replace('#', '').strip()\n-\t\t\tif text == '':\n-\t\t\t\tbreak\n-\t\t\tlocales.append(text)\n-\n-\t\tlocales.reverse()\n-\t\treturn locales\n+\tlocales = []\n+\n+\twith open('/usr/share/i18n/SUPPORTED') as file:\n+\t\tfor line in file:\n+\t\t\tif line != 'C.UTF-8 UTF-8\\n':\n+\t\t\t\tlocales.append(line.rstrip())\n+\n+\treturn locales\n \n \n def list_x11_keyboard_languages() -> Iterator[str]:\n", "issue": "locale language only en_US\narchlinux-2023.09.01-x86_64.iso\n", "before_files": [{"content": "from typing import Iterator, List\n\nfrom ..exceptions import ServiceException, SysCallError\nfrom ..general import SysCommand\nfrom ..output import error\n\n\ndef list_keyboard_languages() -> Iterator[str]:\n\tfor line in SysCommand(\"localectl --no-pager list-keymaps\", environment_vars={'SYSTEMD_COLORS': '0'}):\n\t\tyield line.decode('UTF-8').strip()\n\n\ndef list_locales() -> List[str]:\n\twith open('/etc/locale.gen', 'r') as fp:\n\t\tlocales = []\n\t\t# before the list of locales begins there's an empty line with a '#' in front\n\t\t# so we'll collect the localels from bottom up and halt when we're donw\n\t\tentries = fp.readlines()\n\t\tentries.reverse()\n\n\t\tfor entry in entries:\n\t\t\ttext = entry.replace('#', '').strip()\n\t\t\tif text == '':\n\t\t\t\tbreak\n\t\t\tlocales.append(text)\n\n\t\tlocales.reverse()\n\t\treturn locales\n\n\ndef list_x11_keyboard_languages() -> Iterator[str]:\n\tfor line in SysCommand(\"localectl --no-pager list-x11-keymap-layouts\", environment_vars={'SYSTEMD_COLORS': '0'}):\n\t\tyield line.decode('UTF-8').strip()\n\n\ndef verify_keyboard_layout(layout :str) -> bool:\n\tfor language in list_keyboard_languages():\n\t\tif layout.lower() == language.lower():\n\t\t\treturn True\n\treturn False\n\n\ndef verify_x11_keyboard_layout(layout :str) -> bool:\n\tfor language in list_x11_keyboard_languages():\n\t\tif layout.lower() == language.lower():\n\t\t\treturn True\n\treturn False\n\n\ndef set_kb_layout(locale :str) -> bool:\n\tif len(locale.strip()):\n\t\tif not verify_keyboard_layout(locale):\n\t\t\terror(f\"Invalid keyboard locale specified: {locale}\")\n\t\t\treturn False\n\n\t\ttry:\n\t\t\tSysCommand(f'localectl set-keymap {locale}')\n\t\texcept SysCallError as err:\n\t\t\traise ServiceException(f\"Unable to set locale '{locale}' for console: {err}\")\n\n\t\treturn True\n\n\treturn False\n\n\ndef list_timezones() -> Iterator[str]:\n\tfor line in SysCommand(\"timedatectl --no-pager list-timezones\", environment_vars={'SYSTEMD_COLORS': '0'}):\n\t\tyield line.decode('UTF-8').strip()\n", "path": "archinstall/lib/locale/locale.py"}]}