Select the installer language before wifi menu

The wifi menu was always shown in English, even though translations
exist. This is because it's launched before the main menu, and the user
has no chance to select the archinstall language.

Now there's a language selection menu before the internet connection
check.
This commit is contained in:
Lena Pastwa 2026-06-10 18:01:35 +02:00
parent 919a435a6b
commit 15b895bdf8
No known key found for this signature in database
GPG Key ID: 754E0B69FF823C43
2 changed files with 18 additions and 3 deletions

View File

@ -107,7 +107,8 @@ async def select_archinstall_language(languages: list[Language], preset: Languag
title = 'NOTE: Console font will be set automatically for supported languages.\n'
title += 'For other languages, fonts can be found in "/usr/share/kbd/consolefonts"\n'
title += 'and set manually with: setfont <fontname>\n'
title += 'and set manually with: setfont <fontname>\n\n'
title += 'Select the archinstall language'
result = await Selection[Language](
header=title,

View File

@ -7,9 +7,11 @@ import textwrap
import time
import traceback
from pathlib import Path
from typing import override
from archinstall.lib.args import ArchConfigHandler, SubCommand
from archinstall.lib.disk.utils import disk_layouts
from archinstall.lib.general.general_menu import select_archinstall_language
from archinstall.lib.hardware import SysInfo
from archinstall.lib.log import debug, error, info, logger, share_install_log, warn
from archinstall.lib.menu.helpers import Confirmation
@ -17,9 +19,9 @@ from archinstall.lib.network.wifi_handler import WifiHandler
from archinstall.lib.networking import ping
from archinstall.lib.packages.util import check_version_upgrade
from archinstall.lib.pacman.pacman import Pacman
from archinstall.lib.translationhandler import tr, translation_handler
from archinstall.lib.translationhandler import Language, tr, translation_handler
from archinstall.lib.utils.util import running_from_iso
from archinstall.tui.components import tui
from archinstall.tui.components import InstanceRunnable, tui
from archinstall.tui.menu_item import MenuItemGroup
@ -107,6 +109,15 @@ def _share_log_command() -> None:
error(tr('Failed to upload log.'))
class LangSelect(InstanceRunnable[Language]):
@override
async def run(self) -> Language:
preset_lang = translation_handler.get_language_by_name('English')
selected_lang = await select_archinstall_language(translation_handler.translated_languages, preset_lang)
translation_handler.activate(selected_lang)
return selected_lang
def run() -> int:
"""
This can either be run as the compiled and installed application: python setup.py install
@ -140,6 +151,9 @@ def run() -> int:
_log_sys_info()
# The main menu isn't shown if there's no internet, and so the user wouldn't be able to select a language if not for this.
arch_config_handler.config.archinstall_language = tui.run(LangSelect())
if not arch_config_handler.args.offline:
if not arch_config_handler.args.skip_wifi_check:
wifi_handler = WifiHandler()