Skip to content

Instantly share code, notes, and snippets.

@Mte90
Last active December 17, 2018 14:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mte90/f012d97f1ee27a61f4e00172493566d4 to your computer and use it in GitHub Desktop.
Save Mte90/f012d97f1ee27a61f4e00172493566d4 to your computer and use it in GitHub Desktop.
ClassicPress i18n
#!/bin/bash
locale=$1
function replace() {
sed -i.bak s#https://"$1".wordpress.org/forums/#https://forums.classicpress.net/c/support#g /tmp/"$1"-"$2".po
sed -i.bak s/WordPress.org/ClassicPress.net/g /tmp/"$1"-"$2".po
sed -i.bak s/WordPress/ClassicPress/g /tmp/"$1"-"$2".po
}
wget https://translate.wordpress.org/projects/wp/4.9.x/"$locale"/default/export-translations -O /tmp/"$locale"-1.po
wget https://translate.wordpress.org/projects/wp/4.9.x/cc/"$locale"/default/export-translations -O /tmp/"$locale"-2.po
wget https://translate.wordpress.org/projects/wp/4.9.x/admin/network/"$locale"/default/export-translations -O /tmp/"$locale"-3.po
wget https://translate.wordpress.org/projects/wp/4.9.x/admin/"$locale"/default/export-translations -O /tmp/"$locale"-4.po
replace "$locale" '1'
replace "$locale" '2'
replace "$locale" '3'
replace "$locale" '4'
#!/bin/bash
# Download the last version of ClassicPress
git clone git@github.com:ClassicPress/ClassicPress.git /tmp/classicpress
# Generate the po to pass to GlotPress
php /tmp/classicpress/tools/i18n/makepot.php generic /tmp/classicpress/src /tmp/classicpress.pot
# Import that po file to GlotPress, in this case to the dev branch
wp glotpress import-originals core /tmp/classicpress.pot --url=http://translate.classicpress.net/
# This part of the script is for the stable or trunk, in that way all the website will download that version
# Import that po file to GlotPress to the stable branch
# wp glotpress import-originals core /tmp/classicpress.pot --url=http://translate.classicpress.net/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment