Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
GWTD: I18N Improvements in WordPress 4.6 And Beyond
Search
Pascal Birchler
November 12, 2016
Programming
0
65
GWTD: I18N Improvements in WordPress 4.6 And Beyond
Slides for my presentation at the 2nd Global WordPress Translation Day on November 12th, 2016.
Pascal Birchler
November 12, 2016
Tweet
Share
More Decks by Pascal Birchler
See All by Pascal Birchler
Democratizing Performance
swissspidy
0
16
On Multilingual WordPress Sites
swissspidy
0
50
WordPress Internationalization Workflows
swissspidy
0
3.1k
WordPress Internationalization Workflows
swissspidy
0
77
WordPress Internationalization Workflows
swissspidy
1
1.1k
On Internationalization and Localization
swissspidy
0
150
Internationalisation in the Age of Gutenberg
swissspidy
0
260
Internationalization Introduction at WordCamp Bern
swissspidy
0
99
On Internationalization and Localization
swissspidy
0
100
Other Decks in Programming
See All in Programming
Front-end application development, Symfony-style(s)
dunglas
2
1.9k
1인 개발자로 행복하게 살기 - GDG 송도 헬로월드 2024
benjaminkim
1
5.6k
Open Source Swift Workshop - Foundation and first party libraries
ikesyo
0
1.1k
単体テストを書かない技術 #phpcon_odawara
o0h
PRO
25
7.6k
コードレビューで学ぶ!Kotlinオブジェクト指向デザインパターン
akkie76
2
170
Designing for tomorrow's programming workflows
honnibal
PRO
2
110
チーム力を高めるスクラム実践法:カンバン公開と課題攻略について - ニフティのスクラムトーク Vol. 2 - NIFTY Tech Talk #18
niftycorp
PRO
1
110
OpenTelemetry のサービスという概念について
azukiazusa1
2
1k
Doctrine ORMでValue Objectを扱う方法4選 #phpstudy / 4 ways to handle Value Objects with Doctrine ORM
77web
4
110
受託開発でGitLab CI を活用していく
xiombatsg
1
260
オブジェクト指向は必要なのか / Is object-oriented needed?
kishida
31
21k
Elm Form Validation
bkuhlmann
0
500
Featured
See All Featured
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
114
18k
How STYLIGHT went responsive
nonsquared
92
4.8k
Intergalactic Javascript Robots from Outer Space
tanoku
266
26k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
12
1.5k
A designer walks into a library…
pauljervisheath
199
23k
VelocityConf: Rendering Performance Case Studies
addyosmani
319
23k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
20
1.6k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
118
38k
10 Git Anti Patterns You Should be Aware of
lemiorhan
645
57k
RailsConf 2023
tenderlove
0
530
Infographics Made Easy
chrislema
237
18k
Happy Clients
brianwarren
91
6.4k
Transcript
Internationalization Improvements in WordPress 4.6 and Beyond
Pascal Birchler @swissspidy
First, Some History
Language Packs
Automatic Updates
Language Chooser
None
Change Your Mind
None
Language Packs for Plugins and Themes
WordPress 4.6
Localized Datepicker
None
Bonus: wp_add_inline_script()
Language Packs More Important Than Ever
Loading Translations in Different Order
load_plugin_textdomain( 'myplugin', false, 'languages' )
wp-content/plugins/myplugin/ languages/… ! wp-content/languages/plugins/…
wp-content/languages/plugins/… ! wp-content/plugins/myplugin/ languages/…
On Demand Translations™
Just-in-time Loading for Translations
wp-content/languages
// Do stuff. _e( 'Hello World’, 'myplugin' ); // …Magic
happens… // Prints: Hallo Welt
wp-content/languages/plugins/myplugin-de_DE.mo
Demo
Good bye, load_plugin_textdomain()
WordPress 4.7
User Admin Language
None
None
Back End: Español Front End: English
None
Locale Switching
switch_to_locale()
$switched = switch_to_locale( get_user_locale() ) // Do stuff. if (
$switched ) { restore_previous_locale(); }
Send Emails In the User’s Language
What About the Admin Toolbar?
None
Demo
Beyond
Preferred Languages
None
JavaScript Internationalization
// PHP: wp_localize_script( 'myplugin-script', '_myPluginL10n', array( 'helloWorld' => __( 'Hello
World','myplugin' ) ) ); // JS: alert( _myPluginL10n.helloWorld );
if ( 1 == number ) { use( _myPluginL10n.singularString );
} else { use( _myPluginL10n.pluralString ); }
wp.i18n.__( 'Hello World' )
wp-content/languages/plugins/myplugin-de_DE.json
None
Good bye, wp_localize_script()
User Timezones
None
Open Floor
Thanks!