From b7c77e7323f4a972ff5de427c27c2832a3befb5c Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 14 Feb 2019 18:52:19 +0100 Subject: [PATCH] [services-systemd] Make user-visible messages translatable --- src/modules/services-systemd/main.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/modules/services-systemd/main.py b/src/modules/services-systemd/main.py index 7367f988c..1cb5899ae 100644 --- a/src/modules/services-systemd/main.py +++ b/src/modules/services-systemd/main.py @@ -58,17 +58,16 @@ def systemctl(targets, command, suffix): ) if ec != 0: + libcalamares.utils.warning( + "Cannot {} systemd {} {}".format(command, suffix, name) + ) + libcalamares.utils.warning( + "systemctl {} call in chroot returned error code {}".format(command, ec) + ) if mandatory: - return ("Cannot {} systemd {} {}".format(command, suffix, name), - "systemctl {} call in chroot returned error code {}".format(command, ec) + return (_("Cannot {} systemd {} {}").format(command, suffix, name), + _("systemctl {} call in chroot returned error code {}").format(command, ec) ) - else: - libcalamares.utils.warning( - "Cannot {} systemd {} {}".format(command, suffix, name) - ) - libcalamares.utils.warning( - "systemctl {} call in chroot returned error code {}".format(command, ec) - ) return None @@ -103,6 +102,4 @@ def run(): if r is not None: return r - - # This could have just been return r return None