From d7e23c847f4901b039b5a78c92e63ffa20b31268 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Sat, 22 May 2021 20:40:20 +0200 Subject: Added in the option to select system locale if --advance is given to guided, as it does potentially cause issues in the installation if not configured properly --- examples/guided.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/examples/guided.py b/examples/guided.py index e60cd0f8..122f0804 100644 --- a/examples/guided.py +++ b/examples/guided.py @@ -51,6 +51,17 @@ def ask_user_questions(): selected_region = archinstall.arguments['mirror-region'] archinstall.arguments['mirror-region'] = {selected_region: archinstall.list_mirrors()[selected_region]} + if not archinstall.arguments.get('sys-language', None) and archinstall.arguments.get('advanced', False): + archinstall.arguments['sys-language'] = input("Enter a valid locale (language) for your OS, (Default: en_US): ").strip() + archinstall.arguments['sys-encoding'] = input("Enter a valid system default encoding for your OS, (Default: utf-8): ").strip() + + if not archinstall.arguments['sys-language']: + archinstall.arguments['sys-language'] = 'en_US' + if not archinstall.arguments['sys-encoding']: + archinstall.arguments['sys-encoding'] = 'utf-8' + + archinstall.log("Keep in mind that if you want multiple locales, post configuration is required.", fg="yellow") + # Ask which harddrive/block-device we will install to if archinstall.arguments.get('harddrive', None): archinstall.arguments['harddrive'] = archinstall.BlockDevice(archinstall.arguments['harddrive']) @@ -328,6 +339,7 @@ def perform_installation(mountpoint): if archinstall.arguments.get('mirror-region', None): archinstall.use_mirrors(archinstall.arguments['mirror-region']) # Set the mirrors for the live medium if installation.minimal_installation(): + installation.set_locale(archinstall.arguments['sys-language'], archinstall.arguments['sys-encoding'].upper()) installation.set_hostname(archinstall.arguments['hostname']) if archinstall.arguments['mirror-region'].get("mirrors", None) is not None: installation.set_mirrors(archinstall.arguments['mirror-region']) # Set the mirrors in the installation medium -- cgit v1.2.3-70-g09d2