Merge branch 'add-python-translations'
This commit is contained in:
commit
302b3cf0c4
@ -6,6 +6,7 @@
|
|||||||
# Copyright 2014, Kevin Kofler <kevin.kofler@chello.at>
|
# Copyright 2014, Kevin Kofler <kevin.kofler@chello.at>
|
||||||
# Copyright 2016, Philip Müller <philm@manjaro.org>
|
# Copyright 2016, Philip Müller <philm@manjaro.org>
|
||||||
# Copyright 2017, Alf Gaida <agaida@siduction.org>
|
# Copyright 2017, Alf Gaida <agaida@siduction.org>
|
||||||
|
# Copyright 2019, Adriaan de Groot <groot@kde.org>
|
||||||
#
|
#
|
||||||
# Calamares is free software: you can redistribute it and/or modify
|
# Calamares is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
# Copyright 2016, Artoo <artoo@manjaro.org>
|
# Copyright 2016, Artoo <artoo@manjaro.org>
|
||||||
# Copyright 2017, Alf Gaida <agaida@siduction.org>
|
# Copyright 2017, Alf Gaida <agaida@siduction.org>
|
||||||
# Copyright 2018, Gabriel Craciunescu <crazy@frugalware.org>
|
# Copyright 2018, Gabriel Craciunescu <crazy@frugalware.org>
|
||||||
|
# Copyright 2019, Adriaan de Groot <groot@kde.org>
|
||||||
#
|
#
|
||||||
# Calamares is free software: you can redistribute it and/or modify
|
# Calamares is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@ -24,6 +25,16 @@ import libcalamares
|
|||||||
|
|
||||||
from libcalamares.utils import debug, target_env_call
|
from libcalamares.utils import debug, target_env_call
|
||||||
|
|
||||||
|
import gettext
|
||||||
|
_ = gettext.translation("calamares-python",
|
||||||
|
localedir=libcalamares.utils.gettext_path(),
|
||||||
|
languages=libcalamares.utils.gettext_languages(),
|
||||||
|
fallback=True).gettext
|
||||||
|
|
||||||
|
|
||||||
|
def pretty_name():
|
||||||
|
return _("Configure Plymouth theme")
|
||||||
|
|
||||||
|
|
||||||
class PlymouthController:
|
class PlymouthController:
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#
|
#
|
||||||
# Copyright 2015, Teo Mrnjavac <teo@kde.org>
|
# Copyright 2015, Teo Mrnjavac <teo@kde.org>
|
||||||
# Copyright 2017. Alf Gaida <agaida@siduction.org>
|
# Copyright 2017. Alf Gaida <agaida@siduction.org>
|
||||||
|
# Copyright 2019, Adriaan de Groot <groot@kde.org>
|
||||||
#
|
#
|
||||||
# Calamares is free software: you can redistribute it and/or modify
|
# Calamares is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@ -22,6 +23,16 @@
|
|||||||
import subprocess
|
import subprocess
|
||||||
import libcalamares
|
import libcalamares
|
||||||
|
|
||||||
|
import gettext
|
||||||
|
_ = gettext.translation("calamares-python",
|
||||||
|
localedir=libcalamares.utils.gettext_path(),
|
||||||
|
languages=libcalamares.utils.gettext_languages(),
|
||||||
|
fallback=True).gettext
|
||||||
|
|
||||||
|
|
||||||
|
def pretty_name():
|
||||||
|
return _("Remove live user from target system")
|
||||||
|
|
||||||
|
|
||||||
def run():
|
def run():
|
||||||
"""
|
"""
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
# Copyright 2016, Artoo <artoo@manjaro.org>
|
# Copyright 2016, Artoo <artoo@manjaro.org>
|
||||||
# Copyright 2017, Philip Müller <philm@manjaro.org>
|
# Copyright 2017, Philip Müller <philm@manjaro.org>
|
||||||
# Copyright 2018, Artoo <artoo@artixlinux.org>
|
# Copyright 2018, Artoo <artoo@artixlinux.org>
|
||||||
# Copyright 2018, Adriaan de Groot <groot@kde.org>
|
# Copyright 2018-2019, Adriaan de Groot <groot@kde.org>
|
||||||
#
|
#
|
||||||
# Calamares is free software: you can redistribute it and/or modify
|
# Calamares is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@ -27,6 +27,17 @@ from libcalamares.utils import target_env_call, warning
|
|||||||
from os.path import exists, join
|
from os.path import exists, join
|
||||||
|
|
||||||
|
|
||||||
|
import gettext
|
||||||
|
_ = gettext.translation("calamares-python",
|
||||||
|
localedir=libcalamares.utils.gettext_path(),
|
||||||
|
languages=libcalamares.utils.gettext_languages(),
|
||||||
|
fallback=True).gettext
|
||||||
|
|
||||||
|
|
||||||
|
def pretty_name():
|
||||||
|
return _("Configure OpenRC services")
|
||||||
|
|
||||||
|
|
||||||
class OpenrcController:
|
class OpenrcController:
|
||||||
"""
|
"""
|
||||||
This is the openrc service controller.
|
This is the openrc service controller.
|
||||||
@ -69,24 +80,22 @@ class OpenrcController:
|
|||||||
if exists(runlevel_path):
|
if exists(runlevel_path):
|
||||||
ec = target_env_call(["rc-update", state, name, runlevel])
|
ec = target_env_call(["rc-update", state, name, runlevel])
|
||||||
if ec != 0:
|
if ec != 0:
|
||||||
|
warning("Cannot {} service {} to {}".format(state, name, runlevel))
|
||||||
|
warning("rc-update returned error code {!s}".format(ec))
|
||||||
if mandatory:
|
if mandatory:
|
||||||
return ("Cannot {} service {} to {}".format(state, name, runlevel),
|
return (_("Cannot {} service {} to {}").format(state, name, runlevel),
|
||||||
"rc-update {} call in chroot returned error code {}".format(state, ec)
|
_("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:
|
else:
|
||||||
|
warning("Target runlevel {} does not exist for {}.".format(runlevel, name))
|
||||||
if mandatory:
|
if mandatory:
|
||||||
return ("Target runlevel {} does not exist for {}.".format(runlevel, name),
|
return (_("Target runlevel {} does not exist for {}.").format(runlevel, name),
|
||||||
"No {} found.".format(runlevel_path))
|
_("No {} found.").format(runlevel_path))
|
||||||
else:
|
|
||||||
warning("Target runlevel {} does not exist for {}.".format(runlevel, name))
|
|
||||||
else:
|
else:
|
||||||
|
warning("Target service {} does not exist in {}.".format(name, self.initdDir))
|
||||||
if mandatory:
|
if mandatory:
|
||||||
return ("Target service {} does not exist.".format(name),
|
return (_("Target service {} does not exist.").format(name),
|
||||||
"No {} found.".format(service_path))
|
_("No {} found.").format(service_path))
|
||||||
else:
|
|
||||||
warning("Target service {} does not exist in {}.".format(name, self.initdDir))
|
|
||||||
|
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
# Copyright 2014, Philip Müller <philm@manjaro.org>
|
# Copyright 2014, Philip Müller <philm@manjaro.org>
|
||||||
# Copyright 2014, Teo Mrnjavac <teo@kde.org>
|
# Copyright 2014, Teo Mrnjavac <teo@kde.org>
|
||||||
# Copyright 2017, Alf Gaida <agaida@siduction.org>
|
# Copyright 2017, Alf Gaida <agaida@siduction.org>
|
||||||
# Copyright 2018, Adriaan de Groot <groot@kde.org>
|
# Copyright 2018-2019, Adriaan de Groot <groot@kde.org>
|
||||||
#
|
#
|
||||||
# Calamares is free software: you can redistribute it and/or modify
|
# Calamares is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@ -24,6 +24,17 @@
|
|||||||
import libcalamares
|
import libcalamares
|
||||||
|
|
||||||
|
|
||||||
|
import gettext
|
||||||
|
_ = gettext.translation("calamares-python",
|
||||||
|
localedir=libcalamares.utils.gettext_path(),
|
||||||
|
languages=libcalamares.utils.gettext_languages(),
|
||||||
|
fallback=True).gettext
|
||||||
|
|
||||||
|
|
||||||
|
def pretty_name():
|
||||||
|
return _("Configure systemd services")
|
||||||
|
|
||||||
|
|
||||||
def systemctl(targets, command, suffix):
|
def systemctl(targets, command, suffix):
|
||||||
"""
|
"""
|
||||||
For each entry in @p targets, run "systemctl <command> <thing>",
|
For each entry in @p targets, run "systemctl <command> <thing>",
|
||||||
@ -47,17 +58,16 @@ def systemctl(targets, command, suffix):
|
|||||||
)
|
)
|
||||||
|
|
||||||
if ec != 0:
|
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:
|
if mandatory:
|
||||||
return ("Cannot {} systemd {} {}".format(command, suffix, name),
|
return (_("Cannot {} systemd {} {}").format(command, suffix, name),
|
||||||
"systemctl {} call in chroot returned error code {}".format(command, ec)
|
_("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
|
return None
|
||||||
|
|
||||||
|
|
||||||
@ -92,6 +102,4 @@ def run():
|
|||||||
if r is not None:
|
if r is not None:
|
||||||
return r
|
return r
|
||||||
|
|
||||||
|
|
||||||
# This could have just been return r
|
|
||||||
return None
|
return None
|
||||||
|
Loading…
Reference in New Issue
Block a user