Commit 5884b5a8 authored by Xavier Guimard's avatar Xavier Guimard

Add translation tools

parent c72c14b2
......@@ -20,6 +20,9 @@ $ make clean && make cpan
Before release
--------------
- Update languages (needs a Transifex token)
$ ./scripts/download_translations
- Update documentation:
$ ./scripts/parameters-for-wiki.pl >/tmp/prmlist.txt
......
#!/bin/bash
if [ -e ~/.transifex.key ]; then
for mod in portal manager; do
echo "#"
echo "# $mod"
echo "#"
for lang in `ls lemonldap-ng-$mod/site/htdocs/static/languages/|perl -ne 's/\.json//;print unless/^(en|fr)/'`; do
echo
echo " # $lang.json"
curl -L --user api:`cat ~/.transifex.key` \
-X GET \
-o lemonldap-ng-$mod/site/htdocs/static/languages/$lang.json \
https://www.transifex.com/api/2/project/lemonldapng/resource/${mod}json/translation/$lang/?file
js_beautify -s=1 -w lemonldap-ng-$mod/site/htdocs/static/languages/$lang.json
perl -i -pe 's/^ //;s/": "/":"/' lemonldap-ng-$mod/site/htdocs/static/languages/$lang.json
done
echo
done
echo "#"
echo "# mail"
echo "#"
for lang in `ls lemonldap-ng-portal/site/templates/common/mail/|perl -ne 's/\.json//;print unless/^(en|fr)/'`; do
echo
echo "#"
echo " # $lang.json"
curl -L --user api:`cat ~/.transifex.key` \
-X GET \
-o lemonldap-ng-portal/site/templates/common/mail/$lang.json \
https://www.transifex.com/api/2/project/lemonldapng/resource/mailjson_1/translation/$lang/?file
js_beautify -s=1 -w lemonldap-ng-portal/site/templates/common/mail/$lang.json
perl -i -pe 's/^ //;s/": "/":"/' lemonldap-ng-portal/site/templates/common/mail/$lang.json
done
else
echo "No ~/.transifex.key file found, exiting" >&2
exit 1
fi
#!/bin/bash
if [ -e ~/.transifex.key ]; then
echo "## portal.json"
curl -i -L --user api:`cat ~/.transifex.key` \
-F file=@lemonldap-ng-portal/site/htdocs/static/languages/en.json \
-X PUT https://www.transifex.com/api/2/project/lemonldapng/resource/portaljson/content/
echo
echo "## manager.json"
curl -i -L --user api:`cat ~/.transifex.key` \
-F file=@lemonldap-ng-manager/site/htdocs/static/languages/en.json \
-X PUT https://www.transifex.com/api/2/project/lemonldapng/resource/managerjson/content/
echo
echo "## portal mail.json"
curl -i -L --user api:`cat ~/.transifex.key` \
-F file=@lemonldap-ng-portal/site/templates/common/mail/en.json \
-X PUT https://www.transifex.com/api/2/project/lemonldapng/resource/mailjson_1/content/
echo
else
echo "No ~/.transifex.key file found, exiting" >&2
exit 1
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment