Commit 4516a054 authored by WinterFairy's avatar WinterFairy

Add an import-translation script.

This will make the importation of completed translations
from Transifex automated.

It does not import "fr" or "pt_BR", as they are
translated in git instead.

This script is based on a similar script from TorButton.
parent 698e6165
#!/bin/sh
set -e
EXCLUDE_LANGS="fr pt_BR"
# Clone or update the translation repository
mkdir -p tmp
cd tmp
if [ -d translation ]; then
cd translation
git fetch origin
cd ..
else
git clone https://git.torproject.org/translation.git
fi
# Checkout the correct branch
cd translation
git checkout tails-misc_completed
git merge origin/tails-misc_completed
# For each completely translated language, merge it,
# unless it is translated outside Transifex
for i in *.po; do
lang="`echo $i | tr - _ | sed 's/\.po$//'`"
skip='n'
for j in $EXCLUDE_LANGS; do
if [ "$lang" = "$j" ]; then skip='y'; fi
done
if [ "$skip" = 'n' ]; then
echo $lang
cp $lang.po ../../po/
fi
done
# Fix syntax of the po files
cd ../../po
for i in *.po; do
lang="`echo $i | tr - _ | sed 's/\.po$//'`"
intltool-update --dist --gettext-package=tails $lang
done
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