parent
34dea2fd21
commit
8557090f6d
@ -0,0 +1,24 @@ |
||||
[main] |
||||
host = https://www.transifex.com |
||||
|
||||
[o:lemonldapng:p:lemonldapng:r:mailjson_1] |
||||
file_filter = lemonldap-ng-portal/site/templates/common/mail/<lang>.json |
||||
source_file = lemonldap-ng-portal/site/templates/common/mail/en.json |
||||
type = KEYVALUEJSON |
||||
minimum_perc = 0 |
||||
resource_name = mail.json |
||||
|
||||
[o:lemonldapng:p:lemonldapng:r:managerjson] |
||||
file_filter = lemonldap-ng-manager/site/htdocs/static/languages/<lang>.json |
||||
source_file = lemonldap-ng-manager/site/htdocs/static/languages/en.json |
||||
type = KEYVALUEJSON |
||||
minimum_perc = 0 |
||||
resource_name = manager.json |
||||
|
||||
[o:lemonldapng:p:lemonldapng:r:portaljson] |
||||
file_filter = lemonldap-ng-portal/site/htdocs/static/languages/<lang>.json |
||||
source_file = lemonldap-ng-portal/site/htdocs/static/languages/en.json |
||||
type = KEYVALUEJSON |
||||
minimum_perc = 0 |
||||
resource_name = portal.json |
||||
|
@ -1,39 +1,14 @@ |
||||
#!/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" |
||||
remote=`echo $lang | perl -pe 's/^zh$/zh_CN/'` |
||||
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/$remote/?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" |
||||
remote=`echo $lang | perl -pe 's/^zh$/zh_CN/'` |
||||
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/$remote/?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 |
||||
FILES=`ls lemonldap-ng-manager/site/htdocs/static/languages/* \ |
||||
lemonldap-ng-portal/site/htdocs/static/languages/* \ |
||||
lemonldap-ng-portal/site/templates/common/mail/*|grep -v en.json` |
||||
|
||||
touch -a -m -t 200001181205.09 $FILES |
||||
|
||||
tx pull |
||||
|
||||
for file in $FILES; do |
||||
js_beautify -s=1 -w $file |
||||
perl -i -pe 's/^ //;s/": "/":"/' $file |
||||
done |
||||
|
@ -1,34 +1,3 @@ |
||||
#!/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/ |
||||
curl -i -L --user api:`cat ~/.transifex.key` \ |
||||
-F file=@lemonldap-ng-portal/site/htdocs/static/languages/fr.json \ |
||||
-X PUT https://www.transifex.com/api/2/project/lemonldapng/resource/portaljson/translation/fr/ |
||||
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/ |
||||
curl -i -L --user api:`cat ~/.transifex.key` \ |
||||
-F file=@lemonldap-ng-manager/site/htdocs/static/languages/fr.json \ |
||||
-X PUT https://www.transifex.com/api/2/project/lemonldapng/resource/managerjson/translation/fr/ |
||||
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/ |
||||
curl -i -L --user api:`cat ~/.transifex.key` \ |
||||
-F file=@lemonldap-ng-portal/site/templates/common/mail/fr.json \ |
||||
-X PUT https://www.transifex.com/api/2/project/lemonldapng/resource/mailjson_1/translation/fr/ |
||||
echo |
||||
|
||||
else |
||||
echo "No ~/.transifex.key file found, exiting" >&2 |
||||
exit 1 |
||||
fi |
||||
tx push |
||||
|
Loading…
Reference in new issue