--- /dev/null
+#!/bin/bash
+
+set -e
+set -u
+
+base_dir=$( dirname "$0" )
+cd "${base_dir}" ||exit 99
+
+locale_dir="locale"
+locale_domain="dpx_puppettools"
+# pot_file="${locale_dir}/${locale_domain}.pot"
+# po_with="99"
+# my_address="${DEBEMAIL:-frank@brehm-online.com}"
+
+pybabel compile --domain "${locale_domain}" \
+ --directory "${locale_dir}" \
+ --statistics
+
help_txt = _(
"The directory containing variable data from DPX puppet tools. "
"Cache files for the forge information are read and written from the sub "
- "directory {fd!r} below it. iCaching Git repositories are cloned in the "
+ "directory {fd!r} below it. Caching Git repositories are cloned in the "
"sub directory {gd!r} below it. Default: {vd!r}.").format(
vd=str(DpxPuppetConfig.default_var_dir), fd='forge', gd='git')
puppet_group.add_argument(
'--mail-server',
metavar=_("SERVER"), dest="mail_server",
help=_(
- "Mail server for submitting generated by this script if "
+ "Mail server for submitting mails generated by this script if "
"the mail method of this script is 'smtp'. Default: {!r}.").format(mail_server)
)
self.mod_env_info = {}
self._force_desc_msg = _(
- "Write the cache file also, if the data was successful read from chache file.")
+ "Write the cache file also, if the data was successful read from cache file.")
desc = _(
"This application retrieves information about the given module "
--- /dev/null
+#!/bin/bash
+
+set -e
+set -u
+
+base_dir=$( dirname "$0" )
+cd "${base_dir}" || exit 99
+
+locale_dir="locale"
+locale_domain="dpx_puppettools"
+pot_file="${locale_dir}/${locale_domain}.pot"
+po_with="99"
+my_address="${DEBEMAIL:-frank.brehm@pixelpark.com}"
+
+pkg_version=$( grep -E '^\s*__version__' lib/dpx_puppettools/__init__.py| sed -e 's/.*=[ ]*//' -e "s/'//g" )
+echo "Package-Version: '${pkg_version}'"
+
+pybabel extract bin/* lib \
+ -o "${pot_file}" \
+ -F etc/babel.ini \
+ --width=${po_with} \
+ --sort-by-file \
+ --msgid-bugs-address="${my_address}" \
+ --copyright-holder="Frank Brehm, Digitas Pixelpark Berlin" \
+ --project="${locale_domain}" \
+ --version="${pkg_version}"
+
+sed -i -e "s/FIRST AUTHOR/Frank Brehm/g" -e "s/<EMAIL@ADDRESS>/<${my_address}>/g" "${pot_file}"
+
+for lang in de_DE en_US ; do
+ po_file="${locale_dir}/${lang}/LC_MESSAGES/${locale_domain}.po"
+ if [[ ! -f "${po_file}" ]] ; then
+ pybabel init --domain "${locale_domain}" \
+ --input-file "${pot_file}" \
+ --output-dir "${locale_dir}" \
+ --locale "${lang}" \
+ --width ${po_with}
+ else
+ pybabel update --domain "${locale_domain}" \
+ --input-file "${pot_file}" \
+ --output-dir "${locale_dir}" \
+ --locale "${lang}" \
+ --width ${po_with} \
+ --ignore-obsolete \
+ --update-header-comment
+ fi
+
+ # Updating project version
+ sed -i -e "s/^\(\"Project-Id-Version:[ ][ ]*[^ ][^ ]*[ ][ ]*\)[^ \\][^ \\]*/\1${pkg_version}/i" "${po_file}"
+
+done
+
+# vim: ts=4 list