Last active
December 17, 2018 14:49
-
-
Save Mte90/f012d97f1ee27a61f4e00172493566d4 to your computer and use it in GitHub Desktop.
ClassicPress i18n
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Download the last version of ClassicPress | |
git clone [email protected]: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