diff --git a/translations/Dockerfile b/translations/Dockerfile index 1ce494cf..1c0c703a 100644 --- a/translations/Dockerfile +++ b/translations/Dockerfile @@ -4,16 +4,12 @@ MAINTAINER Morris Jobke # Install python and perl RUN apk update && \ - apk add python3 py3-pip perl gettext make gnupg git openssh wget php5 && \ + apk add python3 py3-pip gettext make gnupg git openssh wget php5 && \ rm -rf /var/cache/apk/* # Install Transifex client RUN pip3 install transifex-client -RUN wget http://search.cpan.org/CPAN/authors/id/C/CO/COSIMO/Locale-PO-0.27.tar.gz -O /tmp/locale-po.tar.gz \ - && cd /tmp && tar -xf locale-po.tar.gz \ - && cd Locale-PO-0.27 && perl Makefile.PL && make install && rm -rf /tmp/* - RUN mkdir -p /app ADD gitconfig /root/.gitconfig diff --git a/translations/handleTranslations.sh b/translations/handleTranslations.sh index 7c54e3ec..c72c4df6 100755 --- a/translations/handleTranslations.sh +++ b/translations/handleTranslations.sh @@ -11,28 +11,33 @@ gpg --list-keys # fetch git repo git clone git@github.com:nextcloud/server /app +# fetch translation script +# 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 + versions='stable12 stable13 master' # build POT files for all versions -cd l10n mkdir stable-templates for version in $versions do git checkout $version - perl ./l10n.pl read > /dev/null - cd templates + php5 translationtool.phar create-pot-files + + cd translationfiles/templates/ for file in $(ls) do - mv $file ../stable-templates/$version.$file + mv $file ../../stable-templates/$version.$file done - cd .. + cd ../.. done # merge POT files into one for file in $(ls stable-templates/master.*) do name=$(echo $file | cut -b 25- ) - msgcat --use-first stable-templates/*.$name > templates/$name + msgcat --use-first stable-templates/*.$name > translationfiles/templates/$name done # remove intermediate POT files @@ -43,10 +48,10 @@ tx push -s # pull translations - force pull because a fresh clone has newer time stamps tx pull -f -a --minimum-perc=75 -# pull all settings for language name +# pull all "settings" translations for the language name (for 12) tx pull -a -f -r nextcloud.settings-1 --minimum-perc=1 - -cd .. +# pull all "lib" translations for the language name (for 13 and master) +tx pull -a -f -r nextcloud.lib --minimum-perc=1 backportVersions='master stable13 stable12' for version in $backportVersions @@ -58,19 +63,15 @@ do find lib/l10n -type f -delete find settings/l10n -type f -delete - cd l10n - # build JS/JSON based on translations - perl ./l10n.pl write - - cd .. + php5 translationtool.phar convert-po-files # remove tests/ rm -rf tests git checkout -- tests/ # create git commit and push it - git add . + git add apps core lib settings git commit -am "[tx-robot] updated from transifex" || true git push origin $version