GWTD: I18N Improvements in WordPress 4.6 And Be...

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

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

53 slides
  1. $switched = switch_to_locale( get_user_locale() ) // Do stuff. if (

    $switched ) { restore_previous_locale(); }
  2. // PHP: wp_localize_script( 'myplugin-script', '_myPluginL10n', array( 'helloWorld' => __( 'Hello

    World','myplugin' ) ) ); // JS: alert( _myPluginL10n.helloWorld );
  3. if ( 1 == number ) { use( _myPluginL10n.singularString );

    } else { use( _myPluginL10n.pluralString ); }

More Decks by Pascal Birchler

Other Decks in Programming