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 Be...
Search
Pascal Birchler
November 12, 2016
Programming
0
67
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
Client-side media processing in WordPress
swissspidy
0
22
Democratizing Performance
swissspidy
0
52
On Multilingual WordPress Sites
swissspidy
0
52
WordPress Internationalization Workflows
swissspidy
0
3.2k
WordPress Internationalization Workflows
swissspidy
0
86
WordPress Internationalization Workflows
swissspidy
1
1.1k
On Internationalization and Localization
swissspidy
0
210
Internationalisation in the Age of Gutenberg
swissspidy
0
270
Internationalization Introduction at WordCamp Bern
swissspidy
0
110
Other Decks in Programming
See All in Programming
layerx_20241129.pdf
kyoheig3
2
280
eBPF Deep Dive: Architecture and Safety Mechanisms
takehaya
12
1.4k
今からはじめるAndroidアプリ開発 2024 / DevFest 2024
star_zero
0
990
Zoneless Testing
rainerhahnekamp
0
120
【re:Growth 2024】 Aurora DSQL をちゃんと話します!
maroon1st
0
750
HTTP compression in PHP and Symfony apps
dunglas
2
1.6k
開発者とQAの越境で自動テストが増える開発プロセスを実現する
92thunder
1
170
As an Engineers, let's build the CRM system via LINE Official Account 2.0
clonn
1
670
ゆるやかにgolangci-lintのルールを強くする / Kyoto.go #56
utgwkk
1
310
あれやってみてー駆動から成長を加速させる / areyattemite-driven
nashiusagi
1
190
クリエイティブコーディングとRuby学習 / Creative Coding and Learning Ruby
chobishiba
0
3.8k
短期間での新規プロダクト開発における「コスパの良い」Goのテスト戦略」 / kamakura.go
n3xem
2
160
Featured
See All Featured
How to Ace a Technical Interview
jacobian
276
23k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Making Projects Easy
brettharned
116
5.9k
4 Signs Your Business is Dying
shpigford
181
21k
How To Stay Up To Date on Web Technology
chriscoyier
789
250k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
Bash Introduction
62gerente
608
210k
How GitHub (no longer) Works
holman
311
140k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
18k
Building a Scalable Design System with Sketch
lauravandoore
460
33k
A designer walks into a library…
pauljervisheath
204
24k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
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!