[services-openrc] Make user-visible messages translatable

main
Adriaan de Groot 6 years ago
parent c9f89e2929
commit 544c1b708c

@ -80,24 +80,22 @@ class OpenrcController:
if exists(runlevel_path):
ec = target_env_call(["rc-update", state, name, runlevel])
if ec != 0:
warning("Cannot {} service {} to {}".format(state, name, runlevel))
warning("rc-update returned error code {!s}".format(ec))
if mandatory:
return ("Cannot {} service {} to {}".format(state, name, runlevel),
"rc-update {} call in chroot returned error code {}".format(state, ec)
return (_("Cannot {} service {} to {}").format(state, name, runlevel),
_("rc-update {} call in chroot returned error code {}").format(state, ec)
)
else:
warning("Could not {} service {} in {}, error {!s}".format(state, name, runlevel, ec))
else:
warning("Target runlevel {} does not exist for {}.".format(runlevel, name))
if mandatory:
return ("Target runlevel {} does not exist for {}.".format(runlevel, name),
"No {} found.".format(runlevel_path))
else:
warning("Target runlevel {} does not exist for {}.".format(runlevel, name))
return (_("Target runlevel {} does not exist for {}.").format(runlevel, name),
_("No {} found.").format(runlevel_path))
else:
warning("Target service {} does not exist in {}.".format(name, self.initdDir))
if mandatory:
return ("Target service {} does not exist.".format(name),
"No {} found.".format(service_path))
else:
warning("Target service {} does not exist in {}.".format(name, self.initdDir))
return (_("Target service {} does not exist.").format(name),
_("No {} found.").format(service_path))
def run(self):

Loading…
Cancel
Save