From: Frank Brehm Date: Fri, 28 Dec 2018 11:18:09 +0000 (+0100) Subject: Translating lib/webhooks/deploy.py X-Git-Tag: 1.6.4^2~92 X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=b9af0407385b4ebfedf683d05371a496913de92a;p=pixelpark%2Fpuppetmaster-webhooks.git Translating lib/webhooks/deploy.py --- diff --git a/lib/webhooks/deploy.py b/lib/webhooks/deploy.py index 49bcce8..fc3b542 100644 --- a/lib/webhooks/deploy.py +++ b/lib/webhooks/deploy.py @@ -24,10 +24,15 @@ from . import __version__ from .base_app import BaseHookApp +from .xlate import XLATOR + LOG = logging.getLogger(__name__) DEFAULT_PARENT_DIR = '/etc/puppetlabs/code/fileserver' +_ = XLATOR.gettext +ngettext = XLATOR.ngettext + # ============================================================================= class WebhookDeployApp(BaseHookApp): @@ -39,10 +44,9 @@ class WebhookDeployApp(BaseHookApp): def __init__(self, appname=None, verbose=0, version=__version__): """Constructor.""" - description = textwrap.dedent('''\ - Receives push events as JSON-Data and synchronizes - the local repository. - ''').strip() + description = _( + 'Receives push events as JSON-Data and ' + 'synchronizes the local repository.') self.projects = { 'hiera': { @@ -176,7 +180,7 @@ class WebhookDeployApp(BaseHookApp): LOG.debug("Found project {!r}.".format(full_name)) return self.deploy(cfg) - msg = "Could not find a definition for project {!r}.".format(self.full_name) + msg = _("Could not find a definition for project {!r}.").format(self.full_name) self.error_data.append(msg) LOG.error(msg) @@ -199,18 +203,18 @@ class WebhookDeployApp(BaseHookApp): if 'branch' in cfg and cfg['branch']: branch = cfg['branch'] - LOG.info("Deploying working directory {f!r} for project {p!r} ...".format( + LOG.info(_("Deploying working directory {f!r} for project {p!r} ...").format( f=full_path, p=full_name)) if not os.access(parent_dir, os.F_OK): - msg = "Parent directory {d!r} of project {p!r} does not exists.".format( + msg = _("Parent directory {d!r} of project {p!r} does not exists.").format( d=parent_dir, p=full_name) LOG.error(msg) self.error_data.append(msg) return True if not os.path.isdir(parent_dir): - msg = ( + msg = _( "Path for parent directory {d!r} for project {p!r} " "is not a directory.").format(d=parent_dir, p=full_name) LOG.error(msg) @@ -239,14 +243,14 @@ class WebhookDeployApp(BaseHookApp): (ret_val, stdoutdata, stderrdata) = self.handler.call(cmd, sudo=self.do_sudo) if stdoutdata: - msg = "Output:\n{}".format(to_str(stdoutdata)) + msg = _("Output:") + "\n{}".format(to_str(stdoutdata)) self.print_out(msg) else: LOG.debug("No output.") if stderrdata: cmd_str = ' '.join(map(lambda x: pipes.quote(x), cmd)) - msg = "Error messages on '{c}':\n{e}".format(c=cmd_str, e=to_str(stderrdata)) + msg = _("Error messages on {c!r}:\n{e}").format(c=cmd_str, e=to_str(stderrdata)) if ret_val: self.error_data.append(msg) self.print_out(msg) diff --git a/locale/de_DE/LC_MESSAGES/puppetmaster_webhooks.po b/locale/de_DE/LC_MESSAGES/puppetmaster_webhooks.po index f780a36..68dc27b 100644 --- a/locale/de_DE/LC_MESSAGES/puppetmaster_webhooks.po +++ b/locale/de_DE/LC_MESSAGES/puppetmaster_webhooks.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: puppetmaster_webhooks 1.3.1\n" "Report-Msgid-Bugs-To: frank.brehm@pixelpark.com\n" -"POT-Creation-Date: 2018-12-28 11:49+0100\n" -"PO-Revision-Date: 2018-12-28 11:59+0100\n" +"POT-Creation-Date: 2018-12-28 12:16+0100\n" +"PO-Revision-Date: 2018-12-28 12:15+0100\n" "Last-Translator: Frank Brehm \n" "Language: de_DE\n" "Language-Team: de_DE \n" @@ -206,6 +206,40 @@ msgstr "Cache-Datei {!r} nicht lesbar." msgid "Could not evaluate content of {f!r}: {e}" msgstr "Konnte den Inhalt von {f!r} nicht auswerten: {e}" +#: lib/webhooks/deploy.py:47 +msgid "Receives push events as JSON-Data and synchronizes the local repository." +msgstr "" +"Empfängt Push-Ereignisse als JSON-Data und synchronisiert das entsprechende lokale " +"Arbeitsverzeichnis mit dem Repository." + +#: lib/webhooks/deploy.py:183 +msgid "Could not find a definition for project {!r}." +msgstr "Konnte keine Definition für das Projekt {!r} finden." + +#: lib/webhooks/deploy.py:206 +msgid "Deploying working directory {f!r} for project {p!r} ..." +msgstr "Aktualisiere Arbeitsverzeichnis {f!r} für das Projekt {p!r} ..." + +#: lib/webhooks/deploy.py:210 +msgid "Parent directory {d!r} of project {p!r} does not exists." +msgstr "Das übergeordnete Verzeichnis {d!r} des Projekts {p!r} existiert nicht." + +#: lib/webhooks/deploy.py:217 +msgid "Path for parent directory {d!r} for project {p!r} is not a directory." +msgstr "Der Pfad zum übergeordneten Verzeichnis {d!r} des Projekts {p!r} ist kein Verzeichnis." + +#: lib/webhooks/deploy.py:246 +msgid "Output:" +msgstr "Ausgabe:" + +#: lib/webhooks/deploy.py:253 +msgid "" +"Error messages on {c!r}:\n" +"{e}" +msgstr "" +"Fehlermeldungen von {c!r}:\n" +"{e}" + #: lib/webhooks/show_modules.py:58 msgid "Returns a list with all used Puppet modules." msgstr "Gibt eine Liste mit allen Puppet-Modulen zurück." diff --git a/locale/en_US/LC_MESSAGES/puppetmaster_webhooks.po b/locale/en_US/LC_MESSAGES/puppetmaster_webhooks.po index c3bb4b4..2437905 100644 --- a/locale/en_US/LC_MESSAGES/puppetmaster_webhooks.po +++ b/locale/en_US/LC_MESSAGES/puppetmaster_webhooks.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: puppetmaster_webhooks 1.3.1\n" "Report-Msgid-Bugs-To: frank.brehm@pixelpark.com\n" -"POT-Creation-Date: 2018-12-28 11:49+0100\n" +"POT-Creation-Date: 2018-12-28 12:16+0100\n" "PO-Revision-Date: 2018-12-28 09:57+0100\n" "Last-Translator: FULL NAME \n" "Language: en_US\n" @@ -196,6 +196,36 @@ msgstr "" msgid "Could not evaluate content of {f!r}: {e}" msgstr "" +#: lib/webhooks/deploy.py:47 +msgid "Receives push events as JSON-Data and synchronizes the local repository." +msgstr "" + +#: lib/webhooks/deploy.py:183 +msgid "Could not find a definition for project {!r}." +msgstr "" + +#: lib/webhooks/deploy.py:206 +msgid "Deploying working directory {f!r} for project {p!r} ..." +msgstr "" + +#: lib/webhooks/deploy.py:210 +msgid "Parent directory {d!r} of project {p!r} does not exists." +msgstr "" + +#: lib/webhooks/deploy.py:217 +msgid "Path for parent directory {d!r} for project {p!r} is not a directory." +msgstr "" + +#: lib/webhooks/deploy.py:246 +msgid "Output:" +msgstr "" + +#: lib/webhooks/deploy.py:253 +msgid "" +"Error messages on {c!r}:\n" +"{e}" +msgstr "" + #: lib/webhooks/show_modules.py:58 msgid "Returns a list with all used Puppet modules." msgstr "" diff --git a/locale/puppetmaster_webhooks.pot b/locale/puppetmaster_webhooks.pot index b282d6b..c34761b 100644 --- a/locale/puppetmaster_webhooks.pot +++ b/locale/puppetmaster_webhooks.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: puppetmaster_webhooks 1.4.2\n" "Report-Msgid-Bugs-To: frank.brehm@pixelpark.com\n" -"POT-Creation-Date: 2018-12-28 11:49+0100\n" +"POT-Creation-Date: 2018-12-28 12:16+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -195,6 +195,36 @@ msgstr "" msgid "Could not evaluate content of {f!r}: {e}" msgstr "" +#: lib/webhooks/deploy.py:47 +msgid "Receives push events as JSON-Data and synchronizes the local repository." +msgstr "" + +#: lib/webhooks/deploy.py:183 +msgid "Could not find a definition for project {!r}." +msgstr "" + +#: lib/webhooks/deploy.py:206 +msgid "Deploying working directory {f!r} for project {p!r} ..." +msgstr "" + +#: lib/webhooks/deploy.py:210 +msgid "Parent directory {d!r} of project {p!r} does not exists." +msgstr "" + +#: lib/webhooks/deploy.py:217 +msgid "Path for parent directory {d!r} for project {p!r} is not a directory." +msgstr "" + +#: lib/webhooks/deploy.py:246 +msgid "Output:" +msgstr "" + +#: lib/webhooks/deploy.py:253 +msgid "" +"Error messages on {c!r}:\n" +"{e}" +msgstr "" + #: lib/webhooks/show_modules.py:58 msgid "Returns a list with all used Puppet modules." msgstr ""