Jump to content

Translating:Commit MediaWiki core/bpmw

From translatewiki.net
#!/bin/bash
startdate="`date`"
echo "MediaWiki export starting at $startdate"
cd /var/www/w/extensions/Translate/scripts
mkdir -p $HOME/export
echo "Preparing MediaWiki export script for $1 hours..."
nice php autoexport.php --summarize --skip=test,files,en,got,gan --format='bx $GROUP $LANG' --hours=$1 > $HOME/export/export.tmp
echo "Cleaning export script..."
cat $HOME/export/export.tmp |egrep -v "(out-|core-|betawiki|#)" > $HOME/export/export.sh
cat $HOME/export/export.tmp |grep out-voctrain >> $HOME/export/export.sh
exportsource="`ls -al $HOME/export/export.sh`"
rm $HOME/export/export.tmp
chmod +x $HOME/export/export.sh
echo "Exporting messages..."
nice $HOME/export/export.sh
echo "Exporting special page aliases..."
#nice php /var/www/w/extensions/Translate/scripts/alias-export.php --target=$HOME/export/ --lang=*
if [ -f ~/export/mwEmbed/mwEmbed.i18n.php ]; then
        echo "Updating mwEmbed.i18n.php..."
        if [ -d ~/phase3/js2/mwEmbed/php/maintenance/ ]; then
                echo "Updating MediaWiki phase3 checkout..."
                svn up -q ~/phase3
                echo "Copying exported mwEmbed.i18n.php in checkout..."
                cp ~/export/mwEmbed/mwEmbed.i18n.php ~/phase3/js2/mwEmbed/php/languages/
                echo "Updating mwEmbed.i18n.php..."
                cd ~/phase3/js2/mwEmbed/php/maintenance/
                php ~/phase3/js2/mwEmbed/php/maintenance/mergeJavascriptMsg.php -j -q
                echo "Copying updated mwEmbed.i18n.php back to export folder..."
                cp ~/phase3/js2/mwEmbed/php/languages/mwEmbed.i18n.php ~/export/mwEmbed/
        fi
fi
echo Zipping exports...
cd $HOME/export
rm $HOME/export/export.sh
nice tar -pczf /var/www/static/mediawiki-export.tgz ./
echo Cleaning up...
nice rm -rf $HOME/export/*
enddate="`date`"
echo -en \\007
echo MediaWiki export ended at $enddate
echo Done. The exported files are in http://translatewiki.net/static/mediawiki-export.tgz
echo Export based on: $exportsource