Apply localized strings to media modal. see #21390, #21808.

git-svn-id: http://core.svn.wordpress.org/trunk@22029 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Daryl Koopersmith 2012-09-27 01:11:04 +00:00
parent eee7b5a005
commit 9a0255e60d
2 changed files with 14 additions and 8 deletions

View File

@ -2,8 +2,11 @@
var media = wp.media,
Attachment = media.model.Attachment,
Attachments = media.model.Attachments,
Query = media.model.Query;
Query = media.model.Query,
l10n;
// Link any localized strings.
l10n = media.view.l10n = _.isUndefined( _wpMediaViewsL10n ) ? {} : _wpMediaViewsL10n;
/**
* ========================================================================
@ -386,7 +389,7 @@
this.attachmentsView = new media.view.Attachments({
controller: this.controller,
directions: 'Select stuff.',
directions: this.controller.get('multiple') ? l10n.selectMediaMultiple : l10n.selectMediaSingular,
collection: this.collection
});
@ -466,21 +469,21 @@
'create-new-gallery': {
style: 'primary',
text: 'Create a new gallery',
text: l10n.createNewGallery,
priority: 40,
click: function() {
controller.render('gallery');
}
},
'insert-into-post': {
// style: 'primary',
text: 'Insert into post',
text: l10n.insertIntoPost,
priority: 30
},
'add-to-gallery': {
text: 'Add to gallery',
text: l10n.addToGallery,
priority: 20
}
}

View File

@ -320,6 +320,9 @@ function wp_default_scripts( &$scripts ) {
'insertMedia' => __( 'Insert Media' ),
'selectMediaSingular' => __( 'Select a media file:' ),
'selectMediaMultiple' => __( 'Select one or more media files:' ),
'createNewGallery' => __( 'Create a new gallery' ),
'insertIntoPost' => __( 'Insert into post' ),
'addToGallery' => __( 'Add to gallery' ),
) );
$scripts->add( 'shortcode', "/wp-includes/js/shortcode$suffix.js", array( 'underscore' ), false, 1 );