From 3c241bf16c60168577a9d542315e9d6ea207dd46 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Tue, 23 Jun 2020 17:26:13 +0200 Subject: [PATCH] Moving executable stuff into bin/ --- bin/compile-xlate-msgs.sh | 23 +++++++++++ update-env.sh => bin/update-env.sh | 40 +++++++++---------- .../xtract-xlate-msgs.sh | 8 +++- compile-xlate-msgs.sh | 18 --------- 4 files changed, 50 insertions(+), 39 deletions(-) create mode 100755 bin/compile-xlate-msgs.sh rename update-env.sh => bin/update-env.sh (75%) rename xtract-xlate-msgs.sh => bin/xtract-xlate-msgs.sh (86%) delete mode 100755 compile-xlate-msgs.sh diff --git a/bin/compile-xlate-msgs.sh b/bin/compile-xlate-msgs.sh new file mode 100755 index 0000000..c139fca --- /dev/null +++ b/bin/compile-xlate-msgs.sh @@ -0,0 +1,23 @@ +#!/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 + diff --git a/update-env.sh b/bin/update-env.sh similarity index 75% rename from update-env.sh rename to bin/update-env.sh index 97550a1..dead18b 100755 --- a/update-env.sh +++ b/bin/update-env.sh @@ -30,17 +30,17 @@ if [[ ! -f venv/bin/activate ]] ; then 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 +# 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 @@ -68,15 +68,15 @@ if [[ -x compile-xlate-msgs.sh ]]; then ./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 .. +#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 "-------" diff --git a/xtract-xlate-msgs.sh b/bin/xtract-xlate-msgs.sh similarity index 86% rename from xtract-xlate-msgs.sh rename to bin/xtract-xlate-msgs.sh index 6df9d2b..0ada1fc 100755 --- a/xtract-xlate-msgs.sh +++ b/bin/xtract-xlate-msgs.sh @@ -3,7 +3,10 @@ set -e set -u -base_dir=$( dirname $0 ) +this_script=$( readlink -f "$0" ) +cur_dir=$( pwd ) + +base_dir=$( dirname "$( dirname "${this_script}" )" ) cd ${base_dir} locale_dir=locale @@ -48,4 +51,7 @@ for lang in de_DE en_US ; do --update-header-comment fi # --ignore-obsolete \ + + sed -i -e "s/^\"Project-Id-Version:.*/\"Project-Id-Version: ${locale_domain} ${pkg_version}\\\\n\"/" "${po_file}" + done diff --git a/compile-xlate-msgs.sh b/compile-xlate-msgs.sh deleted file mode 100755 index 5aafcb8..0000000 --- a/compile-xlate-msgs.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/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 - -- 2.39.5