From 83c9bf06b25854647eef6b6b4445fc2348b80b2d Mon Sep 17 00:00:00 2001 From: HADEON <52324046+h8d13@users.noreply.github.com> Date: Wed, 31 Dec 2025 00:46:46 +0100 Subject: [PATCH] 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 --- archinstall/lib/global_menu.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/archinstall/lib/global_menu.py b/archinstall/lib/global_menu.py index 09b5ffd9..6362b947 100644 --- a/archinstall/lib/global_menu.py +++ b/archinstall/lib/global_menu.py @@ -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