Changeset 1963455
- Timestamp:
- 10/26/2018 10:44:51 AM (7 years ago)
- Location:
- nothing-much/trunk
- Files:
-
- 2 edited
-
js/nothing-much.js (modified) (1 diff)
-
nothing-much.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
nothing-much/trunk/js/nothing-much.js
r1963446 r1963455 1 var __ = wp.i18n.__; 2 var sprintf = wp.i18n.sprintf; 1 jQuery( function () { 2 var __ = wp.i18n.__; 3 var sprintf = wp.i18n.sprintf; 3 4 4 5 // String also in PHP: 5 console.log(6 __( 'Yo, we told you this plugin didn’t do much. Test Trunk', 'nothing-much' )7 );6 console.log( 7 __( 'Yo, we told you this plugin didn’t do much. Test Trunk', 'nothing-much' ) 8 ); 8 9 9 10 // String unique to JavaScript: 10 console.log(11 __( 'Yo, this plugin isn’t doing much in JavaScript.', 'nothing-much' )12 );11 console.log( 12 __( 'Yo, this plugin isn’t doing much in JavaScript.', 'nothing-much' ) 13 ); 13 14 14 console.log(15 __( 'Yo, this plugin isn’t doing much in JavaScript.', 'nothing-much' )16 );15 console.log( 16 __( 'Yo, this plugin isn’t doing much in JavaScript.', 'nothing-much' ) 17 ); 17 18 18 console.log( 19 // translators: %s: The name of this plugin. 20 sprintf( __( 'Yo, this plugin is named %s.' ), 'nothing-much' ) 21 ); 19 console.log( 20 // translators: %s: The name of this plugin. 21 sprintf( __( 'Yo, this plugin is named %s.' ), 'nothing-much' ) 22 ); 23 } ); -
nothing-much/trunk/nothing-much.php
r1963446 r1963455 14 14 add_action( 'admin_init', array( $this, 'load_textdomain' ) ); 15 15 add_action( 'admin_notices', array( $this, 'admin_notices' ) ); 16 add_action( ' wp_enqueue_scripts', array( $this, 'admin_enqueue_script' ) );16 add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_script' ) ); 17 17 } 18 18 … … 28 28 29 29 public function enqueue_script() { 30 wp_enqueue_script( 'nothing-much-script', plugins_url( '/js/n ewscript.js' , __FILE__) );30 wp_enqueue_script( 'nothing-much-script', plugins_url( '/js/nothing-much.js' , __FILE__ ), array( 'jquery', 'wp-i18n' ) ); 31 31 32 32 if ( function_exists( 'wp_set_script_translations' ) ) {
Note: See TracChangeset
for help on using the changeset viewer.