From e822c93ce77369f7a2c1c7e40ae4def885b855e6 Mon Sep 17 00:00:00 2001 From: Jan Kuparinen Date: Jan 14 2021 08:00:54 +0000 Subject: [PATCH 1/2] Updated translation scripts --- diff --git a/sites/getfedora.org/scripts/translations-combile-local.sh b/sites/getfedora.org/scripts/translations-combile-local.sh new file mode 100755 index 0000000..f5cfebd --- /dev/null +++ b/sites/getfedora.org/scripts/translations-combile-local.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +pybabel compile -d translations \ No newline at end of file diff --git a/sites/getfedora.org/scripts/translations-source.sh b/sites/getfedora.org/scripts/translations-source.sh index db8eefb..ecba4d0 100755 --- a/sites/getfedora.org/scripts/translations-source.sh +++ b/sites/getfedora.org/scripts/translations-source.sh @@ -1,7 +1,39 @@ #!/usr/bin/env bash -#pybabel extract -F ../babel.cfg -o getfedora.org.pot . ../partials/ -pybabel extract -F ../../babel.cfg -o getfedora.org.pot ../../partials ../../getfedora.org/site ../../getfedora.org/partials +CONFIGFILE=babel.cfg +COMMAND=(pybabel extract -F babel.cfg -o getfedora.org.pot partials getfedora.org/site getfedora.org/partials) +# Command needs to be run from the directory containing babel.cfg for the proper output format +if test -f "$CONFIGFILE"; then + # Run the command given above + "${COMMAND[@]}" +else + # if running with "podman run " move to the directory containing babel.cfg + if test -f "../$CONFIGFILE"; then + cd .. + "${COMMAND[@]}" + # if running from the scripts directory move to the directory containing babel.cfg + elif test -f "../../$CONFIGFILE"; then + cd ../.. + "${COMMAND[@]}" + # script is called from some other location than the supported ones. + else + echo + echo " SCRIPT EXECUTION FAILED!" + echo + echo " No $CONFIGFILE found." + echo + echo " This script should be run from the directory containing $CONFIGFILE by running" + echo " ./getfedora.org/scripts/translations-source.sh" + echo " Alternatively it can be run from the scripts directory by running" + echo " ./translations-source.sh" + echo + echo + exit 1 + fi +fi echo echo +echo 'Note: Instructions below has not been tested due to missing access rights' echo 'If you have write access to https://pagure.io/fedora-web/translations, you may now run:' -echo './scripts/push-pot.sh' +echo '.getfedora.org/scripts/push-pot.sh' +echo + diff --git a/sites/getfedora.org/scripts/translations-update-local.sh b/sites/getfedora.org/scripts/translations-update-local.sh new file mode 100755 index 0000000..d01ceaf --- /dev/null +++ b/sites/getfedora.org/scripts/translations-update-local.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +pybabel update -i ../getfedora.org.pot -d translations + From 7e13b25d8127fd9511b9c31fc9c2b5ebe28a2b1e Mon Sep 17 00:00:00 2001 From: Jan Kuparinen Date: Jan 15 2021 16:31:58 +0000 Subject: [PATCH 2/2] renamed translations-combile-local.sh to translations-compile-local.sh --- diff --git a/sites/getfedora.org/scripts/translations-combile-local.sh b/sites/getfedora.org/scripts/translations-combile-local.sh deleted file mode 100755 index f5cfebd..0000000 --- a/sites/getfedora.org/scripts/translations-combile-local.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env bash -pybabel compile -d translations \ No newline at end of file diff --git a/sites/getfedora.org/scripts/translations-compile-local.sh b/sites/getfedora.org/scripts/translations-compile-local.sh new file mode 100755 index 0000000..f5cfebd --- /dev/null +++ b/sites/getfedora.org/scripts/translations-compile-local.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +pybabel compile -d translations \ No newline at end of file