2009-11-12 20:58:03 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2009-11-12 21:48:04 +00:00
|
|
|
# Automate the compilation of the various locale PO files by automatically
|
|
|
|
# generating them at night.
|
2009-11-12 22:19:36 +00:00
|
|
|
#
|
2009-11-12 21:48:04 +00:00
|
|
|
projname=boinctrunk
|
|
|
|
projdir=$HOME/pootle/po/$projname
|
|
|
|
|
2009-11-12 22:19:36 +00:00
|
|
|
cd $projdir
|
2009-11-12 21:48:04 +00:00
|
|
|
|
2009-11-12 22:19:36 +00:00
|
|
|
# Iterrate through the various PO files looking for those that need to be compiled.
|
|
|
|
#
|
|
|
|
for file in `find -name 'BOINC-Manager.po'` ; do
|
2009-11-12 20:58:03 +00:00
|
|
|
dir=`dirname $file`
|
|
|
|
locale=`basename $dir`
|
2009-11-12 22:19:36 +00:00
|
|
|
|
|
|
|
timestampPO=`date -r ${projdir}/${locale}/BOINC-Manager.po`
|
|
|
|
timestampMO=`date -r ${projdir}/${locale}/BOINC-Manager.mo`
|
|
|
|
|
2009-11-12 22:42:54 +00:00
|
|
|
if [ "${timestampPO}" != "${timestampMO}" ]; then
|
2009-11-12 22:19:36 +00:00
|
|
|
|
|
|
|
# Remove old MO from previous compilation
|
|
|
|
#
|
2009-11-12 22:42:54 +00:00
|
|
|
rm ${projdir}/BOINC-Manager.mo > /dev/null 2> /dev/null
|
2009-11-12 22:19:36 +00:00
|
|
|
|
|
|
|
# Use wget to cause the Pottle system to compile the PO file into an MO file.
|
|
|
|
#
|
|
|
|
# poEdit has a hard time with the Pootle markup in the PO files.
|
|
|
|
#
|
|
|
|
# Example: http://boinc.berkeley.edu/translate/ar/boinctrunk/BOINC-Manager.mo
|
|
|
|
#
|
2009-11-12 22:42:54 +00:00
|
|
|
wget http://boinc.berkeley.edu/translate/${locale}/${projname}/BOINC-Manager.mo > /dev/null 2> /dev/null
|
2009-11-12 22:19:36 +00:00
|
|
|
|
|
|
|
# Add any new MO files to SVN
|
2009-11-12 22:42:54 +00:00
|
|
|
svn add ${projdir}/${locale}/BOINC-Manager.mo > /dev/null 2> /dev/null
|
2009-11-12 22:19:36 +00:00
|
|
|
|
|
|
|
# Touch each file to adjust timestamps
|
|
|
|
touch ${projdir}/${locale}/BOINC-Manager.po
|
|
|
|
touch ${projdir}/${locale}/BOINC-Manager.mo
|
|
|
|
|
|
|
|
fi
|
2009-11-12 21:48:04 +00:00
|
|
|
|
2009-11-12 22:19:36 +00:00
|
|
|
done
|
2009-11-12 21:48:04 +00:00
|
|
|
|
2009-11-12 22:42:54 +00:00
|
|
|
# Remove old MO from previous compilation
|
|
|
|
#
|
|
|
|
rm ${projdir}/BOINC-Manager.mo > /dev/null 2> /dev/null
|
|
|
|
|
2009-11-12 22:19:36 +00:00
|
|
|
# Commit any changes to SVN
|
|
|
|
svn commit -m 'Update Translations'
|
2009-11-12 20:58:03 +00:00
|
|
|
|
2010-01-11 17:51:08 +00:00
|
|
|
# Update anything that needs updating
|
|
|
|
svn update
|
|
|
|
|
2009-11-12 20:58:03 +00:00
|
|
|
exit 0
|