forked from AlternC/AlternC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
repos-to-tx.sh
executable file
·82 lines (71 loc) · 2.36 KB
/
repos-to-tx.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/bash
#------------------------------------------------------------
# Short doc: launch this after big changes, so that
# people who translate the project have the new strings ;)
#------------------------------------------------------------
# USE IT INSIDE alternc/ folder which MUST BE a git clone
#
# Long doc:
# Take each sub-project of AlternC
# (EXPECTED IN PARENT FOLDERS from here)
# and regenerate the .POT
# then regenerate the .PO for each language
# then merge them into one big .po file and
# put them in the lang/ folder
#
# finally, push en_US to transifex
# to be translated.
if [ ! -x /usr/bin/tx ] ; then
echo "Package transifex-client is not installed."
echo "Install it to run $0."
exit 1
fi
pushd debian
echo "Update of PO files in debian/"
debconf-updatepo
popd
pushd ..
langs="fr_FR de_DE en_US es_ES pt_BR it_IT nl_NL"
# external repositories :
for project in alternc alternc-mailman
do
pushd "$project/bureau/locales"
make
popd
done
# internal po files :
for subproject in awstats
do
pushd "alternc/$subproject/bureau/locales"
make
popd
done
# now merge all the po's for each language
for lang in $langs
do
sublang="`echo $lang | cut -c 1-2`"
echo "doing lang $lang"
rm -rf "alternc/tmp.$lang"
mkdir "alternc/tmp.$lang"
# po-debconf : (they are using only the language code, not lang_country
# if [ "$sublang" != "en" ] ; then
cp "alternc/debian/po/${sublang}.po" "alternc/tmp.$lang/alternc.debconf.po"
cp "alternc-mailman/debian/po/${sublang}.po" "alternc/tmp.$lang/alternc-mailman.debconf.po"
# cp "alternc/trunk/awstats/debian/po/${sublang}.po" "alternc/trunk/tmp.$lang/alternc-awstats.debconf.po"
# else
# cp "alternc/trunk/debian/po/templates.pot" "alternc/trunk/tmp.$lang/alternc.debconf.po"
# cp "alternc-mailman/trunk/debian/po/templates.pot" "alternc/trunk/tmp.$lang/alternc-mailman.debconf.po"
# fi
cp "alternc/bureau/locales/$lang/LC_MESSAGES/messages.po" \
"alternc-mailman/bureau/locales/$lang/LC_MESSAGES/mailman.po" \
"alternc/awstats/bureau/locales/$lang/LC_MESSAGES/aws.po" \
"alternc/tmp.$lang/"
# now we have all .po files in one folder, merge them into one big catalog:
msgcat --use-first -o "alternc/lang/${lang}.po" alternc/tmp.$lang/*
rm -rf "alternc/tmp.$lang"
echo "done"
done
# Now pushing po files into transifex website:
cd alternc/lang/
tx push -s
popd