"""
@author: Frank Brehm
@contact: frank.brehm@pixelpark.com
-@copyright: © 2017 by Frank Brehm, Berlin
+@copyright: © 2018 by Frank Brehm, Berlin
@summary: The module for the base application object.
"""
from __future__ import absolute_import
--- /dev/null
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+@author: Frank Brehm
+@contact: frank.brehm@pixelpark.com
+@copyright: © 2018 by Frank Brehm, Berlin
+@summary: The module for i18n.
+ It provides translation object, usable from all other
+ modules in this package.
+"""
+from __future__ import absolute_import, print_function
+
+# Standard modules
+import logging
+import gettext
+
+from pathlib import Path
+
+# Third party modules
+from babel.support import Translations
+
+DOMAIN = 'puppetmaster_webhooks'
+
+LOG = logging.getLogger(__name__)
+
+__version__ = '1.0.1'
+
+__me__ = Path(__file__).resolve()
+__module_dir__ = __me__.parent
+__lib_dir__ = __module_dir__.parent
+__base_dir__ = __lib_dir__.parent
+LOCALE_DIR = __base_dir__.joinpath('locale')
+if not LOCALE_DIR.is_dir():
+ LOCALE_DIR = __module_dir__.joinpath('locale')
+ if not LOCALE_DIR.is_dir():
+ LOCALE_DIR = None
+
+__mo_file__ = gettext.find(DOMAIN, str(LOCALE_DIR))
+if __mo_file__:
+ try:
+ with open(__mo_file__, 'rb') as F:
+ XLATOR = Translations(F, DOMAIN)
+ except FileNotFoundError:
+ XLATOR = gettext.NullTranslations()
+else:
+ XLATOR = gettext.NullTranslations()
+
+_ = XLATOR.gettext
+
+# =============================================================================
+
+if __name__ == "__main__":
+
+ print(_("Module directory: {!r}").format(__module_dir__))
+ print(_("Base directory: {!r}").format(__base_dir__))
+ print(_("Locale directory: {!r}").format(LOCALE_DIR))
+ print(_("Locale domain: {!r}").format(DOMAIN))
+ print(_("Found .mo-file: {!r}").format(__mo_file__))
+
+# =============================================================================
+
+# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
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 09:57+0100\n"
-"PO-Revision-Date: 2018-12-28 09:57+0100\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"POT-Creation-Date: 2018-12-28 10:12+0100\n"
+"PO-Revision-Date: 2018-12-28 10:15+0100\n"
+"Last-Translator: Frank Brehm <frank.brehm@pixelpark.com>\n"
"Language: de_DE\n"
"Language-Team: de_DE <LL@li.org>\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.6.0\n"
+#: lib/webhooks/xlate.py:54
+msgid "Module directory: {!r}"
+msgstr "Modul-Verzeichnis: {!r}"
+
+#: lib/webhooks/xlate.py:55
+msgid "Base directory: {!r}"
+msgstr "Basis-Verzeichnis: {!r}"
+
+#: lib/webhooks/xlate.py:56
+msgid "Locale directory: {!r}"
+msgstr "Verzeichnis für Locales: {!r}"
+
+#: lib/webhooks/xlate.py:57
+msgid "Locale domain: {!r}"
+msgstr "Locale-Domäne: {!r}"
+
+#: lib/webhooks/xlate.py:58
+msgid "Found .mo-file: {!r}"
+msgstr "Gefundene .mo-Datei: {!r}"
+
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 09:57+0100\n"
+"POT-Creation-Date: 2018-12-28 10:12+0100\n"
"PO-Revision-Date: 2018-12-28 09:57+0100\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: en_US\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.6.0\n"
+#: lib/webhooks/xlate.py:54
+msgid "Module directory: {!r}"
+msgstr ""
+
+#: lib/webhooks/xlate.py:55
+msgid "Base directory: {!r}"
+msgstr ""
+
+#: lib/webhooks/xlate.py:56
+msgid "Locale directory: {!r}"
+msgstr ""
+
+#: lib/webhooks/xlate.py:57
+msgid "Locale domain: {!r}"
+msgstr ""
+
+#: lib/webhooks/xlate.py:58
+msgid "Found .mo-file: {!r}"
+msgstr ""
+
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 09:57+0100\n"
+"POT-Creation-Date: 2018-12-28 10:12+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.6.0\n"
+#: lib/webhooks/xlate.py:54
+msgid "Module directory: {!r}"
+msgstr ""
+
+#: lib/webhooks/xlate.py:55
+msgid "Base directory: {!r}"
+msgstr ""
+
+#: lib/webhooks/xlate.py:56
+msgid "Locale directory: {!r}"
+msgstr ""
+
+#: lib/webhooks/xlate.py:57
+msgid "Locale domain: {!r}"
+msgstr ""
+
+#: lib/webhooks/xlate.py:58
+msgid "Found .mo-file: {!r}"
+msgstr ""
+