Add some hacky shell scripts to svn that update and merge translations from Launchpad

This commit is contained in:
David Sansome 2011-02-21 20:33:44 +00:00
parent 24fbe6aa74
commit 4ecd63f137
5 changed files with 74 additions and 0 deletions

18
dist/mergetranslations/README vendored Normal file
View File

@ -0,0 +1,18 @@
These are some really nasty shell scripts to merge the translations from
Launchpad (exported into bzr) into our svn repository. Run init.sh once to
create "bzr" and "svn" folders, then run update.sh to update and merge them.
Be sure to check that:
* You have all the dependencies for all the optional features installed,
so code containing translatable strings isn't compiled out.
* No shortcut modifiers (like "Ctrl+L") have been translated - the
translations for these must always be in English.
* No unexpected files have been added to svn.
There are versions of init.sh and update.sh for the website as well.
Updating the website needs a bit more manual work:
* Update the LANGUAGES list in data.py. These are the languages that get
shown at the bottom of each page.
* Make sure the LANGUAGE_NAMES entry for each new language is translated
into that native language.
* Don't commit any empty (or mostly empty) translations to svn.

4
dist/mergetranslations/init-www.sh vendored Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
bzr branch lp:~me-davidsansome/clementine/exported-po www-bzr
svn co https://clementine-player.googlecode.com/svn/www www-svn

4
dist/mergetranslations/init.sh vendored Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
bzr branch lp:~me-davidsansome/clementine/exported-po bzr
svn co https://clementine-player.googlecode.com/svn/trunk svn

30
dist/mergetranslations/update-www.sh vendored Executable file
View File

@ -0,0 +1,30 @@
#!/bin/sh
cd www-bzr || exit
bzr merge || exit
bzr commit --unchanged -m "Merge from main branch" || exit
cd .. || exit
cd www-svn || exit
svn update || exit
cd .. || exit
languages=""
for f in www-bzr/locale/*.po; do
lang=`basename "$f" .po`
languages="$languages $lang"
cp $f www-svn/locale/ || exit
mkdir -p www-svn/locale/$lang/LC_MESSAGES/
svn add www-svn/locale/$lang.po www-svn/locale/$lang/
done
sed www-svn/Makefile -i.bak -e "s/LANGUAGES=.*/LANGUAGES=$languages/"
cd www-svn || exit
make || exit
make || exit
cd ../.. || exit
echo "Now change svn-www/data.py to add any new langauges"

18
dist/mergetranslations/update.sh vendored Executable file
View File

@ -0,0 +1,18 @@
#!/bin/sh
cd bzr || exit
bzr merge || exit
bzr commit --unchanged -m "Merge from main branch" || exit
cd .. || exit
cd svn || exit
svn update || exit
cd .. || exit
cp -v bzr/src/translations/*.po svn/src/translations || exit
svn add svn/src/translations/*.po
cd svn/bin || exit
cmake .. || exit
make -j8 || exit
make -j8 || exit
cd ../.. || exit