Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/user_interaction.py
diff options
context:
space:
mode:
authorDaniel <blackrabbit256@gmail.com>2022-02-15 18:44:58 +1100
committerGitHub <noreply@github.com>2022-02-15 08:44:58 +0100
commit6489a417aa8d43bd58ec0fd1268d0dd734b0073f (patch)
tree476033ff0d6a2650ff5202f42b248e7b4bbe2f8d /archinstall/lib/user_interaction.py
parentd9118a33b3a25839fde8626cde313115ddb79376 (diff)
Fix #966 - DeferredTranslation errors (#976)
* Fix #966 * Add types to parameters * Update network configuration * Backwards compability for nic config * Update Co-authored-by: Daniel Girtler <girtler.daniel@gmail.com>
Diffstat (limited to 'archinstall/lib/user_interaction.py')
-rw-r--r--archinstall/lib/user_interaction.py31
1 files changed, 14 insertions, 17 deletions
diff --git a/archinstall/lib/user_interaction.py b/archinstall/lib/user_interaction.py
index f8822bac..94a05e89 100644
--- a/archinstall/lib/user_interaction.py
+++ b/archinstall/lib/user_interaction.py
@@ -30,7 +30,7 @@ from .mirrors import list_mirrors
# TODO: Some inconsistencies between the selection processes.
# Some return the keys from the options, some the values?
-from .translation import Translation
+from .translation import Translation, DeferredTranslation
from .disk.validators import fs_types
from .packages.packages import validate_package_list
@@ -428,22 +428,22 @@ def ask_to_configure_network() -> Dict[str, Any]:
# Optionally configure one network interface.
# while 1:
# {MAC: Ifname}
-
- iso_config = _('Copy ISO network configuration to installation')
- network_manager = _('Use NetworkManager (necessary to configure internet graphically in GNOME and KDE)')
-
interfaces = {
- 'ISO-CONFIG': iso_config,
- 'NetworkManager': network_manager,
+ 'iso_config': str(_('Copy ISO network configuration to installation')),
+ 'network_manager': str(_('Use NetworkManager (necessary to configure internet graphically in GNOME and KDE)')),
**list_interfaces()
}
nic = Menu(_('Select one network interface to configure'), list(interfaces.values())).run()
- if nic and nic != iso_config:
- if nic == network_manager:
- return {'nic': nic, 'NetworkManager': True}
+ if not nic:
+ return {}
+ if nic == interfaces['iso_config']:
+ return {'type': 'iso_config'}
+ elif nic == interfaces['network_manager']:
+ return {'type': 'network_manager', 'NetworkManager': True}
+ else:
# Current workaround:
# For selecting modes without entering text within brackets,
# printing out this part separate from options, passed in
@@ -491,13 +491,10 @@ def ask_to_configure_network() -> Dict[str, Any]:
if len(dns_input):
dns = dns_input.split(' ')
- return {'nic': nic, 'dhcp': False, 'ip': ip, 'gateway': gateway, 'dns': dns}
+ return {'type': nic, 'dhcp': False, 'ip': ip, 'gateway': gateway, 'dns': dns}
else:
- return {'nic': nic}
- elif nic:
- return nic
-
- return {}
+ # this will contain network iface names
+ return {'type': nic}
def partition_overlap(partitions :list, start :str, end :str) -> bool:
@@ -925,7 +922,7 @@ def select_driver(options :Dict[str, Any] = AVAILABLE_GFX_DRIVERS, force_ask :bo
if drivers:
arguments = storage.get('arguments', {})
- title = ''
+ title = DeferredTranslation('')
if has_amd_graphics():
title += _('For the best compatibility with your AMD hardware, you may want to use either the all open-source or AMD / ATI options.') + '\n'