Index: wp-admin/js/wp-fullscreen.dev.js
===================================================================
--- wp-admin/js/wp-fullscreen.dev.js	(revision 19197)
+++ wp-admin/js/wp-fullscreen.dev.js	(working copy)
@@ -138,8 +138,8 @@
 			return;
 
 		// Settings can be added or changed by defining "wp_fullscreen_settings" JS object.
-		// This can be done by defining it as PHP array and passing it to JS with:
-		// add_script_data( 'wp-fullscreen', 'wp_fullscreen_settings', $settings_array )
+		// This can be done by defining it as PHP array, json encoding it and passing it to JS with:
+		// add_script_extra( 'wp-fullscreen', 'wp_fullscreen_settings = ' . $settings_array )
 		if ( typeof(wp_fullscreen_settings) == 'object' )
 			$.extend( s, wp_fullscreen_settings );
 
Index: wp-includes/class.wp-scripts.php
===================================================================
--- wp-includes/class.wp-scripts.php	(revision 19197)
+++ wp-includes/class.wp-scripts.php	(working copy)
@@ -47,42 +47,22 @@
 		return $this->do_items( $handles, $group );
 	}
 
-	// Deprecated since 3.3, see print_script_data()
+	// Deprecated since 3.3, see print_script_extra()
 	function print_scripts_l10n( $handle, $echo = true ) {
-		_deprecated_function( __FUNCTION__, '3.3', 'print_script_data()' );
-		return $this->print_script_data( $handle, $echo, true );
+		_deprecated_function( __FUNCTION__, '3.3', 'print_script_extra()' );
+		return $this->print_script_extra( $handle, $echo );
 	}
 
-	function print_script_data( $handle, $echo = true, $_l10n = false ) {
-		if ( $_l10n ) {
-			list( $name, $data ) = $this->get_data( $handle, 'l10n' );
-			$after = '';
+	function print_script_extra( $handle, $echo = true ) {
+		if ( !$output = $this->get_data( $handle, 'data' ) )
+			return;
 
-			if ( is_array($data) && isset($data['l10n_print_after']) ) {
-				$after = $data['l10n_print_after'];
-				unset($data['l10n_print_after']);
-			}
-
-			$data = $this->decode_html_entities($data);
-			$output = "var $name = " . json_encode( $data ) . "; $after\n";
-		} else {
-			$data = $this->get_data( $handle, 'data' );
-
-			if ( empty( $data ) )
-				return false;
-
-			foreach ( (array) $data as $name => $value ) {
-				$value = $this->decode_html_entities($value);
-				$output = "var $name = " . json_encode( $value ) . ";\n";
-			}
-		}
-
 		if ( !$echo )
 			return $output;
 
-		echo "<script type='text/javascript'>\n";
-		echo "/* <![CDATA[ */\n"; // CDATA is not needed for HTML 5
-		echo $output;
+		echo "<script type='text/javascript'>\n"; // CDATA and type='text/javascript' is not needed for HTML 5
+		echo "/* <![CDATA[ */\n";
+		echo "$output\n";
 		echo "/* ]]> */\n";
 		echo "</script>\n";
 
@@ -114,7 +94,7 @@
 		if ( $this->do_concat ) {
 			$srce = apply_filters( 'script_loader_src', $src, $handle );
 			if ( $this->in_default_dir($srce) ) {
-				$this->print_code .= $this->print_script_data( $handle, false );
+				$this->print_code .= $this->print_script_extra( $handle, false );
 				$this->concat .= "$handle,";
 				$this->concat_version .= "$handle$ver";
 				return true;
@@ -124,15 +104,16 @@
 			}
 		}
 
-		$this->print_script_data( $handle );
+		$this->print_script_extra( $handle );
 		if ( !preg_match('|^https?://|', $src) && ! ( $this->content_url && 0 === strpos($src, $this->content_url) ) ) {
 			$src = $this->base_url . $src;
 		}
 
 		if ( !empty($ver) )
 			$src = add_query_arg('ver', $ver, $src);
-		$src = esc_url(apply_filters( 'script_loader_src', $src, $handle ));
 
+		$src = esc_url( apply_filters( 'script_loader_src', $src, $handle ) );
+
 		if ( $this->do_concat )
 			$this->print_html .= "<script type='text/javascript' src='$src'></script>\n";
 		else
@@ -142,15 +123,29 @@
 	}
 
 	/**
-	 * Localizes a script (Deprecated)
+	 * Localizes a script
 	 *
 	 * Localizes only if script has already been added
-	 *
-	 * @deprecated WP 3.3
 	 */
 	function localize( $handle, $object_name, $l10n ) {
-		_deprecated_function( __FUNCTION__, '3.3', 'add_script_data()' );
-		return $this->add_script_data( $handle, $object_name, $l10n );
+		if ( is_array($l10n) && isset($l10n['l10n_print_after']) ) { // back compat, preserve the code in 'l10n_print_after' if present
+			$after = $l10n['l10n_print_after'];
+			unset($l10n['l10n_print_after']);
+		}
+
+		foreach ( (array) $l10n as $key => $value ) {
+			if ( !is_scalar($value) )
+				continue;
+
+			$l10n[$key] = html_entity_decode( (string) $value, ENT_QUOTES, 'UTF-8');
+		}
+
+		$data = "var $object_name = " . json_encode($l10n) . ';';
+
+		if ( !empty($after) )
+			$data .= "\n$after";
+
+		return $this->add_script_extra( $handle, $data );
 	}
 
 	/**
@@ -159,20 +154,19 @@
 	 * Only if script has already been added.
 	 *
 	 * @param string $handle Script name
-	 * @param string $name Name of JS object to hold the data
-	 * @param array $args Associative array of JS object attributes
+	 * @param string $extra Extra JS to add before the script
 	 * @return bool Successful or not
 	 */
-	function add_script_data( $handle, $name, $args ) {
-		if ( !$name || !is_array( $args ) )
+	function add_script_extra( $handle, $extra ) {
+		if ( !is_string( $extra ) )
 			return false;
 
 		$data = $this->get_data( $handle, 'data' );
 
-		if ( !empty( $data[$name] ) )
-			$args = array_merge( $data[$name], $args );
+		if ( !empty( $data ) )
+			$extra = "$data;\n$extra";
 
-		return $this->add_data( $handle, 'data', array( $name => $args ) );
+		return $this->add_data( $handle, 'data', $extra );
 	}
 
 	function set_group( $handle, $recursion, $group = false ) {
@@ -219,16 +213,6 @@
 		return false;
 	}
 
-	function decode_html_entities($data) {
-		foreach ( (array) $data as $key => $value ) {
-			if ( is_array($value) )
-				$data[$key] = $this->decode_html_entities($value);
-			elseif ( is_string($value) )
-				$data[$key] = html_entity_decode($value, ENT_QUOTES, 'UTF-8');
-		}
-		return $data;
-	}
-
 	function reset() {
 		$this->do_concat = false;
 		$this->print_code = '';
Index: wp-includes/functions.wp-scripts.php
===================================================================
--- wp-includes/functions.wp-scripts.php	(revision 19197)
+++ wp-includes/functions.wp-scripts.php	(working copy)
@@ -25,9 +25,7 @@
 
 	global $wp_scripts;
 	if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) {
-		if ( ! did_action( 'init' ) )
-			_doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
-				'<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>init</code>' ), '3.3' );
+		_scripts_doing_it_wrong(__FUNCTION__);
 
 		if ( !$handles )
 			return array(); // No need to instantiate if nothing is there.
@@ -52,9 +50,7 @@
 function wp_register_script( $handle, $src, $deps = array(), $ver = false, $in_footer = false ) {
 	global $wp_scripts;
 	if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) {
-		if ( ! did_action( 'init' ) )
-			_doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
-				'<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>init</code>' ), '3.3' );
+		_scripts_doing_it_wrong(__FUNCTION__);
 		$wp_scripts = new WP_Scripts();
 	}
 
@@ -64,6 +60,24 @@
 }
 
 /**
+ * Wrapper for $wp_scripts->localize().
+ *
+ * Used to localizes a script. 
+ * See http://core.trac.wordpress.org/ticket/11520 for more information.
+ *
+ * @since r16
+ */
+function wp_localize_script( $handle, $object_name, $l10n ) { 
+	global $wp_scripts;
+	if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) {
+		_scripts_doing_it_wrong(__FUNCTION__);
+		return false;
+	}
+
+	return $wp_scripts->localize( $handle, $object_name, $l10n ); 
+} 
+
+/**
  * Adds extra Javascript data.
  *
  * Works only if the script has already been added.
@@ -79,18 +93,16 @@
  * the last value overwrites the previous. The function is named "localize_script" because of historical reasons.
  *
  * @since r16
- * @see WP_Scripts::add_script_data()
+ * @see WP_Scripts::add_script_extra()
  */
-function wp_localize_script( $handle, $name, $data ) {
+function wp_add_script_extra( $handle, $extra ) {
 	global $wp_scripts;
 	if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) {
-		if ( ! did_action( 'init' ) )
-			_doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
-				'<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>init</code>' ), '3.3' );
+		_scripts_doing_it_wrong(__FUNCTION__);
 		return false;
 	}
 
-	return $wp_scripts->add_script_data( $handle, $name, $data );
+	return $wp_scripts->add_script_extra( $handle, $extra );
 }
 
 /**
@@ -102,9 +114,7 @@
 function wp_deregister_script( $handle ) {
 	global $wp_scripts;
 	if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) {
-		if ( ! did_action( 'init' ) )
-			_doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
-				'<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>init</code>' ), '3.3' );
+		_scripts_doing_it_wrong(__FUNCTION__);
 		$wp_scripts = new WP_Scripts();
 	}
 
@@ -122,9 +132,7 @@
 function wp_enqueue_script( $handle, $src = false, $deps = array(), $ver = false, $in_footer = false ) {
 	global $wp_scripts;
 	if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) {
-		if ( ! did_action( 'init' ) )
-			_doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
-				'<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>init</code>' ), '3.3' );
+		_scripts_doing_it_wrong(__FUNCTION__);
 		$wp_scripts = new WP_Scripts();
 	}
 
@@ -146,9 +154,7 @@
 function wp_dequeue_script( $handle ) {
 	global $wp_scripts;
 	if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) {
-		if ( ! did_action( 'init' ) )
-			_doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
-				'<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>init</code>' ), '3.3' );
+		_scripts_doing_it_wrong(__FUNCTION__);
 		$wp_scripts = new WP_Scripts();
 	}
 
@@ -170,9 +176,7 @@
 function wp_script_is( $handle, $list = 'queue' ) {
 	global $wp_scripts;
 	if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) {
-		if ( ! did_action( 'init' ) )
-			_doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
-				'<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>init</code>' ), '3.3' );
+		_scripts_doing_it_wrong(__FUNCTION__);
 		$wp_scripts = new WP_Scripts();
 	}
 
@@ -183,3 +187,9 @@
 
 	return $query;
 }
+
+function _scripts_doing_it_wrong($function) {
+	if ( ! did_action( 'init' ) )
+		_doing_it_wrong( $function, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
+			'<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>init</code>' ), '3.3' );
+}
Index: wp-includes/script-loader.php
===================================================================
--- wp-includes/script-loader.php	(revision 19197)
+++ wp-includes/script-loader.php	(working copy)
@@ -62,14 +62,14 @@
 	$scripts->add( 'utils', "/wp-admin/js/utils$suffix.js", false, '20101110' );
 
 	$scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), '20111106', 1 );
-	$scripts->add_script_data( 'common', 'commonL10n', array(
+	$scripts->localize( 'common', 'commonL10n', array(
 		'warnDelete' => __("You are about to permanently delete the selected items.\n  'Cancel' to stop, 'OK' to delete.")
 	) );
 
 	$scripts->add( 'sack', "/wp-includes/js/tw-sack$suffix.js", false, '1.6.1', 1 );
 
 	$scripts->add( 'quicktags', "/wp-includes/js/quicktags$suffix.js", false, '20111105', 1 );
-	$scripts->add_script_data( 'quicktags', 'quicktagsL10n', array(
+	$scripts->localize( 'quicktags', 'quicktagsL10n', array(
 		'wordLookup' => __('Enter a word to look up:'),
 		'dictionaryLookup' => esc_attr(__('Dictionary lookup')),
 		'lookup' => esc_attr(__('lookup')),
@@ -91,13 +91,13 @@
 	$scripts->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.6.1');
 
 	$scripts->add( 'wp-ajax-response', "/wp-includes/js/wp-ajax-response$suffix.js", array('jquery'), '20091119', 1 );
-	$scripts->add_script_data( 'wp-ajax-response', 'wpAjax', array(
+	$scripts->localize( 'wp-ajax-response', 'wpAjax', array(
 		'noPerm' => __('You do not have permission to do that.'),
 		'broken' => __('An unidentified error has occurred.')
 	) );
 
 	$scripts->add( 'wp-pointer', "/wp-includes/js/wp-pointer$suffix.js", array( 'jquery-ui-widget', 'jquery-ui-position' ), '20111017', 1 );
-	$scripts->add_script_data( 'wp-pointer', 'wpPointerL10n', array(
+	$scripts->localize( 'wp-pointer', 'wpPointerL10n', array(
 		'close' => __('Close'),
 	) );
 
@@ -166,7 +166,7 @@
 	$scripts->add( 'jquery-table-hotkeys', "/wp-includes/js/jquery/jquery.table-hotkeys$suffix.js", array('jquery', 'jquery-hotkeys'), '20090102', 1 );
 
 	$scripts->add( 'thickbox', "/wp-includes/js/thickbox/thickbox.js", array('jquery'), '3.1-20110930', 1 );
-	$scripts->add_script_data( 'thickbox', 'thickboxL10n', array(
+	$scripts->localize( 'thickbox', 'thickboxL10n', array(
 			'next' => __('Next &gt;'),
 			'prev' => __('&lt; Prev'),
 			'image' => __('Image'),
@@ -221,7 +221,7 @@
 	$scripts->add( 'plupload-all', false, array('plupload', 'plupload-html5', 'plupload-flash', 'plupload-silverlight', 'plupload-html4'), '1511');
 
 	$scripts->add( 'plupload-handlers', "/wp-includes/js/plupload/handlers$suffix.js", array('plupload-all', 'jquery'), '20111102');
-	$scripts->add_script_data( 'plupload-handlers', 'pluploadL10n', $uploader_l10n );
+	$scripts->localize( 'plupload-handlers', 'pluploadL10n', $uploader_l10n );
 
 	// keep 'swfupload' for back-compat.
 	$scripts->add( 'swfupload', '/wp-includes/js/swfupload/swfupload.js', false, '2201-20110113');
@@ -237,7 +237,7 @@
 	}
 
 	$scripts->add( 'swfupload-handlers', "/wp-includes/js/swfupload/handlers$suffix.js", array('swfupload-all', 'jquery'), '2201-20110524');
-	$scripts->add_script_data( 'swfupload-handlers', 'swfuploadL10n', $uploader_l10n );
+	$scripts->localize( 'swfupload-handlers', 'swfuploadL10n', $uploader_l10n );
 
 	$scripts->add( 'comment-reply', "/wp-includes/js/comment-reply$suffix.js", false, '20090102');
 
@@ -246,7 +246,7 @@
 	$scripts->add( 'imgareaselect', "/wp-includes/js/imgareaselect/jquery.imgareaselect$suffix.js", array('jquery'), '0.9.6-20110515', 1 );
 
 	$scripts->add( 'password-strength-meter', "/wp-admin/js/password-strength-meter$suffix.js", array('jquery'), '20101027', 1 );
-	$scripts->add_script_data( 'password-strength-meter', 'pwsL10n', array(
+	$scripts->localize( 'password-strength-meter', 'pwsL10n', array(
 		'empty' => __('Strength indicator'),
 		'short' => __('Very weak'),
 		'bad' => __('Weak'),
@@ -261,7 +261,7 @@
 	$scripts->add( 'admin-bar', "/wp-includes/js/admin-bar$suffix.js", false, '20111104', 1 );
 
 	$scripts->add( 'wplink', "/wp-includes/js/wplink$suffix.js", array( 'jquery', 'wpdialogs' ), '20110929', 1 );
-	$scripts->add_script_data( 'wplink', 'wpLinkL10n', array(
+	$scripts->localize( 'wplink', 'wpLinkL10n', array(
 		'title' => __('Insert/edit link'),
 		'update' => __('Update'),
 		'save' => __('Add Link'),
@@ -280,7 +280,7 @@
 	if ( is_admin() ) {
 		$scripts->add( 'ajaxcat', "/wp-admin/js/cat$suffix.js", array( 'wp-lists' ), '20090102' );
 		$scripts->add_data( 'ajaxcat', 'group', 1 );
-		$scripts->add_script_data( 'ajaxcat', 'catL10n', array(
+		$scripts->localize( 'ajaxcat', 'catL10n', array(
 			'add' => esc_attr(__('Add')),
 			'how' => __('Separate multiple categories with commas.')
 		) );
@@ -288,7 +288,7 @@
 		$scripts->add( 'admin-categories', "/wp-admin/js/categories$suffix.js", array('wp-lists'), '20091201', 1 );
 
 		$scripts->add( 'admin-tags', "/wp-admin/js/tags$suffix.js", array('jquery', 'wp-ajax-response'), '20110429', 1 );
-		$scripts->add_script_data( 'admin-tags', 'tagsl10n', array(
+		$scripts->localize( 'admin-tags', 'tagsl10n', array(
 			'noPerm' => __('You do not have permission to do that.'),
 			'broken' => __('An unidentified error has occurred.')
 		));
@@ -296,7 +296,7 @@
 		$scripts->add( 'admin-custom-fields', "/wp-admin/js/custom-fields$suffix.js", array('wp-lists'), '20110429', 1 );
 
 		$scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array('wp-lists', 'quicktags', 'jquery-query'), '20111026', 1 );
-		$scripts->add_script_data( 'admin-comments', 'adminCommentsL10n', array(
+		$scripts->localize( 'admin-comments', 'adminCommentsL10n', array(
 			'hotkeys_highlight_first' => isset($_GET['hotkeys_highlight_first']),
 			'hotkeys_highlight_last' => isset($_GET['hotkeys_highlight_last']),
 			'replyApprove' => __( 'Approve and Reply' ),
@@ -308,7 +308,7 @@
 		$scripts->add( 'postbox', "/wp-admin/js/postbox$suffix.js", array('jquery-ui-sortable'), '20111009a', 1 );
 
 		$scripts->add( 'post', "/wp-admin/js/post$suffix.js", array('suggest', 'wp-lists', 'postbox'), '20110524', 1 );
-		$scripts->add_script_data( 'post', 'postL10n', array(
+		$scripts->localize( 'post', 'postL10n', array(
 			'ok' => __('OK'),
 			'cancel' => __('Cancel'),
 			'publishOn' => __('Publish on:'),
@@ -333,7 +333,7 @@
 
 		$scripts->add( 'comment', "/wp-admin/js/comment$suffix.js", array('jquery'), '20110429' );
 		$scripts->add_data( 'comment', 'group', 1 );
-		$scripts->add_script_data( 'comment', 'commentL10n', array(
+		$scripts->localize( 'comment', 'commentL10n', array(
 			'submittedOn' => __('Submitted on:')
 		) );
 
@@ -346,19 +346,19 @@
 		$scripts->add( 'theme-preview', "/wp-admin/js/theme-preview$suffix.js", array( 'thickbox', 'jquery' ), '20100407', 1 );
 
 		$scripts->add( 'inline-edit-post', "/wp-admin/js/inline-edit-post$suffix.js", array( 'jquery', 'suggest' ), '20110919', 1 );
-		$scripts->add_script_data( 'inline-edit-post', 'inlineEditL10n', array(
+		$scripts->localize( 'inline-edit-post', 'inlineEditL10n', array(
 			'error' => __('Error while saving the changes.'),
 			'ntdeltitle' => __('Remove From Bulk Edit'),
 			'notitle' => __('(no title)')
 		) );
 
 		$scripts->add( 'inline-edit-tax', "/wp-admin/js/inline-edit-tax$suffix.js", array( 'jquery' ), '20110609', 1 );
-		$scripts->add_script_data( 'inline-edit-tax', 'inlineEditL10n', array(
+		$scripts->localize( 'inline-edit-tax', 'inlineEditL10n', array(
 			'error' => __('Error while saving the changes.')
 		) );
 
 		$scripts->add( 'plugin-install', "/wp-admin/js/plugin-install$suffix.js", array( 'jquery', 'thickbox' ), '20110113', 1 );
-		$scripts->add_script_data( 'plugin-install', 'plugininstallL10n', array(
+		$scripts->localize( 'plugin-install', 'plugininstallL10n', array(
 			'plugin_information' => __('Plugin Information:'),
 			'ays' => __('Are you sure you want to install this plugin?')
 		) );
@@ -374,12 +374,12 @@
 		$scripts->add( 'media', "/wp-admin/js/media$suffix.js", array( 'jquery-ui-draggable' ), '20101022', 1 );
 
 		$scripts->add( 'image-edit', "/wp-admin/js/image-edit$suffix.js", array('jquery', 'json2', 'imgareaselect'), '20110927', 1 );
-		$scripts->add_script_data( 'image-edit', 'imageEditL10n', array(
+		$scripts->localize( 'image-edit', 'imageEditL10n', array(
 			'error' => __( 'Could not load the preview image. Please reload the page and try again.' )
 		));
 
 		$scripts->add( 'set-post-thumbnail', "/wp-admin/js/set-post-thumbnail$suffix.js", array( 'jquery' ), '20100518', 1 );
-		$scripts->add_script_data( 'set-post-thumbnail', 'setPostThumbnailL10n', array(
+		$scripts->localize( 'set-post-thumbnail', 'setPostThumbnailL10n', array(
 			'setThumbnail' => __( 'Use as featured image' ),
 			'saving' => __( 'Saving...' ),
 			'error' => __( 'Could not set that as the thumbnail image. Try a different attachment.' ),
@@ -388,7 +388,7 @@
 
 		// Navigation Menus
 		$scripts->add( 'nav-menu', "/wp-admin/js/nav-menu$suffix.js", array('jquery-ui-sortable'), '20110524' );
-		$scripts->add_script_data( 'nav-menu', 'navMenuL10n', array(
+		$scripts->localize( 'nav-menu', 'navMenuL10n', array(
 			'noResultsFound' => _x('No results found.', 'search results'),
 			'warnDeleteMenu' => __( "You are about to permanently delete this menu. \n 'Cancel' to stop, 'OK' to delete." ),
 			'saveAlert' => __('The changes you made will be lost if you navigate away from this page.')
