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
19
Democratizing Performance
swissspidy
0
50
On Multilingual WordPress Sites
swissspidy
0
52
WordPress Internationalization Workflows
swissspidy
0
3.2k
WordPress Internationalization Workflows
swissspidy
0
82
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
外部システム連携先が10を超えるシステムでのアーキテクチャ設計・実装事例
kiwasaki
1
280
イベント駆動で成長して委員会
happymana
1
280
リアーキテクチャxDDD 1年間の取り組みと進化
hsawaji
1
200
Jakarta EE meets AI
ivargrimstad
0
210
タクシーアプリ『GO』のリアルタイムデータ分析基盤における機械学習サービスの活用
mot_techtalk
4
600
Identifying User Idenity
moro
6
9.6k
役立つログに取り組もう
irof
28
9.4k
[PyCon Korea 2024 Keynote] 커뮤니티와 파이썬, 그리고 우리
beomi
0
120
アジャイルを支えるテストアーキテクチャ設計/Test Architecting for Agile
goyoki
9
3.1k
Why Jakarta EE Matters to Spring - and Vice Versa
ivargrimstad
0
660
Outline View in SwiftUI
1024jp
1
290
受け取る人から提供する人になるということ
little_rubyist
0
200
Featured
See All Featured
Adopting Sorbet at Scale
ufuk
73
9.1k
Scaling GitHub
holman
458
140k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
It's Worth the Effort
3n
183
27k
BBQ
matthewcrist
85
9.3k
Building a Scalable Design System with Sketch
lauravandoore
459
33k
Gamification - CAS2011
davidbonilla
80
5k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
24k
RailsConf 2023
tenderlove
29
890
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.7k
Testing 201, or: Great Expectations
jmmastey
38
7.1k
Code Reviewing Like a Champion
maltzj
520
39k
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!