Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
GWTD: I18N Improvements in WordPress 4.6 And Beyond
Pascal Birchler
November 12, 2016
Programming
0
58
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
On Multilingual WordPress Sites
swissspidy
0
35
WordPress Internationalization Workflows
swissspidy
0
3k
WordPress Internationalization Workflows
swissspidy
0
58
WordPress Internationalization Workflows
swissspidy
1
1k
On Internationalization and Localization
swissspidy
0
120
Internationalisation in the Age of Gutenberg
swissspidy
0
240
Internationalization Introduction at WordCamp Bern
swissspidy
0
79
On Internationalization and Localization
swissspidy
0
88
Internationalization Done Right
swissspidy
0
180
Other Decks in Programming
See All in Programming
Pythonによる開発をアップデートするライブラリの紹介
daikikatsuragawa
1
600
料理の注文メニューの3D化への挑戦
hideg
0
280
ベストプラクティス・ドリフト
sssssssssssshhhhhhhhhh
1
210
実践 SpiceDB - クライドネイティブ時代をサバイブできるパーミッション管理の実装を目指して / Practical SpiceDB
lmt_swallow
0
130
それ全部エラーメッセージに書いてあるよ!〜独学でPHPプログラミングが上達するたった一つの方法〜
77web
1
150
Amazon SageMakerでImagenを動かして猫画像生成してみた
hotoke_neko
0
110
SwiftUIで「意図」を伝える / swiftui_intention
uhooi
2
150
Babylon.jsで作ったsceneをレイトレーシングで映えさせる
turamy
1
210
Now in Android Overview
aosa4054
0
390
SwiftUI+TCAに挑戦!NewsPicks iOSアプリのリアーキテクチャ/re-architecture-newspicks-ios-app-with-swiftui-and-tca
takehilo
0
390
Untangling Coroutine Testing (Droidcon Berlin 2022)
zsmb
1
480
Automating Gradle benchmarks at N26
ubiratansoares
PRO
1
140
Featured
See All Featured
Three Pipe Problems
jasonvnalue
89
8.7k
Large-scale JavaScript Application Architecture
addyosmani
499
110k
Design by the Numbers
sachag
271
17k
Navigating Team Friction
lara
175
11k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
151
13k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
7
1.1k
The Language of Interfaces
destraynor
148
21k
WebSockets: Embracing the real-time Web
robhawkes
57
5.5k
The World Runs on Bad Software
bkeepers
PRO
57
5.4k
10 Git Anti Patterns You Should be Aware of
lemiorhan
638
52k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
39
13k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
107
16k
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!