diff --git a/scripts/cloudron-translation-update b/scripts/cloudron-translation-update new file mode 100755 index 000000000..75c952e25 --- /dev/null +++ b/scripts/cloudron-translation-update @@ -0,0 +1,31 @@ +#!/bin/bash + +set -eu -o pipefail + +# This script downloads new translation data from weblate at https://translate.cloudron.io + +OUT="/home/yellowtent/box/dashboard/dist/translation" + +# We require root +if [[ ${EUID} -ne 0 ]]; then + echo "This script should be run as root. Run with sudo" + exit 1 +fi + +echo "=> Downloading new translation files..." +curl https://translate.cloudron.io/download/cloudron/dashboard/?format=zip -o /tmp/lang.zip + +echo "=> Unpacking..." +unzip -jo /tmp/lang.zip -d $OUT +chown -R yellowtent:yellowtent $OUT +# unzip put very restrictive permissions +chmod ua+r $OUT/* + +echo "=> Cleanup..." +rm /tmp/lang.zip + +echo "=> Done" + +echo "" +echo "Reload the dashboard to see the new translations" +echo "" diff --git a/scripts/installer.sh b/scripts/installer.sh index eb314376f..c668a432c 100755 --- a/scripts/installer.sh +++ b/scripts/installer.sh @@ -71,6 +71,12 @@ if ! which ipset; then apt install -y ipset fi +# Only used for the cloudron-translation-update script +if ! which unzip; then + echo "==> installer: installing unzip" + apt install -y unzip +fi + echo "==> installer: updating node" if [[ "$(node --version)" != "v10.18.1" ]]; then mkdir -p /usr/local/node-10.18.1 diff --git a/setup/start.sh b/setup/start.sh index 3fab57ff7..8de44322f 100755 --- a/setup/start.sh +++ b/setup/start.sh @@ -19,6 +19,7 @@ readonly json="$(realpath ${script_dir}/../node_modules/.bin/json)" readonly ubuntu_version=$(lsb_release -rs) cp -f "${script_dir}/../scripts/cloudron-support" /usr/bin/cloudron-support +cp -f "${script_dir}/../scripts/cloudron-translation-update" /usr/bin/cloudron-translation-update # this needs to match the cloudron/base:2.0.0 gid if ! getent group media; then