From 7acfbfb0d8784a78256c29d8b28f0a567199a9a3 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Mon, 12 Feb 2018 21:53:24 +0100 Subject: [PATCH] Remove perl script from apps l10n container Signed-off-by: Morris Jobke --- translations/handleAppsTranslations.sh | 46 ++++++++++++++------------ 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/translations/handleAppsTranslations.sh b/translations/handleAppsTranslations.sh index 69b07401..694da749 100755 --- a/translations/handleAppsTranslations.sh +++ b/translations/handleAppsTranslations.sh @@ -12,49 +12,51 @@ gpg --list-keys git clone git@github.com:nextcloud/$1 /app +# TODO ship this inside the docker container +wget https://github.com/nextcloud/travis_ci/raw/master/translationtool/translationtool.phar +# TODO use build/l10nParseAppInfo.php to fetch app names for l10n + for app in $(ls) do - if [ ! -d "$app/l10n" ]; then + if [ ! -d "$app/.tx" ]; then continue fi - cd "$app/l10n" + cd "$app" # build PO file - wget https://raw.githubusercontent.com/nextcloud/docker-ci/master/translations/l10n.pl - wget https://raw.githubusercontent.com/nextcloud/server/master/build/l10nParseAppInfo.php - perl ./l10n.pl $app read - if [ -e "templates/*.pot" ]; then + php5 ../translationtool.phar create-pot-files + + # delete removed l10n files that are used for language detection (they will be recreated during the write) + rm -f l10n/*.js l10n/*.json + + if [ -e "translationfiles/templates/*.pot" ]; then # push sources tx push -s # pull translations - force pull because a fresh clone has newer time stamps tx pull -f -a --minimum-perc=25 - fi - # delete removed l10n files that are used for language detection (they will be recreated during the write) - rm -f *.js *.json - - # build JS/JSON based on translations - perl ./l10n.pl $app write + # build JS/JSON based on translations + php5 ../translationtool.phar convert-po-files - rm l10n.pl - rm l10nParseAppInfo.php - cd .. - - if [ -d tests ]; then - # remove tests/ - rm -rf tests - git checkout -- tests/ + if [ -d tests ]; then + # remove tests/ + rm -rf tests + git checkout -- tests/ + fi fi - # create git commit and push it + # prepate git commit git add l10n/*.js l10n/*.json || true cd .. done -git commit -am "[tx-robot] updated from transifex" || true +rm -f translationtool.phar + +# create git commit and push it +git commit -m "[tx-robot] updated from transifex" || true git push origin master echo "done"