Media: Relocate localization to wp_enqueue_media(). see #22186, #21390.

git-svn-id: http://core.svn.wordpress.org/trunk@22516 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Daryl Koopersmith 2012-11-10 00:37:13 +00:00
parent c57076aab7
commit ef1889a89b
2 changed files with 38 additions and 38 deletions

View File

@ -1297,6 +1297,44 @@ function wp_prepare_attachment_for_js( $attachment ) {
* @since 3.5.0
*/
function wp_enqueue_media() {
wp_localize_script( 'media-views', '_wpMediaViewsL10n', array(
// Generic
'insertMedia' => __( 'Insert Media' ),
'search' => __( 'Search' ),
'select' => __( 'Select' ),
'cancel' => __( 'Cancel' ),
'addImages' => __( 'Add images' ),
'selected' => __( 'selected' ),
// Upload
'uploadFilesTitle' => __( 'Upload Files' ),
'selectFiles' => __( 'Select files' ),
'uploadImagesTitle' => __( 'Upload Images' ),
// Library
'mediaLibraryTitle' => __( 'Media Library' ),
'createNewGallery' => __( 'Create a new gallery' ),
'insertIntoPost' => __( 'Insert into post' ),
// Embed
'embedFromUrlTitle' => __( 'Embed From URL' ),
// Batch
'batchInsert' => __( 'Batch insert' ),
'cancelBatchTitle' => __( '← Cancel Batch' ),
'editBatchTitle' => __( 'Edit Batch' ),
'addToBatch' => __( 'Add to batch' ),
// Gallery
'createGalleryTitle' => __( 'Create Gallery' ),
'editGalleryTitle' => __( 'Edit Gallery' ),
'cancelGalleryTitle' => __( '← Cancel Gallery' ),
'insertGallery' => __( 'Insert gallery' ),
'updateGallery' => __( 'Update gallery' ),
'continueEditing' => __( 'Continue editing' ),
'addToGallery' => __( 'Add to gallery' ),
) );
wp_enqueue_script( 'media-upload' );
wp_enqueue_style( 'media-views' );
wp_plupload_default_settings();

View File

@ -324,44 +324,6 @@ function wp_default_scripts( &$scripts ) {
) );
$scripts->add( 'media-views', "/wp-includes/js/media-views$suffix.js", array( 'media-models', 'wp-plupload' ), false, 1 );
did_action( 'init' ) && $scripts->localize( 'media-views', '_wpMediaViewsL10n', array(
// Generic
'insertMedia' => __( 'Insert Media' ),
'search' => __( 'Search' ),
'select' => __( 'Select' ),
'cancel' => __( 'Cancel' ),
'addImages' => __( 'Add images' ),
'selected' => __( 'selected' ),
// Upload
'uploadFilesTitle' => __( 'Upload Files' ),
'selectFiles' => __( 'Select files' ),
'uploadImagesTitle' => __( 'Upload Images' ),
// Library
'mediaLibraryTitle' => __( 'Media Library' ),
'createNewGallery' => __( 'Create a new gallery' ),
'insertIntoPost' => __( 'Insert into post' ),
// Embed
'embedFromUrlTitle' => __( 'Embed From URL' ),
// Batch
'batchInsert' => __( 'Batch insert' ),
'cancelBatchTitle' => __( '← Cancel Batch' ),
'editBatchTitle' => __( 'Edit Batch' ),
'addToBatch' => __( 'Add to batch' ),
// Gallery
'createGalleryTitle' => __( 'Create Gallery' ),
'editGalleryTitle' => __( 'Edit Gallery' ),
'cancelGalleryTitle' => __( '← Cancel Gallery' ),
'insertGallery' => __( 'Insert gallery' ),
'updateGallery' => __( 'Update gallery' ),
'continueEditing' => __( 'Continue editing' ),
'addToGallery' => __( 'Add to gallery' ),
) );
$scripts->add( 'shortcode', "/wp-includes/js/shortcode$suffix.js", array( 'underscore' ), false, 1 );
$scripts->add( 'mce-view', "/wp-includes/js/mce-view$suffix.js", array( 'shortcode', 'media-models' ), false, 1 );
did_action( 'init' ) && $scripts->localize( 'mce-view', '_wpMceViewL10n', array(