Commit bac91c91 authored by Thomas Citharel's avatar Thomas Citharel
Browse files

Merge branch 'zanata-backed-locale-files' into 'develop'

Fix Zanata integration + upgrade locales

See merge request framasoft/framadate!228
parents d8abafc7 ee807db3
......@@ -59,3 +59,13 @@ funky:
- if [ ! -z ${DEPLOYEMENT_KEY+x} ]; then rsync -a --delete --exclude admin/.stdout.log --exclude admin/.htpasswd --exclude app/inc/config.php --exclude stats/ --exclude error/ public/ ${DEPLOYEMENT_USER}@${DEPLOYEMENT_HOST}:../../web/; fi
only:
- funky
# Push new translations strings to https://trad.framasoft.org
trads:
stage: deploy
image: framasoft/push-trad:latest
script:
- if [ ! -z ${ZANATA_CONFIG_FRAMABOT+x} ]; then mkdir -p ${HOME}/.config; echo -e "${ZANATA_CONFIG_FRAMABOT}" > ${HOME}/.config/zanata.ini; fi
- if [ ! -z ${ZANATA_CONFIG_FRAMABOT+x} ]; then make push-locales; fi
only:
- develop
......@@ -3,5 +3,5 @@ for i in po/*.po
do
j=$(echo $i | cut -d '.' -f 1 | cut -d '/' -f 2)
po2json -i $i -t locale/en.json --progress none | ./.renest_json.pl > po/$j.json
mv po/$j.json locale/$j.json
done
mv po/*.json locale/
......@@ -14,11 +14,11 @@ while (defined(my $line = <STDIN>)) {
$old_json .= $line;
}
$old_json = decode_json($old_json);
$old_json = $json->decode($old_json);
for my $key (keys %{$old_json}) {
$key =~ m/^([^.]*)\.(.*)$/;
my $real_key = $1;
my $trad_key = $2;
my $index = index($key, '.');
my $real_key = substr($key, 0, $index++);
my $trad_key = substr($key, $index);
$new_json->{$real_key}->{$trad_key} = $old_json->{$key} if $old_json->{$key};
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#!/bin/bash
FILE=$1
if [[ ! -e locale/$FILE.json ]]
then
echo "locale/$FILE.json does not exist. Exiting."
exit 1
else
LOCALE=$(echo $FILE | sed -e "s@_@-@g")
json2po -i locale/$FILE.json -t locale/en.json -o po/$FILE.po
zanata-cli -q -B push --push-type trans -l $LOCALE
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