Alternc  latest
Alternc logiel libre pour l'hébergement
tx-to-repos.sh
Go to the documentation of this file.
1 #!/bin/bash
2 
3 #------------------------------------------------------------
4 # Short doc: launch this when people said they translated
5 # the program in Transifex, so that their translation appears
6 # in the production package.
7 #------------------------------------------------------------
8 
9 # USE IT INSIDE alternc/ folder which MUST BE a git clone
10 #
11 # Long doc:
12 # Take each sub-project of AlternC
13 # (EXPECTED IN PARENT FOLDERS of alternc/)
14 # (yes, one day we will be united again ;) )
15 # and get the TRANSLATED strings from transifex
16 # then put them at the right places in the repositories
17 # and commit everything using svn
18 
19 tx pull -a -f
20 
21 langs="fr_FR de_DE en_US es_ES pt_BR it_IT nl_NL"
22 
23 for lang in $langs
24 do
25  echo "doing lang $lang"
26  cp "lang/${lang}.po" "bureau/locales/$lang/LC_MESSAGES/alternc"
27  sublang="`echo $lang | cut -c 1-2`"
28  # merge the po for debconf into the relevant file for the modules :
29  if [ "$lang" != "en_US" ]
30  then
31  cat "debian/po/${sublang}.po" | sed -e 's/msgstr ""/msgstr "**DUMMY**"/' >tmp-debconf.po
32  msgcat --use-first --less-than=3 --more-than=1 -o tmp.po "lang/${lang}.po" "tmp-debconf.po"
33  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  msgcat --use-first --less-than=3 --more-than=1 -o tmp.po "lang/${lang}.po" "tmp-debconf.po"
38  rm "tmp-debconf.po"
39  mv -f tmp.po "../alternc-mailman/debian/po/${sublang}.po"
40 
41  cat "../alternc-mailman/bureau/locales/$lang/LC_MESSAGES/mailman.po" | sed -e 's/msgstr ""/msgstr "**DUMMY**"/' >tmp-mailman.po
42  msgcat --use-first --less-than=3 --more-than=1 -o tmp.po "lang/${lang}.po" "tmp-mailman.po"
43  rm "tmp-mailman.po"
44  mv -f tmp.po "../alternc-mailman/bureau/locales/$lang/LC_MESSAGES/mailman.po"
45  fi
46  echo "done"
47 done
48 
49 exit 0
50 
51 if [ "$1" != "nocommit" ]
52 then
53 # Now committing
54  git commit -am "Updating language files from Transifex"
55  pushd ../alternc-mailman
56  git commit -am "Updating language files from Transifex"
57  popd
58 fi
59 
60