2012-08-21 16:50:19 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2012-08-21 17:16:07 +00:00
|
|
|
#------------------------------------------------------------
|
|
|
|
# Short doc: launch this after big changes, so that
|
|
|
|
# people who translate the project have the new strings ;)
|
|
|
|
#------------------------------------------------------------
|
|
|
|
|
2014-03-27 15:43:36 +00:00
|
|
|
# USE IT INSIDE alternc/ folder which MUST BE a git clone
|
|
|
|
#
|
2012-08-21 17:16:07 +00:00
|
|
|
# Long doc:
|
2012-08-21 16:50:19 +00:00
|
|
|
# Take each sub-project of AlternC
|
2014-03-27 15:43:36 +00:00
|
|
|
# (EXPECTED IN PARENT FOLDERS from here)
|
2012-08-21 16:50:19 +00:00
|
|
|
# and regenerate the .POT
|
|
|
|
# then regenerate the .PO for each language
|
|
|
|
# then merge them into one big .po file and
|
2012-08-21 17:16:07 +00:00
|
|
|
# put them in the lang/ folder
|
2012-08-21 16:50:19 +00:00
|
|
|
#
|
2012-08-21 17:16:07 +00:00
|
|
|
# finally, push en_US to transifex
|
|
|
|
# to be translated.
|
|
|
|
|
2012-08-24 13:08:22 +00:00
|
|
|
if [ ! -x /usr/bin/tx ] ; then
|
|
|
|
echo "Package transifex-client is not installed."
|
|
|
|
echo "Install it to run $0."
|
|
|
|
exit 1
|
|
|
|
fi
|
2012-08-21 16:50:19 +00:00
|
|
|
|
2014-03-27 15:43:36 +00:00
|
|
|
pushd ..
|
2012-08-21 16:50:19 +00:00
|
|
|
|
2012-12-07 16:56:33 +00:00
|
|
|
langs="fr_FR de_DE en_US es_ES pt_BR it_IT nl_NL"
|
2012-08-21 16:50:19 +00:00
|
|
|
|
2012-10-17 09:34:27 +00:00
|
|
|
# external repositories :
|
|
|
|
for project in alternc alternc-mailman
|
2012-08-21 16:50:19 +00:00
|
|
|
do
|
2014-03-27 15:43:36 +00:00
|
|
|
pushd "$project/bureau/locales"
|
2012-08-21 16:50:19 +00:00
|
|
|
make
|
|
|
|
popd
|
|
|
|
done
|
|
|
|
|
2012-10-17 09:34:27 +00:00
|
|
|
# internal po files :
|
|
|
|
for subproject in awstats
|
|
|
|
do
|
2014-03-27 15:43:36 +00:00
|
|
|
pushd "alternc/$subproject/bureau/locales"
|
2012-10-17 09:34:27 +00:00
|
|
|
make
|
|
|
|
popd
|
|
|
|
done
|
|
|
|
|
2014-03-27 15:43:36 +00:00
|
|
|
# now merge all the po's for each language
|
2012-08-21 16:50:19 +00:00
|
|
|
for lang in $langs
|
|
|
|
do
|
|
|
|
sublang="`echo $lang | cut -c 1-2`"
|
|
|
|
echo "doing lang $lang"
|
2014-03-27 15:43:36 +00:00
|
|
|
rm -rf "alternc/tmp.$lang"
|
|
|
|
mkdir "alternc/tmp.$lang"
|
2012-08-21 16:50:19 +00:00
|
|
|
# po-debconf : (they are using only the language code, not lang_country
|
2013-02-06 06:25:20 +00:00
|
|
|
# if [ "$sublang" != "en" ] ; then
|
2014-03-27 15:43:36 +00:00
|
|
|
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"
|
2012-10-17 09:34:27 +00:00
|
|
|
# cp "alternc/trunk/awstats/debian/po/${sublang}.po" "alternc/trunk/tmp.$lang/alternc-awstats.debconf.po"
|
2013-02-06 06:25:20 +00:00
|
|
|
# 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
|
2014-03-27 15:43:36 +00:00
|
|
|
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/"
|
2012-08-21 16:50:19 +00:00
|
|
|
# now we have all .po files in one folder, merge them into one big catalog:
|
2014-03-27 15:43:36 +00:00
|
|
|
msgcat --use-first -o "alternc/lang/${lang}.po" alternc/tmp.$lang/*
|
|
|
|
rm -rf "alternc/tmp.$lang"
|
2012-08-21 16:50:19 +00:00
|
|
|
echo "done"
|
|
|
|
done
|
|
|
|
|
|
|
|
# Now pushing po files into transifex website:
|
2014-03-27 15:43:36 +00:00
|
|
|
cd alternc/lang/
|
2012-08-21 16:50:19 +00:00
|
|
|
tx push -s
|
|
|
|
|
|
|
|
popd
|