diff --git a/features/i18n.feature b/features/i18n.feature index 6fb938ab1a..3b6758a1d5 100644 --- a/features/i18n.feature +++ b/features/i18n.feature @@ -10,6 +10,22 @@ Feature: Pro supports multiple languages """ Esta máquina NÃO está vinculada a uma assinatura do Ubuntu Pro. """ + When I run shell command `LANGUAGE=pt_BR.UTF-8 pro status --all` as non-root + Then stdout contains substring: + """ + sim + """ + Then stdout contains substring: + """ + não + """ + When I run `apt update` with sudo + And I apt install `jq` + And I run shell command `LANGUAGE=pt_BR.UTF-8 pro status --format json | jq .services[0].available` as non-root + Then I will see the following on stdout: + """ + "yes" + """ When I run `apt-get remove -y ubuntu-pro-client-l10n` with sudo When I run shell command `LANGUAGE=pt_BR.UTF-8 pro security-status` as non-root Then stdout contains substring: diff --git a/uaclient/messages/__init__.py b/uaclient/messages/__init__.py index 37b85e017e..2b3a2773e5 100644 --- a/uaclient/messages/__init__.py +++ b/uaclient/messages/__init__.py @@ -40,6 +40,9 @@ class TxtColor: ENDC = "\033[0m" +STANDALONE_YES = t.gettext("yes") +STANDALONE_NO = t.gettext("no") + OKGREEN_CHECK = TxtColor.OKGREEN + "✔" + TxtColor.ENDC FAIL_X = TxtColor.FAIL + "✘" + TxtColor.ENDC BLUE_INFO = TxtColor.INFOBLUE + "[info]" + TxtColor.ENDC @@ -808,8 +811,8 @@ class TxtColor: STATUS_NOTICES = t.gettext("NOTICES") STATUS_FEATURES = t.gettext("FEATURES") -STATUS_ENTITLED_ENTITLED = t.gettext("yes") -STATUS_ENTITLED_UNENTITLED = t.gettext("no") +STATUS_ENTITLED_ENTITLED = STANDALONE_YES +STATUS_ENTITLED_UNENTITLED = STANDALONE_NO STATUS_STATUS_ENABLED = t.gettext("enabled") STATUS_STATUS_DISABLED = t.gettext("disabled") STATUS_STATUS_INAPPLICABLE = t.gettext("n/a") diff --git a/uaclient/status.py b/uaclient/status.py index 9817488ea6..72ddb5a43f 100644 --- a/uaclient/status.py +++ b/uaclient/status.py @@ -679,10 +679,15 @@ def format_tabular(status: Dict[str, Any], show_all: bool = False) -> str: if descr_override else service.get("description", "") ) + available = ( + messages.STANDALONE_YES + if service.get("available") == "yes" + else messages.STANDALONE_NO + ) content.append( STATUS_UNATTACHED_TMPL.format( name=service.get("name", ""), - available=service.get("available", ""), + available=available, description=description, ) )