Fix stupid encoding issue when fetching service description

This commit is contained in:
Alexandre Aubin 2020-08-24 15:41:41 +02:00
parent 8454f2ec12
commit 6ec0e7b6af

View file

@ -346,11 +346,15 @@ def _get_and_format_service_status(service, infos):
'configuration': "unknown",
}
translation_key = "service_description_%s" % service
# Try to get description directly from services.yml
description = infos.get("description")
# If no description was there, try to get it from the .json locales
if not description:
translation_key = "service_description_%s" % service
description = m18n.n(translation_key)
# If descrption is still equal to the translation key,
# that mean that we don't have a translation for this string
# that's the only way to test for that for now
# if we don't have it, uses the one provided by systemd