global_menu: wrap invalid config error message with the translation shim (#1908)

* global_menu: wrap invalid config error message with the translation shim

Signed-off-by: Anhad Singh <andypythonappdeveloper@gmail.com>

* validate_bootloader: add a caller note

XXX: The caller is responsible for wrapping the string with the translation
shim if necessary.

Signed-off-by: Anhad Singh <andypythonappdeveloper@gmail.com>

---------

Signed-off-by: Anhad Singh <andypythonappdeveloper@gmail.com>
This commit is contained in:
Anhad Singh 2023-07-01 04:29:18 +10:00 committed by GitHub
parent 10fc344097
commit ba9f2eea59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -336,6 +336,9 @@ class GlobalMenu(AbstractMenu):
Returns [`None`] if the bootloader is valid, otherwise returns a
string with the error message.
XXX: The caller is responsible for wrapping the string with the translation
shim if necessary.
"""
bootloader = self._menu_options['bootloader'].current_selection
boot_partition: Optional[disk.PartitionModification] = None
@ -363,7 +366,7 @@ class GlobalMenu(AbstractMenu):
return text[:-1] # remove last new line
if error := self._validate_bootloader():
return f"Invalid configuration: {error}"
return str(_(f"Invalid configuration: {error}"))
return None