From 04b227c24ab1382c7d53d385b29da0cdeb08ec30 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Tue, 6 Mar 2018 16:41:05 +0100 Subject: [PATCH] Add script for updating translations --- .update-locales | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 .update-locales diff --git a/.update-locales b/.update-locales new file mode 100755 index 0000000..3be834d --- /dev/null +++ b/.update-locales @@ -0,0 +1,37 @@ +#!/bin/sh +COMPONENTS=pretix/pretix-plugin-service-fees +DIR=pretix_servicefees/locale +# Renerates .po files used for translating the plugin +set -e +set -x + +# Lock Weblate +for c in $COMPONENTS; do + wlc lock $c; +done + +# Push changes from Weblate to GitHub +for c in $COMPONENTS; do + wlc commit $c; +done + +# Pull changes from GitHub +git pull --rebase + +# Update po files itself +make localegen + +# Commit changes +git add $DIR/*/*/*.po +git add $DIR/*.pot + +git commit -s -m "Update po files +[CI skip]" + +# Push changes +git push + +# Unlock Weblate +for c in $COMPONENTS; do + wlc unlock $c; +done