diff options
author | Morris Jobke <hey@morrisjobke.de> | 2016-09-05 14:26:47 +0300 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2016-09-05 14:26:47 +0300 |
commit | 53455119559eca65f6cc56b9c04d907e87b009fa (patch) | |
tree | ac4f66eb07f0841347eeca3966720e16e7053e1a | |
parent | 78cedd64df1b4c5e49d0a70e52a9f3e46bc492eb (diff) |
add PHP as dependency and add mail specific translation handlertranslations-3
-rw-r--r-- | translations/Dockerfile | 2 | ||||
-rwxr-xr-x | translations/handleMailTranslations.sh | 44 |
2 files changed, 45 insertions, 1 deletions
diff --git a/translations/Dockerfile b/translations/Dockerfile index c48e377..e3e0d9b 100644 --- a/translations/Dockerfile +++ b/translations/Dockerfile @@ -3,7 +3,7 @@ FROM alpine MAINTAINER Morris Jobke <hey@morrisjobke.de> # Install python and perl -RUN apk update && apk add python3 py-pip perl gettext make gnupg git openssh wget +RUN apk update && apk add python3 py-pip perl gettext make gnupg git openssh wget php5 # Install Transifex client RUN pip install transifex-client diff --git a/translations/handleMailTranslations.sh b/translations/handleMailTranslations.sh new file mode 100755 index 0000000..3a0d938 --- /dev/null +++ b/translations/handleMailTranslations.sh @@ -0,0 +1,44 @@ +#!/bin/sh + +# verbose and exit on error +set -xe + +# import GPG keys +gpg --import /gpg/nextcloud-bot.public.asc +gpg --allow-secret-key-import --import /gpg/nextcloud-bot.asc +gpg --list-keys + +# fetch git repo +git clone git@github.com:nextcloud/$1 /app + +# mail specific code +php translation-extractor.php + +# build PO file +cd l10n +wget https://raw.githubusercontent.com/owncloud/administration/master/jenkins/translation_sync/l10n.pl +perl ./l10n.pl $1 read + +# push sources +tx push -s + +# pull translations - force pull because a fresh clone has newer time stamps +tx pull -f -a --minimum-perc=75 + +# build JS/JSON based on translations +perl ./l10n.pl $1 write + +rm l10n.pl +cd .. + +if [ -d tests ]; then + # remove tests/ + rm -rf tests + git checkout -- tests/ +fi + +# create git commit and push it +git add l10n/*.js l10n/*.json +git commit -am "[tx-robot] updated from transifex" || true +git push origin master +echo "done" |