Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

git-svn-id: http://core.svn.wordpress.org/trunk@22029 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information...
commit 9a0255e60d625a2521813e0809ea480a47621784 1 parent eee7b5a
@koop koop authored
Showing with 14 additions and 8 deletions.
  1. +11 −8 wp-includes/js/media-views.js
  2. +3 −0  wp-includes/script-loader.php
View
19 wp-includes/js/media-views.js
@@ -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
});
@@ -465,22 +468,22 @@
}),
'create-new-gallery': {
- style: 'primary',
- text: 'Create a new gallery',
+ style: 'primary',
+ text: l10n.createNewGallery,
priority: 40,
- click: function() {
+
+ 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
3  wp-includes/script-loader.php
@@ -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 );
Please sign in to comment.
Something went wrong with that request. Please try again.