Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

WordCamp Sydney 2014

935 views

Published on

Brian discusses the benefits of translating for the web, the difference between l10n and i18n, and shares his workflow relating to WordPress theme and plugin localisation.

Images:
"tokyo" by Osamu Kaneko, used under CC BY 2.0 https://www.flickr.com/photos/osamukaneko/9237609761/
"NISSAN STADIUM" by kanegen, used under CC BY 2.0
https://www.flickr.com/photos/kanegen/8303593310/
"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 /
"Northern Lights, Norway" by Claudia Regina, used under CC BY 2.0
https://www.flickr.com/photos/claudiaregina_cc/8515586143
"Oak and Ash" by Let Ideas Compete, used under CC BY 2.0 https://www.flickr.com/photos/question_everything/4107359250/
"Tagged!" by JD Hancock, used under CC BY 2.0
https://www.flickr.com/photos/jdhancock/3814523970/
"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/
"Gray Whale Cove Beach Rocks as the golden sun thinks about setting over our globe, Northern California Coast, USA" by Wonderlane, used under CC BY 2.0
https://www.flickr.com/photos/wonderlane/3266914779/
"New Desk (3)" by William Hook, used under CC BY 2.0
https://www.flickr.com/photos/williamhook/2672214383/
"WordPress Moleskine notebook" by Nikolay Bachiyski, used under CC BY 2.0 / Desaturated from original https://www.flickr.com/photos/nbachiyski/2186228674/

Published in: Software
  • Be the first to comment

  • Be the first to like this

WordCamp Sydney 2014

  1. 1. @ThemeBoy THEME & PLUGIN LOCALISATION
  2. 2. FOOTBALL
  3. 3. ¿POR QUÉ?
  4. 4. STATISTICS
  5. 5. 55.7% OF WEBSITES ARE IN ENGLISH
  6. 6. 55.7% OF WEBSITES ARE IN ENGLISH 27% OF INTERNET USERS SPEAK ENGLISH
  7. 7. 55.7% OF WEBSITES ARE IN ENGLISH
  8. 8. 55.7% OF WEBSITES ARE IN ENGLISH JAPANESE
  9. 9. 55.7% OF WEBSITES ARE IN ENGLISH 5.1% JAPANESE
  10. 10. 55.7% OF WEBSITES ARE IN ENGLISH GERMAN 5.1% JAPANESE
  11. 11. 55.7% OF WEBSITES ARE IN ENGLISH 6.1% GERMAN 5.1% JAPANESE
  12. 12. 55.7% OF WEBSITES ARE IN ENGLISH 5.1% JAPANESE 6.1% GERMAN FINNISH
  13. 13. 55.7% OF WEBSITES ARE IN ENGLISH 5.1% JAPANESE 6.1% GERMAN 0.2% FINNISH
  14. 14. BIENVENUE
  15. 15. CAN’T READ = WON’T BUY
  16. 16. NORWAY
  17. 17. LANGUAGES ARE ALL DIFFERENT
  18. 18. GENDER
  19. 19. GENDER ADD NEW PLAYER: AGGIUNGI NUOVO GIOCATORE !
  20. 20. GENDER ADD NEW PLAYER: AGGIUNGI NUOVO GIOCATORE ! ADD NEW TEAM: AGGIUNGI NUOVA SQUADRA
  21. 21. GENDER ADD NEW PLAYER: AGGIUNGI NUOVO GIOCATORE ! ADD NEW TEAM: AGGIUNGI NUOVA SQUADRA
  22. 22. WORD LENGTH
  23. 23. WORD LENGTH ENGLISH:
  24. 24. WORD LENGTH ENGLISH: TAGS
  25. 25. WORD LENGTH ENGLISH: TAGS CHINESE:
  26. 26. WORD LENGTH TAGS 标签 ENGLISH: CHINESE:
  27. 27. WORD LENGTH ENGLISH: CHINESE: GERMAN: TAGS 标签
  28. 28. WORD LENGTH ENGLISH: CHINESE: GERMAN: TAGS 标签 SCHLAGWORTE
  29. 29. RTL
  30. 30. RTL DIRECTION OF TEXT
  31. 31. RTL DIRECTION OF INFORMATION
  32. 32. RTL INCLUDE AN RTL STYLESHEET
  33. 33. RTL STYLESHEET if ( is_rtl() ) { wp_enqueue_style( ‘rtl-stylesheet’, get_template_directory_uri() . ‘/rtl.css’ ); }
  34. 34. INTERNATIONALISATION (i18n) VS LOCALISATION (l10n)
  35. 35. i18n IS DEVELOPMENT l10n IS ADAPTATION
  36. 36. GNU GETTEXT
  37. 37. POEDIT
  38. 38. TRANSIFEX
  39. 39. WPML
  40. 40. SPORTSPRESS THE MOST ACTIVE WORDPRESS PROJECT ON TRANSIFEX
  41. 41. SPORTSPRESS THE ONLY SPORTS PLUGIN OFFICIALLY COMPATIBLE WITH WPML
  42. 42. COOL PLUGIN, BRO
  43. 43. LESS WORDS
  44. 44. GO GLOBAL WITH WPML
  45. 45. WORKFLOW
  46. 46. DOWNLOAD CORE STRINGS ALL TRANSLATIONS OF WP CORE: https://github.com/ThemeBoy/wp-languages
  47. 47. CODE (yay!)
  48. 48. SET IT UP LOAD THEME OR PLUGIN TRANSLATIONS <?php load_theme_textdomain( $domain, $path ) ?> <?php load_plugin_textdomain( $domain, false, $path ) ?> LOAD USER TRANSLATIONS: <?php $locale = apply_filters( 'plugin_locale', get_locale(), $domain ); load_textdomain( $domain, WP_LANG_DIR . "/$domain-$locale.mo" ); ?>
  49. 49. GETTEXT FUNCTIONS // Return translation __( ‘Hello’, ‘my-text-domain’ ); // Echo translation _e( ‘Hello’, ‘my-text-domain’ ); // Placeholders printf( __( ‘Add New %s.’, 'my-text-domain' ), $label ); // Plurals printf( _n( ‘One post’, ‘%s posts’, $count, ‘my-text-domain’ ), $count ); // Disambiguation by context _x( ‘Post’, ‘noun’, ‘my-text-domain’ ); _x( ‘Post’, ‘verb’, ‘my-text-domain’ );
  50. 50. CREATE A POT FILE POEDIT SOURCE KEYWORDS __ _e _n:1,2 _x:1,2 _ex:1,2 _nx:4c,1,2 esc_attr__ esc_attr_e esc_attr_x:1,2c esc_html__ esc_html_e esc_html_x:1,2c _n_noop:1,2 _nx_noop:3c,1,2 __ngettext_noop:1,2
  51. 51. TRANSIFEX CLIENT GET PIP https://bootstrap.pypa.io/get-pip.py # python get-pip.py INSTALL THE TRANSIFEX CLIENT # pip install transifex-client
  52. 52. TRANSIFEX CLIENT INITIALISE & CONFIGURE $ cd my-plugin $ tx init $ nano .tx/config [main] host = https://www.transifex.com ! [project_slug.resource_slug] file_filter = languages/my-plugin—<lang>.po source_file = languages/my-plugin.pot source_lang = en_US
  53. 53. TRANSIFEX CLIENT PUSH SOURCE STRINGS $ tx push -s PULL ALL TRANSLATIONS $ tx pull PULL TRANSLATIONS FROM A LANGUAGE $ tx pull -l en_GB
  54. 54. GNU GETTEXT DOWNLOAD & INSTALL http://www.gnu.org/software/gettext/ https://gist.github.com/mbillard/1647940 COMPILE ALL .PO FILES TO .MO $ for file in $(find ./languages/ -name *.po -type f); do msgfmt "$file" -o “${file%po}mo”; done
  55. 55. RECAP
  56. 56. STATISTICS
  57. 57. CULTURE
  58. 58. CONVERSIONS
  59. 59. THINK ABOUT GENDER
  60. 60. LENGTH OF WORDS THINK ABOUT
  61. 61. RTL THINK ABOUT
  62. 62. IS DEVELOPMENT i18n
  63. 63. l10n IS ADAPTATION
  64. 64. NORWAY IS AWESOME
  65. 65. JOIN A TEAM ON TRANSIFEX
  66. 66. QUESTIONS @ThemeBoy

×