Skip to content

Instantly share code, notes, and snippets.

@markoheijnen
Last active December 16, 2015 17:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markoheijnen/5468925 to your computer and use it in GitHub Desktop.
Save markoheijnen/5468925 to your computer and use it in GitHub Desktop.
Update all windows languages
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
LANGUAGES=(
"de:WordPress/Localization/LocalizedResources.de-DE.resx"
"es:WordPress/Localization/LocalizedResources.es-ES.resx"
"it:WordPress/Localization/LocalizedResources.it-IT.resx"
"ja:WordPress/Localization/LocalizedResources.ja-JP.resx"
"nl:WordPress/Localization/LocalizedResources.nl.resx"
"pt-br:WordPress/Localization/LocalizedResources.pt-BR.resx"
"pt:WordPress/Localization/LocalizedResources.pt-PT.resx"
"sv:WordPress/Localization/LocalizedResources.sv-SE.resx"
"th:WordPress/Localization/LocalizedResources.th-TH.resx"
)
mkdir -p $DIR/windowsphone
cd $DIR/windowsphone
svn co http://windowsphone.svn.wordpress.org/trunk
for language in "${LANGUAGES[@]}" ; do
KEY=${language%%:*}
VALUE=${language#*:}
URL=http://translate.wordpress.org/api/projects/wordpress-for-windows-phone/development/$KEY/default/export-translations?format=resx
A=$$; ( wget -q $URL -O $A.d && mv $A.d $DIR/windowsphone/trunk/$VALUE; echo "Downloaded: $KEY" ) || ( rm $A.d; echo "Failed downloading: $KEY" )
done
cd $DIR/windowsphone/trunk
svn ci -m "Updated language files"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment