Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/user_interaction/general_conf.py
diff options
context:
space:
mode:
authorDaniel Girtler <blackrabbit256@gmail.com>2022-08-01 17:44:57 +1000
committerGitHub <noreply@github.com>2022-08-01 09:44:57 +0200
commitcfea0d6d1a6f6b82fd4b65abd2124c8fc0530949 (patch)
tree2596c8117ca7be7e6ed0885e6110dc1e288be843 /archinstall/lib/user_interaction/general_conf.py
parent3bc39225458b32fcd43b8a5b76dbb6797723a86c (diff)
Update translations (#1348)
* Show translations in own tongue * Fix flake8 * Update * Update * Update * Update * fix mypy * Update * Update Co-authored-by: Daniel Girtler <girtler.daniel@gmail.com>
Diffstat (limited to 'archinstall/lib/user_interaction/general_conf.py')
-rw-r--r--archinstall/lib/user_interaction/general_conf.py21
1 files changed, 15 insertions, 6 deletions
diff --git a/archinstall/lib/user_interaction/general_conf.py b/archinstall/lib/user_interaction/general_conf.py
index 15c42b86..bdc602b3 100644
--- a/archinstall/lib/user_interaction/general_conf.py
+++ b/archinstall/lib/user_interaction/general_conf.py
@@ -12,7 +12,7 @@ from ..output import log
from ..profiles import Profile, list_profiles
from ..mirrors import list_mirrors
-from ..translation import Translation
+from ..translationhandler import Language
from ..packages.packages import validate_package_list
from ..storage import storage
@@ -118,13 +118,22 @@ def select_mirror_regions(preset_values: Dict[str, Any] = {}) -> Dict[str, Any]:
case _: return {selected: mirrors[selected] for selected in selected_mirror.value}
-def select_archinstall_language(preset_values: str):
- languages = Translation.get_available_lang()
- choice = Menu(_('Archinstall language'), languages, default_option=preset_values).run()
+def select_archinstall_language(languages: List[Language], preset_value: Language) -> Language:
+ # these are the displayed language names which can either be
+ # the english name of a language or, if present, the
+ # name of the language in its own language
+ options = {lang.display_name: lang for lang in languages}
+
+ choice = Menu(
+ _('Archinstall language'),
+ list(options.keys()),
+ default_option=preset_value.display_name
+ ).run()
match choice.type_:
- case MenuSelectionType.Esc: return preset_values
- case MenuSelectionType.Selection: return choice.value
+ case MenuSelectionType.Esc: return preset_value
+ case MenuSelectionType.Selection:
+ return options[choice.value]
def select_profile(preset) -> Optional[Profile]: