From: Frank Brehm Date: Fri, 28 Dec 2018 10:52:23 +0000 (+0100) Subject: Translating lib/webhooks/show_modules.py X-Git-Tag: 1.6.4^2~94 X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=d409ede37a445a23b22aec20cb94d53e2f79fd05;p=pixelpark%2Fpuppetmaster-webhooks.git Translating lib/webhooks/show_modules.py --- diff --git a/lib/webhooks/__init__.py b/lib/webhooks/__init__.py index e5f0161..c9460ff 100644 --- a/lib/webhooks/__init__.py +++ b/lib/webhooks/__init__.py @@ -1,6 +1,6 @@ #!/bin/env python3 # -*- coding: utf-8 -*- -__version__ = '1.4.1' +__version__ = '1.4.2' # vim: ts=4 et list diff --git a/lib/webhooks/show_modules.py b/lib/webhooks/show_modules.py index 56a4d5c..c6ba063 100644 --- a/lib/webhooks/show_modules.py +++ b/lib/webhooks/show_modules.py @@ -25,10 +25,15 @@ from . import __version__ from .base_app import BaseHookError, BaseHookApp, UncriticalHookError +from .xlate import XLATOR + LOG = logging.getLogger(__name__) DEFAULT_PARENT_DIR = '/etc/puppetlabs/code/fileserver' +_ = XLATOR.gettext +ngettext = XLATOR.ngettext + # ============================================================================= class ShowModulesError(BaseHookError): @@ -50,10 +55,7 @@ class ShowModulesApp(BaseHookApp): def __init__(self, output_type='json', appname=None, verbose=0, version=__version__): """Constructor.""" - description = textwrap.dedent('''\ - returns a list with all used Puppet modules - ''').strip() - + description = _('Returns a list with all used Puppet modules.') self.filters = None @@ -61,7 +63,7 @@ class ShowModulesApp(BaseHookApp): appname=appname, verbose=verbose, version=version, description=description, output_type=output_type) - self._html_title = "All Puppet modules." + self._html_title = _("All Puppet modules.") # ------------------------------------------------------------------------- def as_dict(self, short=True): @@ -166,7 +168,7 @@ class ShowModulesApp(BaseHookApp): try: regex_compiled = re.compile(regex, re.IGNORECASE) except Exception as e: - LOG.error("{c}: Invalid regular expression {r!r}: {e}".format( + LOG.error(_("{c}: Invalid regular expression {r!r}: {e}").format( c=e.__class__.__name__, r=regex, e=e)) else: if 're' not in self.filters: @@ -224,7 +226,7 @@ class ShowModulesApp(BaseHookApp): if not len(module_infos): self.print_out() - self.print_out('

Keine passenden Module gefunden.

') + self.print_out('

' + _('No suitable modules found.') + '

') self.print_out() return @@ -232,13 +234,18 @@ class ShowModulesApp(BaseHookApp): self.print_out(' ') self.print_out(' ') self.print_out(' ') - self.print_out(' Name') - self.print_out(' Vollständiger Name') - self.print_out(' Repository') - self.print_out( - ' Homepage bei Puppet Forge') - self.print_out(' Version') - self.print_out(' Letzter Check') + self.print_out(' {}'.format( + _('Name'))) + self.print_out(' {}'.format( + _('Complete Name'))) + self.print_out(' {}'.format( + _('Repository'))) + self.print_out(' {}'.format( + _('Homepage at Puppet Forge'))) + self.print_out(' {}'.format( + _('Version'))) + self.print_out(' {}'.format( + _('Last Check'))) self.print_out(' ') self.print_out(' Puppet Forge') self.print_out(' Development') @@ -291,7 +298,10 @@ class ShowModulesApp(BaseHookApp): plural_e = 'e' if nr_modules == 1: plural_e = '' - msg = "
Insgesamt {nr} Modul{e} gefunden.".format(nr=nr_modules, e=plural_e) + msg = "
" + ngettext( + "Found total {sb}one module{eb}.", + "Found total {sb}{nr} modules{eb}.", nr_modules).format( + sb='', nr=nr_modules, eb='') self.print_out(msg) # ------------------------------------------------------------------------- @@ -299,19 +309,19 @@ class ShowModulesApp(BaseHookApp): if not module_infos: self.print_out() - self.print_out('Keine passenden Module gefunden.') + self.print_out(_('No suitable modules found.')) self.print_out() return label = { - 'name': 'Name', - 'full_name': 'Vollständiger Name', - 'repo': "Repository", + 'name': _('Name'), + 'full_name': _('Complete Name'), + 'repo': _('Repository'), 'forge_version': 'Puppet Forge', 'version_development': 'Development', 'version_test': 'Test', 'version_production': 'Production', - 'date_checked': 'Letzter Check', + 'date_checked': _('Last Check'), } if self.verbose > 2: @@ -356,7 +366,10 @@ class ShowModulesApp(BaseHookApp): plural_e = 'e' if nr_modules == 1: plural_e = '' - msg = "\nInsgesamt {nr} Modul{e} gefunden:\n".format(nr=nr_modules, e=plural_e) + msg = "\n" + ngettext( + "Found total {sb}one module{eb}.", + "Found total {sb}{nr} modules{eb}.", nr_modules).format( + sb='', nr=nr_modules, eb='') self.print_out(msg) self.print_out() diff --git a/locale/de_DE/LC_MESSAGES/puppetmaster_webhooks.po b/locale/de_DE/LC_MESSAGES/puppetmaster_webhooks.po index d318e97..57079fd 100644 --- a/locale/de_DE/LC_MESSAGES/puppetmaster_webhooks.po +++ b/locale/de_DE/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:18+0100\n" +"POT-Creation-Date: 2018-12-28 11:49+0100\n" "PO-Revision-Date: 2018-12-28 11:19+0100\n" "Last-Translator: Frank Brehm \n" "Language: de_DE\n" @@ -92,7 +92,7 @@ msgstr "Konnte Fehler-Logdatei {f!r} nicht öffnen: {e}" #: lib/webhooks/base_app.py:873 msgid "Python CGI is running." -msgstr "Python-CGI-Skript wird aussgeführt." +msgstr "Python-CGI-Skript wird ausgeführt." #: lib/webhooks/base_app.py:906 lib/webhooks/base_app.py:911 msgid "Got a {cn} performing {a}: {e}" @@ -206,6 +206,52 @@ 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/show_modules.py:58 +msgid "Returns a list with all used Puppet modules." +msgstr "Gibt eine Liste mit allen Puppet-Modulen zurück." + +#: lib/webhooks/show_modules.py:66 +msgid "All Puppet modules." +msgstr "Alle Puppet-Module" + +#: lib/webhooks/show_modules.py:171 +msgid "{c}: Invalid regular expression {r!r}: {e}" +msgstr "{c}: Ungültiger regulärer Ausdruck {r!r}: {e}" + +#: lib/webhooks/show_modules.py:229 lib/webhooks/show_modules.py:312 +msgid "No suitable modules found." +msgstr "Keine passenden Module gefunden." + +#: lib/webhooks/show_modules.py:238 lib/webhooks/show_modules.py:317 +msgid "Name" +msgstr "Name" + +#: lib/webhooks/show_modules.py:240 lib/webhooks/show_modules.py:318 +msgid "Complete Name" +msgstr "Vollständiger Name" + +#: lib/webhooks/show_modules.py:242 lib/webhooks/show_modules.py:319 +msgid "Repository" +msgstr "Repository" + +#: lib/webhooks/show_modules.py:244 +msgid "Homepage at Puppet Forge" +msgstr "Homepage bei Puppet Forge" + +#: lib/webhooks/show_modules.py:246 +msgid "Version" +msgstr "Version" + +#: lib/webhooks/show_modules.py:248 lib/webhooks/show_modules.py:324 +msgid "Last Check" +msgstr "Letzte Überprüfung" + +#: lib/webhooks/show_modules.py:301 lib/webhooks/show_modules.py:369 +msgid "Found total {sb}one module{eb}." +msgid_plural "Found total {sb}{nr} modules{eb}." +msgstr[0] "Insgesamt {sb}ein Modul{eb} gefunden." +msgstr[1] "Insgesamt {sb}{nr} Module{eb} gefunden." + #: lib/webhooks/xlate.py:54 msgid "Module directory: {!r}" msgstr "Modul-Verzeichnis: {!r}" diff --git a/locale/en_US/LC_MESSAGES/puppetmaster_webhooks.po b/locale/en_US/LC_MESSAGES/puppetmaster_webhooks.po index 8d7abe0..c3bb4b4 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:18+0100\n" +"POT-Creation-Date: 2018-12-28 11:49+0100\n" "PO-Revision-Date: 2018-12-28 09:57+0100\n" "Last-Translator: FULL NAME \n" "Language: en_US\n" @@ -196,6 +196,52 @@ msgstr "" msgid "Could not evaluate content of {f!r}: {e}" msgstr "" +#: lib/webhooks/show_modules.py:58 +msgid "Returns a list with all used Puppet modules." +msgstr "" + +#: lib/webhooks/show_modules.py:66 +msgid "All Puppet modules." +msgstr "" + +#: lib/webhooks/show_modules.py:171 +msgid "{c}: Invalid regular expression {r!r}: {e}" +msgstr "" + +#: lib/webhooks/show_modules.py:229 lib/webhooks/show_modules.py:312 +msgid "No suitable modules found." +msgstr "" + +#: lib/webhooks/show_modules.py:238 lib/webhooks/show_modules.py:317 +msgid "Name" +msgstr "" + +#: lib/webhooks/show_modules.py:240 lib/webhooks/show_modules.py:318 +msgid "Complete Name" +msgstr "" + +#: lib/webhooks/show_modules.py:242 lib/webhooks/show_modules.py:319 +msgid "Repository" +msgstr "" + +#: lib/webhooks/show_modules.py:244 +msgid "Homepage at Puppet Forge" +msgstr "" + +#: lib/webhooks/show_modules.py:246 +msgid "Version" +msgstr "" + +#: lib/webhooks/show_modules.py:248 lib/webhooks/show_modules.py:324 +msgid "Last Check" +msgstr "" + +#: lib/webhooks/show_modules.py:301 lib/webhooks/show_modules.py:369 +msgid "Found total {sb}one module{eb}." +msgid_plural "Found total {sb}{nr} modules{eb}." +msgstr[0] "" +msgstr[1] "" + #: lib/webhooks/xlate.py:54 msgid "Module directory: {!r}" msgstr "" diff --git a/locale/puppetmaster_webhooks.pot b/locale/puppetmaster_webhooks.pot index ce078ea..b282d6b 100644 --- a/locale/puppetmaster_webhooks.pot +++ b/locale/puppetmaster_webhooks.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: puppetmaster_webhooks 1.4.1\n" +"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:18+0100\n" +"POT-Creation-Date: 2018-12-28 11:49+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -195,6 +195,52 @@ msgstr "" msgid "Could not evaluate content of {f!r}: {e}" msgstr "" +#: lib/webhooks/show_modules.py:58 +msgid "Returns a list with all used Puppet modules." +msgstr "" + +#: lib/webhooks/show_modules.py:66 +msgid "All Puppet modules." +msgstr "" + +#: lib/webhooks/show_modules.py:171 +msgid "{c}: Invalid regular expression {r!r}: {e}" +msgstr "" + +#: lib/webhooks/show_modules.py:229 lib/webhooks/show_modules.py:312 +msgid "No suitable modules found." +msgstr "" + +#: lib/webhooks/show_modules.py:238 lib/webhooks/show_modules.py:317 +msgid "Name" +msgstr "" + +#: lib/webhooks/show_modules.py:240 lib/webhooks/show_modules.py:318 +msgid "Complete Name" +msgstr "" + +#: lib/webhooks/show_modules.py:242 lib/webhooks/show_modules.py:319 +msgid "Repository" +msgstr "" + +#: lib/webhooks/show_modules.py:244 +msgid "Homepage at Puppet Forge" +msgstr "" + +#: lib/webhooks/show_modules.py:246 +msgid "Version" +msgstr "" + +#: lib/webhooks/show_modules.py:248 lib/webhooks/show_modules.py:324 +msgid "Last Check" +msgstr "" + +#: lib/webhooks/show_modules.py:301 lib/webhooks/show_modules.py:369 +msgid "Found total {sb}one module{eb}." +msgid_plural "Found total {sb}{nr} modules{eb}." +msgstr[0] "" +msgstr[1] "" + #: lib/webhooks/xlate.py:54 msgid "Module directory: {!r}" msgstr ""