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
79
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
100
Democratizing Performance
swissspidy
0
110
On Multilingual WordPress Sites
swissspidy
0
68
WordPress Internationalization Workflows
swissspidy
0
3.3k
WordPress Internationalization Workflows
swissspidy
0
150
WordPress Internationalization Workflows
swissspidy
1
1.2k
On Internationalization and Localization
swissspidy
0
280
Internationalisation in the Age of Gutenberg
swissspidy
0
330
Internationalization Introduction at WordCamp Bern
swissspidy
0
130
Other Decks in Programming
See All in Programming
Feature Toggle は捨てやすく使おう
gennei
0
370
Goの型安全性で実現する複数プロダクトの権限管理
ishikawa_pro
2
1.4k
ロボットのための工場に灯りは要らない
watany
12
3.2k
Fundamentals of Software Engineering In the Age of AI
therealdanvega
2
300
条件判定に名前、つけてますか? #phperkaigi #c
77web
2
850
AI活用のコスパを最大化する方法
ochtum
0
340
おれのAgentic Coding 2026/03
tsukasagr
1
110
飯MCP
yusukebe
0
390
RailsのValidatesをSwift Macrosで再現してみた
hokuron
0
140
OTP を自動で入力する裏技
megabitsenmzq
0
130
Nostalgia Meets Technology: Super Mario with TypeScript
manfredsteyer
PRO
0
110
[PHPerKaigi 2026]PHPerKaigi2025の企画CodeGolfが最高すぎて社内で内製して半年運営して得た内製と運営の知見
ikezoemakoto
0
290
Featured
See All Featured
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
76
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Producing Creativity
orderedlist
PRO
348
40k
Crafting Experiences
bethany
1
94
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
320
Large-scale JavaScript Application Architecture
addyosmani
515
110k
What's in a price? How to price your products and services
michaelherold
247
13k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
160
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!