--- /dev/null
+#!/bin/bash
+
+set -e
+set -u
+
+this_script=$( readlink -f "$0" )
+cur_dir=$( pwd )
+
+base_dir=$( dirname "$( dirname "${this_script}" )" )
+cd "${base_dir}"
+
+locale_dir=locale
+locale_domain="create_vm_template"
+
+if [[ ! -d "${locale_dir}" ]] ; then
+ echo "Localisation directory '${cur_dir}/${locale_dir}' not found." >&2
+ exit 3
+fi
+
+pybabel compile --domain "${locale_domain}" \
+ --directory "${locale_dir}" \
+ --statistics
+
--- /dev/null
+#!/bin/bash
+
+base_dir=$( dirname $0 )
+cd ${base_dir}
+base_dir=$( readlink -f . )
+
+declare -a VALID_PY_VERSIONS=("3.8" "3.7" "3.6" "3.5")
+
+echo "Preparing virtual environment ..."
+echo
+if [[ ! -f venv/bin/activate ]] ; then
+ found="n"
+ for py_version in "${VALID_PY_VERSIONS[@]}" ; do
+ PYTHON="python${py_version}"
+ if type -t ${PYTHON} >/dev/null ; then
+ found="y"
+ echo
+ echo "Found ${PYTHON}."
+ echo
+ virtualenv --python=${PYTHON} venv
+ break
+ fi
+ done
+ if [[ "${found}" == "n" ]] ; then
+ echo >&2
+ echo "Did not found a usable Python version." >&2
+ echo "Usable Python versions are: ${VALID_PY_VERSIONS[*]}" >&2
+ echo >&2
+ exit 5
+ fi
+fi
+
+# echo
+# echo "---------------------------------------------------"
+# echo "Updating Git submodule python_fb_tools ..."
+# echo "git init ..."
+# echo
+# git submodule init
+# echo
+# echo "--------------"
+# echo "git update ..."
+# echo
+# git submodule update --init --recursive python_fb_tools
+
+. venv/bin/activate || exit 5
+
+echo "---------------------------------------------------"
+echo "Installing and/or upgrading necessary modules ..."
+echo
+echo "From python_fb_tools ..."
+echo
+pip install --upgrade --upgrade-strategy eager --requirement python_fb_tools/requirements.txt
+echo
+echo "From own ..."
+echo
+pip install --upgrade --upgrade-strategy eager --requirement requirements.txt
+echo
+echo "---------------------------------------------------"
+echo "Installed modules:"
+echo
+pip list --format columns
+
+if [[ -x compile-xlate-msgs.sh ]]; then
+ echo
+ echo "--------------"
+ echo "Updating i18n files in ${base_dir} ..."
+ echo
+ ./compile-xlate-msgs.sh
+fi
+
+#cd python_fb_tools
+#if [[ -x compile-xlate-msgs.sh ]]; then
+# echo
+# echo "--------------"
+# echo "Updating i18n files in python_fb_tools ..."
+# echo
+# ./compile-xlate-msgs.sh
+#fi
+#cd ..
+
+echo
+echo "-------"
+echo "Fertig."
+echo
+
+# vim: ts=4
--- /dev/null
+#!/bin/bash
+
+set -e
+set -u
+
+this_script=$( readlink -f "$0" )
+cur_dir=$( pwd )
+
+base_dir=$( dirname "$( dirname "${this_script}" )" )
+cd ${base_dir}
+
+locale_dir=locale
+locale_domain="create_vm_template"
+pot_file="${locale_dir}/${locale_domain}.pot"
+po_with=99
+my_address="${DEBEMAIL:-frank.brehm@pixelpark.com}"
+
+pkg_version=$( cat lib/cr_vmware_tpl/__init__.py | \
+ grep '^[ ]*__version__' | \
+ sed -e 's/[ ]*//g' | \
+ awk -F= '{print $2}' | \
+ sed -e "s/^'//" -e "s/'\$//" )
+
+mkdir -pv "${locale_dir}"
+
+pybabel extract lib/cr_vmware_tpl \
+ -o "${pot_file}" \
+ -F babel.ini \
+ --width=${po_with} \
+ --sort-by-file \
+ --msgid-bugs-address="${my_address}" \
+ --copyright-holder="Frank Brehm, Pixelpark GmbH, 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
+ if [[ ! -f "${locale_dir}/${lang}/LC_MESSAGES/${locale_domain}.po" ]] ; 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} \
+ --update-header-comment
+ fi
+ # --ignore-obsolete \
+
+ sed -i -e "s/^\"Project-Id-Version:.*/\"Project-Id-Version: ${locale_domain} ${pkg_version}\\\\n\"/" "${po_file}"
+
+done
+++ /dev/null
-#!/bin/bash
-
-set -e
-set -u
-
-base_dir=$( dirname $0 )
-cd ${base_dir}
-
-locale_dir=locale
-locale_domain="create_vm_template"
-pot_file="${locale_dir}/${locale_domain}.pot"
-po_with=99
-my_address="${DEBEMAIL:-frank.brehm@pixelpark.com}"
-
-pybabel compile --domain "${locale_domain}" \
- --directory "${locale_dir}" \
- --statistics
-
+++ /dev/null
-#!/bin/bash
-
-base_dir=$( dirname $0 )
-cd ${base_dir}
-base_dir=$( readlink -f . )
-
-declare -a VALID_PY_VERSIONS=("3.8" "3.7" "3.6" "3.5")
-
-echo "Preparing virtual environment ..."
-echo
-if [[ ! -f venv/bin/activate ]] ; then
- found="n"
- for py_version in "${VALID_PY_VERSIONS[@]}" ; do
- PYTHON="python${py_version}"
- if type -t ${PYTHON} >/dev/null ; then
- found="y"
- echo
- echo "Found ${PYTHON}."
- echo
- virtualenv --python=${PYTHON} venv
- break
- fi
- done
- if [[ "${found}" == "n" ]] ; then
- echo >&2
- echo "Did not found a usable Python version." >&2
- echo "Usable Python versions are: ${VALID_PY_VERSIONS[*]}" >&2
- echo >&2
- exit 5
- fi
-fi
-
-echo
-echo "---------------------------------------------------"
-echo "Updating Git submodule python_fb_tools ..."
-echo "git init ..."
-echo
-git submodule init
-echo
-echo "--------------"
-echo "git update ..."
-echo
-git submodule update --init --recursive python_fb_tools
-
-. venv/bin/activate || exit 5
-
-echo "---------------------------------------------------"
-echo "Installing and/or upgrading necessary modules ..."
-echo
-echo "From python_fb_tools ..."
-echo
-pip install --upgrade --upgrade-strategy eager --requirement python_fb_tools/requirements.txt
-echo
-echo "From own ..."
-echo
-pip install --upgrade --upgrade-strategy eager --requirement requirements.txt
-echo
-echo "---------------------------------------------------"
-echo "Installed modules:"
-echo
-pip list --format columns
-
-if [[ -x compile-xlate-msgs.sh ]]; then
- echo
- echo "--------------"
- echo "Updating i18n files in ${base_dir} ..."
- echo
- ./compile-xlate-msgs.sh
-fi
-
-cd python_fb_tools
-if [[ -x compile-xlate-msgs.sh ]]; then
- echo
- echo "--------------"
- echo "Updating i18n files in python_fb_tools ..."
- echo
- ./compile-xlate-msgs.sh
-fi
-cd ..
-
-echo
-echo "-------"
-echo "Fertig."
-echo
-
-# vim: ts=4
+++ /dev/null
-#!/bin/bash
-
-set -e
-set -u
-
-base_dir=$( dirname $0 )
-cd ${base_dir}
-
-locale_dir=locale
-locale_domain="create_vm_template"
-pot_file="${locale_dir}/${locale_domain}.pot"
-po_with=99
-my_address="${DEBEMAIL:-frank.brehm@pixelpark.com}"
-
-pkg_version=$( cat lib/cr_vmware_tpl/__init__.py | \
- grep '^[ ]*__version__' | \
- sed -e 's/[ ]*//g' | \
- awk -F= '{print $2}' | \
- sed -e "s/^'//" -e "s/'\$//" )
-
-mkdir -pv "${locale_dir}"
-
-pybabel extract lib/cr_vmware_tpl \
- -o "${pot_file}" \
- -F babel.ini \
- --width=${po_with} \
- --sort-by-file \
- --msgid-bugs-address="${my_address}" \
- --copyright-holder="Frank Brehm, Pixelpark GmbH, 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
- if [[ ! -f "${locale_dir}/${lang}/LC_MESSAGES/${locale_domain}.po" ]] ; 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} \
- --update-header-comment
- fi
- # --ignore-obsolete \
-done