Brian Miyaji discusses the advantages of localizing code for WordPress, things to consider when developing software for a global audience, and how to save time for developers and translators.
Images:
"tokyo" by Osamu Kaneko, used under CC BY 2.0 https://www.flickr.com/photos/osamukaneko/9237609761/
"Confused" by Mika Hiltunen, used under CC BY 2.0 https://www.flickr.com/photos/saaste/13150099564/
“Union Jack Teapot" by The Hamster Factor, used under CC BY 2.0 / Desaturated from original https://www.flickr.com/photos/disaster_area/8424925130/
"Paris" by Moyan Brenn, used under CC BY 2.0 / Desaturated from original https://www.flickr.com/photos/aigle_dore/5238554034/
"Chinese Calligraphy" by Jiwei Han, used under CC BY 2.0 https://www.flickr.com/photos/p_h/2199524538
"Oak and Ash" by Let Ideas Compete, used under CC BY 2.0 https://www.flickr.com/photos/question_everything/4107359250/
"Butterfly" by Auntie P, used under CC BY 2.0 / Desaturated from original https://www.flickr.com/photos/auntiep/1170669/
"Boy and Girl Hummel Figurines" by Jason Pratt, used under CC BY 2.0 / Desaturated from original https://www.flickr.com/photos/jasonpratt/2347428960/
"Arabic Writing" by Pietro Izzo, used under CC BY 2.0 / Desaturated from original https://www.flickr.com/photos/pietroizzo/4527056064/
"WordPress Moleskine notebook" by Nikolay Bachiyski, used under CC BY 2.0 / Desaturated from original https://www.flickr.com/photos/nbachiyski/2186228674/
24. SET IT UP
<?php load_theme_textdomain( $domain, $path ) ?>
<?php load_plugin_textdomain( $domain, $abs_rel_path, $plugin_rel_path ) ?>
LOAD TRANSLATED STRINGS
define ('WPLANG', ‘pt_BR’); // To this
CHANGE WORDPRESS LANGUAGE
define ('WPLANG', ‘’); // Change this
31. $ tx push -s
TRANSIFEX CLIENT
PUSH SOURCE STRINGS
$ tx pull -l ja
PULL TRANSLATIONS FROM A LANGUAGE
$ tx pull
PULL ALL TRANSLATIONS
32. GNU GETTEXT
DOWNLOAD & INSTALL
$ for file in $(find ./languages/ -name *.po -type f);
do msgfmt "$file" -o “${file%po}mo”;
done
http://www.gnu.org/software/gettext/
https://gist.github.com/mbillard/1647940
COMPILE ALL .PO FILES TO .MO