Skip to content

Instantly share code, notes, and snippets.

@mattrude
Created September 18, 2010 20:23
Show Gist options
  • Save mattrude/586011 to your computer and use it in GitHub Desktop.
Save mattrude/586011 to your computer and use it in GitHub Desktop.
Translating The Random Image Block Plugin
#!/bin/bash
cd /var/www/therudes.com/wp-content/plugins/random-image-block/
rm -rf languages
mkdir languages
xgettext --keyword=__ --keyword=_e --from-code=php --language=php *.php \
--package-version=1.o --package-name=safecss --output=languages/random-image-block.pot
cd languages/
sed --in-place random-image-block.pot --expression='s/YEAR-MO-DA HO:MI+ZONE/2010-09-18 14:57-0500/'
sed --in-place random-image-block.pot --expression='s/FULL NAME <EMAIL@ADDRESS>/Matt Rude <[email protected]>/'
sed --in-place random-image-block.pot --expression='s/LANGUAGE <[email protected]>/Matt Rude <[email protected]>/'
sed --in-place random-image-block.pot --expression='s/CHARSET/UTF-8/'
for a in `echo 'ar fr es de pt pt_br it ru nl cs es_ch tr da fi id zh_cn zh_tw'`
do
rm -rf $a.*
echo "Working on $a"
curl -F [email protected] \
-F language=$a \
-F output=pofile \
http://pepipopum.dixo.net \
--output $a.po
done
mv ar.po random-image-block.ar.po # Aribic
mv fr.po random-image-block.fr_FR.po # French
mv es.po random-image-block.es_ES.po # Spanish
mv es_ch.po random-image-block.es_CH.po # Spanish (Chile)
mv de.po random-image-block.de_DE.po # German
mv pt.po random-image-block.pt_PT.po # Portuguese
mv pt_br.po random-image-block.pt_BR.po # Portuguese BR
mv it.po random-image-block.it_IT.po # Italian
mv id.po random-image-block.id.po # Indonesian
mv ru.po random-image-block.ru_RU.po # Russian
mv da.po random-image-block.da_DK.po # Danish
mv nl.po random-image-block.nl_NL.po # Dutch
mv cs.po random-image-block.cs_CZ.po # Czech
mv fi.po random-image-block.fi_FI.po # Finnish
mv tr.po random-image-block.tr_TR.po # Turkish
mv zh_tw.po random-image-block.zh_TW.po # Chinese (Taiwan)
mv zh_cn.po random-image-block.zh_CN.po # Chinese (China)
msgfmt -o random-image-block.ar.mo random-image-block.ar.po
msgfmt -o random-image-block.fr_FR.mo random-image-block.fr_FR.po
msgfmt -o random-image-block.es_ES.mo random-image-block.es_ES.po
msgfmt -o random-image-block.de_DE.mo random-image-block.de_DE.po
msgfmt -o random-image-block.pt_PT.mo random-image-block.pt_PT.po
msgfmt -o random-image-block.it_IT.mo random-image-block.it_IT.po
msgfmt -o random-image-block.ru_RU.mo random-image-block.ru_RU.po
msgfmt -o random-image-block.da_dk.mo random-image-block.da_DK.po
msgfmt -o random-image-block.nl_NL.mo random-image-block.nl_NL.po
msgfmt -o random-image-block.cs_CZ.mo random-image-block.cs_CZ.po
msgfmt -o random-image-block.fi_FI.mo random-image-block.fi_FI.po
msgfmt -o random-image-block.zh_TW.mo random-image-block.zh_TW.po
msgfmt -o random-image-block.zh_CN.mo random-image-block.zh_CN.po
msgfmt -o random-image-block.tr_TR.mo random-image-block.tr_TR.po
msgfmt -o random-image-block.id.mo random-image-block.id.po
chown -R apache:apache .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment