tx-to-repos.sh 2.02 KB
Newer Older
Benjamin Sonntag's avatar
Benjamin Sonntag committed
1
#!/bin/bash
2

3 4 5 6 7 8
#------------------------------------------------------------
# Short doc: launch this when people said they translated 
# the program in Transifex, so that their translation appears
# in the production package.
#------------------------------------------------------------

9 10
# USE IT INSIDE alternc/ folder which MUST BE a git clone
# 
11
# Long doc: 
12
# Take each sub-project of AlternC 
13
# (EXPECTED IN PARENT FOLDERS of alternc/)
14 15 16 17 18
# (yes, one day we will be united again ;) )
# and get the TRANSLATED strings from transifex
# then put them at the right places in the repositories
# and commit everything using svn

19
tx pull -a -f
20

21
langs="fr_FR de_DE en_US es_ES pt_BR it_IT nl_NL"
22 23 24 25 26 27 28

for lang in $langs
do
    echo "doing lang $lang"
    cp "lang/${lang}.po" "bureau/locales/$lang/LC_MESSAGES/alternc"
    sublang="`echo $lang | cut -c 1-2`"
    # merge the po for debconf into the relevant file for the modules : 
29
    if [ "$lang" != "en_US" ]
30
    then
31 32 33
	cat "debian/po/${sublang}.po" | sed -e 's/msgstr ""/msgstr "**DUMMY**"/'  >tmp-debconf.po
	msgcat --use-first --less-than=3 --more-than=1 -o tmp.po  "lang/${lang}.po" "tmp-debconf.po"
	rm "tmp-debconf.po"
34
	mv -f tmp.po "debian/po/${sublang}.po"
35

36
	cat "../alternc-mailman/debian/po/${sublang}.po" | sed -e 's/msgstr ""/msgstr "**DUMMY**"/'  >tmp-debconf.po
37 38
	msgcat --use-first --less-than=3 --more-than=1 -o tmp.po  "lang/${lang}.po" "tmp-debconf.po"
	rm "tmp-debconf.po"
39
	mv -f tmp.po "../alternc-mailman/debian/po/${sublang}.po"
40 41 42 43 44

	cat "../alternc-mailman/bureau/locales/$lang/LC_MESSAGES/mailman.po" | sed -e 's/msgstr ""/msgstr "**DUMMY**"/'  >tmp-mailman.po
	msgcat --use-first --less-than=3 --more-than=1 -o tmp.po  "lang/${lang}.po" "tmp-mailman.po"
	rm "tmp-mailman.po"
	mv -f tmp.po "../alternc-mailman/bureau/locales/$lang/LC_MESSAGES/mailman.po"
45
    fi
46 47 48
    echo "done"
done

49 50
exit 0

51 52
if [ "$1" != "nocommit" ] 
then 
53
# Now committing 
54 55 56
    git commit -am "Updating language files from Transifex"
    pushd ../alternc-mailman
    git commit -am "Updating language files from Transifex"
57 58 59
    popd
fi

60