Modify archinstall language display to be handled like other sections. (#4048)

* Modify archinstall language display to be handled like other sections.
This fixes a bug where language names that were too long would break curses menu.

* Revert types change
This commit is contained in:
HADEON 2025-12-31 00:46:46 +01:00 committed by GitHub
parent eb5e88f317
commit 83c9bf06b2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 1 deletions

View File

@ -56,7 +56,7 @@ class GlobalMenu(AbstractMenu[None]):
MenuItem(
text=tr('Archinstall language'),
action=self._select_archinstall_language,
display_action=lambda x: x.display_name if x else '',
preview_action=self._prev_archinstall_language,
key='archinstall_language',
),
MenuItem(
@ -239,6 +239,13 @@ class GlobalMenu(AbstractMenu[None]):
return language
def _prev_archinstall_language(self, item: MenuItem) -> str | None:
if not item.value:
return None
lang: Language = item.value
return f'{tr("Language")}: {lang.display_name}'
def _select_applications(self, preset: ApplicationConfiguration | None) -> ApplicationConfiguration | None:
app_config = ApplicationMenu(preset).run()
return app_config