DEENG-378 Uses the cached native lang descript...

...tion to format the checkbox caption
This commit is contained in:
Carlos Nihelton 2022-08-23 09:51:39 -03:00
parent 7502b48147
commit 1fab813d8a
No known key found for this signature in database
GPG Key ID: 6FE346D245197E9A
2 changed files with 10 additions and 3 deletions

View File

@ -27,7 +27,10 @@ class WSLSetupOptionsController(SubiquityTuiController):
async def make_ui(self):
data = await self.endpoint.GET()
return WSLSetupOptionsView(self, data)
log.debug("%s", self.app)
cur_lang = self.app.native_language
return WSLSetupOptionsView(self, data, cur_lang)
def run_answers(self):
if all(elem in self.answers for elem in

View File

@ -30,10 +30,12 @@ from subiquitycore.ui.utils import screen
from subiquitycore.view import BaseView
from subiquity.common.types import WSLSetupOptions
CAPTION = _("Install packages for better {lang} language support")
class WSLSetupOptionsForm(Form):
install_language_support_packages = \
BooleanField(_("Install packages for better language support"),
BooleanField("",
help=_("Not recommended for slow internet connections."))
@ -41,7 +43,7 @@ class WSLSetupOptionsView(BaseView):
title = _("Enhance your experience")
excerpt = _("Adjust the following options for a more complete experience.")
def __init__(self, controller, configuration_data):
def __init__(self, controller, configuration_data, cur_lang):
self.controller = controller
initial = {
@ -49,6 +51,8 @@ class WSLSetupOptionsView(BaseView):
configuration_data.install_language_support_packages,
}
self.form = WSLSetupOptionsForm(initial=initial)
self.form.install_language_support_packages.caption = \
CAPTION.format(lang=cur_lang)
connect_signal(self.form, 'submit', self.done)
super().__init__(