More translation cleanups.

Affects widgets (see #27112), custom headers (see #21785), theme installer (see #27055, reverts [27614]), and some media stuff. Untranslates some complicated strings that need additional study.

see #27453.

Built from https://develop.svn.wordpress.org/trunk@27620


git-svn-id: http://core.svn.wordpress.org/trunk@27463 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2014-03-19 08:18:14 +00:00
parent 8a50510c0a
commit deb8779af5
9 changed files with 35 additions and 57 deletions

View File

@ -46,7 +46,7 @@ wp_localize_script( 'theme', '_wpThemeSettings', array(
'l10n' => array(
'addNew' => __( 'Add New Theme' ),
'search' => __( 'Search Themes' ),
'searchPlaceholder' => __( 'Search themes…' ),
'searchPlaceholder' => __( 'Search themes...' ), // placeholder (no ellipsis)
'upload' => __( 'Upload Theme' ),
'back' => __( 'Back' ),
'error' => ( 'There was a problem trying to load the themes. Please, try again.' ), // @todo improve

View File

@ -104,7 +104,7 @@ wp_localize_script( 'theme', '_wpThemeSettings', array(
'l10n' => array(
'addNew' => __( 'Add New Theme' ),
'search' => __( 'Search Installed Themes' ),
'searchPlaceholder' => __( 'Search installed themes...' ),
'searchPlaceholder' => __( 'Search installed themes...' ), // placeholder (no ellipsis)
),
) );

View File

@ -748,12 +748,6 @@ final class WP_Customize_Header_Image_Control extends WP_Customize_Image_Control
'add' => wp_create_nonce( 'header-add' ),
'remove' => wp_create_nonce( 'header-remove' ),
),
'l10n' => array(
/* translators: header images uploaded by user */
'uploaded' => __( 'uploaded' ),
/* translators: header images suggested by the current theme */
'default' => __( 'suggested' )
),
'uploads' => $this->uploaded_headers,
'defaults' => $this->default_headers
) );
@ -972,20 +966,15 @@ final class WP_Customize_Header_Image_Control extends WP_Customize_Image_Control
<div class="customize-control-content">
<p class="customizer-section-intro">
<?php _e( 'Personalize your site with your own header image.' ); ?>
<?php
// @todo translate (and look to custom-header.php for inspiration)
echo ( 'Personalize your site with your own header image.' );
if ( $width && $height ) {
printf( __( 'While you can crop images to your liking after clicking <strong>%s</strong>, your theme recommends a header size of <strong>%dx%d</strong> pixels.' ),
_x( 'Add new', 'header image' ), $width, $height );
printf( ( 'While you can crop images to your liking after clicking <strong>Add new</strong>, your theme recommends a header size of <strong>%d &times; %d</strong> pixels.' ), $width, $height );
} elseif ( $width ) {
printf( ( 'While you can crop images to your liking after clicking <strong>Add new</strong>, your theme recommends a header width of <strong>%d</strong> pixels.' ), $width );
} else {
if ( $width ) {
printf( __( 'While you can crop images to your liking after clicking <strong>%s</strong>, your theme recommends a header width of <strong>%d</strong> pixels.' ),
_x( 'Add new', 'header image' ), $width );
}
if ( $height ) {
printf( __( 'While you can crop images to your liking after clicking <strong>%s</strong>, your theme recommends a header height of <strong>%d</strong> pixels.' ),
_x( 'Add new', 'header image' ), $height );
}
printf( ( 'While you can crop images to your liking after clicking <strong>Add new</strong>, your theme recommends a header height of <strong>%d</strong> pixels.' ), $height );
}
?>
</p>

View File

@ -296,6 +296,7 @@ class WP_Customize_Widgets {
$section_id = sprintf( 'sidebar-widgets-%s', $sidebar_id );
if ( $is_active_sidebar ) {
$section_args = array(
/* translators: %s: sidebar name */
'title' => sprintf( __( 'Widgets: %s' ), $GLOBALS['wp_registered_sidebars'][$sidebar_id]['name'] ),
'description' => $GLOBALS['wp_registered_sidebars'][$sidebar_id]['description'],
'priority' => 1000 + array_search( $sidebar_id, array_keys( $wp_registered_sidebars ) ),
@ -457,20 +458,17 @@ class WP_Customize_Widgets {
}
$widget_reorder_nav_tpl = sprintf(
'<div class="widget-reorder-nav"><span class="move-widget" tabindex="0" title="%1$s">%2$s</span><span class="move-widget-down" tabindex="0" title="%3$s">%4$s</span><span class="move-widget-up" tabindex="0" title="%5$s">%6$s</span></div>',
esc_attr__( 'Move to another area...' ),
esc_html__( 'Move to another area...' ),
esc_attr__( 'Move down' ),
esc_html__( 'Move down' ),
esc_attr__( 'Move up' ),
esc_html__( 'Move up' )
'<div class="widget-reorder-nav"><span class="move-widget" tabindex="0">%1$s</span><span class="move-widget-down" tabindex="0">%2$s</span><span class="move-widget-up" tabindex="0">%3$s</span></div>',
__( 'Move to another area&hellip;' ),
__( 'Move down' ),
__( 'Move up' )
);
$move_widget_area_tpl = str_replace(
array( '{description}', '{btn}' ),
array(
esc_html__( 'Select an area to move this widget into:' ),
esc_html__( 'Move' ),
( 'Select an area to move this widget into:' ), // @todo translate
esc_html_x( 'Move', 'move widget' ),
),
'
<div class="move-widget-area">
@ -497,10 +495,11 @@ class WP_Customize_Widgets {
'registered_widgets' => $GLOBALS['wp_registered_widgets'],
'available_widgets' => $available_widgets, // @todo Merge this with registered_widgets
'i18n' => array(
'save_btn_label' => _x( 'Apply', 'button to save changes to a widget' ),
'save_btn_tooltip' => _x( 'Save and preview changes before publishing them.', 'tooltip on the widget save button' ),
'remove_btn_label' => _x( 'Remove', 'link to move a widget to the inactive widgets sidebar' ),
'remove_btn_tooltip' => _x( 'Trash widget by moving it to the inactive widgets sidebar.', 'tooltip on btn a widget to move it to the inactive widgets sidebar' ),
'save_btn_label' => __( 'Apply' ),
// @todo translate? do we want these tooltips?
'save_btn_tooltip' => ( 'Save and preview changes before publishing them.' ),
'remove_btn_label' => __( 'Remove' ),
'remove_btn_tooltip' => ( 'Trash widget by moving it to the inactive widgets sidebar.' ),
),
'tpl' => array(
'widget_reorder_nav' => $widget_reorder_nav_tpl,
@ -733,7 +732,7 @@ class WP_Customize_Widgets {
'registered_sidebars' => array_values( $GLOBALS['wp_registered_sidebars'] ),
'registered_widgets' => $GLOBALS['wp_registered_widgets'],
'i18n' => array(
'widget_tooltip' => __( 'Press shift and then click to edit widget in customizer...' ),
'widget_tooltip' => ( 'Shift-click to edit this widget.' ),
),
);
foreach ( $exports['registered_widgets'] as &$registered_widget ) {
@ -1031,13 +1030,13 @@ class WP_Customize_Widgets {
try {
if ( ! check_ajax_referer( self::UPDATE_WIDGET_AJAX_ACTION, self::UPDATE_WIDGET_NONCE_POST_KEY, false ) ) {
throw new Widget_Customizer_Exception( __( 'Nonce check failed. Reload and try again?' ) );
throw new Widget_Customizer_Exception( ( 'Nonce check failed. Reload and try again?' ) );
}
if ( ! current_user_can( 'edit_theme_options' ) ) {
throw new Widget_Customizer_Exception( __( 'Current user cannot!' ) );
throw new Widget_Customizer_Exception( ( 'Current user cannot!' ) ); // @todo translate
}
if ( ! isset( $_POST['widget-id'] ) ) {
throw new Widget_Customizer_Exception( __( 'Incomplete request' ) );
throw new Widget_Customizer_Exception( ( 'Incomplete request' ) ); // @todo translate
}
unset( $_POST[self::UPDATE_WIDGET_NONCE_POST_KEY], $_POST['action'] );

View File

@ -135,13 +135,10 @@
},
extendedModel: function() {
var c = this.model.get('collection'),
t = _wpCustomizeHeader.l10n[c.type] || '';
var c = this.model.get('collection');
return _.extend(this.model.toJSON(), {
// -1 to exclude the randomize button
nImages: c.size() - 1,
type: t
nImages: c.size() - 1
});
},

View File

@ -1 +1 @@
!function(a,b,c){if(b&&b.customize){var d=b.customize;d.HeaderTool.CurrentView=b.Backbone.View.extend({template:b.template("header-current"),initialize:function(){this.listenTo(this.model,"change",this.render),this.render()},render:function(){return this.$el.html(this.template(this.model.toJSON())),this.setPlaceholder(),this.setButtons(),this},getHeight:function(){var a,b=this.$el.find("img"),c=this.model.get("savedHeight"),e=b.height()||c;return b.length?this.$el.find(".inner").hide():this.$el.find(".inner").show(),e||(a=d.get().header_image_data,e=a&&a.width&&a.height?260/a.width*a.height:40),e},setPlaceholder:function(a){var b=a||this.getHeight();this.model.set("savedHeight",b),this.$el.add(this.$el.find(".placeholder")).height(b)},setButtons:function(){var b=a(".actions .remove");this.model.get("choice")?b.show():b.hide()}}),function(){var a=0;d.HeaderTool.ChoiceView=b.Backbone.View.extend({template:b.template("header-choice"),className:"header-view",events:{"click .choice,.random":"select","click .close":"removeImage"},initialize:function(){var a=[this.model.get("header").url,this.model.get("choice")];this.listenTo(this.model,"change",this.render),c.contains(a,d.get().header_image)&&d.HeaderTool.currentHeader.set(this.extendedModel())},render:function(){var b=this.model;return this.$el.html(this.template(this.extendedModel())),b.get("random")?this.setPlaceholder(40):a=this.getHeight(),this.$el.toggleClass("hidden",b.get("hidden")),this},extendedModel:function(){var a=this.model.get("collection"),b=_wpCustomizeHeader.l10n[a.type]||"";return c.extend(this.model.toJSON(),{nImages:a.size()-1,type:b})},getHeight:d.HeaderTool.CurrentView.prototype.getHeight,setPlaceholder:d.HeaderTool.CurrentView.prototype.setPlaceholder,select:function(){this.model.save(),d.HeaderTool.currentHeader.set(this.extendedModel())},removeImage:function(a){a.stopPropagation(),this.model.destroy(),this.remove()}})}(),d.HeaderTool.ChoiceListView=b.Backbone.View.extend({initialize:function(){this.listenTo(this.collection,"add",this.addOne),this.listenTo(this.collection,"remove",this.render),this.listenTo(this.collection,"sort",this.render),this.listenTo(this.collection,"change:hidden",this.toggleTitle),this.listenTo(this.collection,"change:hidden",this.setMaxListHeight),this.render()},render:function(){this.$el.empty(),this.collection.each(this.addOne,this),this.toggleTitle()},addOne:function(a){var b;a.set({collection:this.collection}),b=new d.HeaderTool.ChoiceView({model:a}),this.$el.append(b.render().el)},toggleTitle:function(){var a=this.$el.parents().prev(".customize-control-title");this.collection.shouldHideTitle()?a.hide():a.show()}}),d.HeaderTool.CombinedList=b.Backbone.View.extend({initialize:function(a){this.collections=a,this.on("all",this.propagate,this)},propagate:function(a,b){c.each(this.collections,function(c){c.trigger(a,b)})}})}}(jQuery,window.wp,_);
!function(a,b,c){if(b&&b.customize){var d=b.customize;d.HeaderTool.CurrentView=b.Backbone.View.extend({template:b.template("header-current"),initialize:function(){this.listenTo(this.model,"change",this.render),this.render()},render:function(){return this.$el.html(this.template(this.model.toJSON())),this.setPlaceholder(),this.setButtons(),this},getHeight:function(){var a,b=this.$el.find("img"),c=this.model.get("savedHeight"),e=b.height()||c;return b.length?this.$el.find(".inner").hide():this.$el.find(".inner").show(),e||(a=d.get().header_image_data,e=a&&a.width&&a.height?260/a.width*a.height:40),e},setPlaceholder:function(a){var b=a||this.getHeight();this.model.set("savedHeight",b),this.$el.add(this.$el.find(".placeholder")).height(b)},setButtons:function(){var b=a(".actions .remove");this.model.get("choice")?b.show():b.hide()}}),function(){var a=0;d.HeaderTool.ChoiceView=b.Backbone.View.extend({template:b.template("header-choice"),className:"header-view",events:{"click .choice,.random":"select","click .close":"removeImage"},initialize:function(){var a=[this.model.get("header").url,this.model.get("choice")];this.listenTo(this.model,"change",this.render),c.contains(a,d.get().header_image)&&d.HeaderTool.currentHeader.set(this.extendedModel())},render:function(){var b=this.model;return this.$el.html(this.template(this.extendedModel())),b.get("random")?this.setPlaceholder(40):a=this.getHeight(),this.$el.toggleClass("hidden",b.get("hidden")),this},extendedModel:function(){var a=this.model.get("collection");return c.extend(this.model.toJSON(),{nImages:a.size()-1})},getHeight:d.HeaderTool.CurrentView.prototype.getHeight,setPlaceholder:d.HeaderTool.CurrentView.prototype.setPlaceholder,select:function(){this.model.save(),d.HeaderTool.currentHeader.set(this.extendedModel())},removeImage:function(a){a.stopPropagation(),this.model.destroy(),this.remove()}})}(),d.HeaderTool.ChoiceListView=b.Backbone.View.extend({initialize:function(){this.listenTo(this.collection,"add",this.addOne),this.listenTo(this.collection,"remove",this.render),this.listenTo(this.collection,"sort",this.render),this.listenTo(this.collection,"change:hidden",this.toggleTitle),this.listenTo(this.collection,"change:hidden",this.setMaxListHeight),this.render()},render:function(){this.$el.empty(),this.collection.each(this.addOne,this),this.toggleTitle()},addOne:function(a){var b;a.set({collection:this.collection}),b=new d.HeaderTool.ChoiceView({model:a}),this.$el.append(b.render().el)},toggleTitle:function(){var a=this.$el.parents().prev(".customize-control-title");this.collection.shouldHideTitle()?a.hide():a.show()}}),d.HeaderTool.CombinedList=b.Backbone.View.extend({initialize:function(a){this.collections=a,this.on("all",this.propagate,this)},propagate:function(a,b){c.each(this.collections,function(c){c.trigger(a,b)})}})}}(jQuery,window.wp,_);

View File

@ -512,8 +512,8 @@ function wp_print_media_templates() {
<?php
$playlist_styles = array(
'light' => _x( 'Light', 'light playlist theme' ),
'dark' => _x( 'Dark', 'dark playlist theme' )
'light' => _x( 'Light', 'playlist theme' ),
'dark' => _x( 'Dark', 'playlist theme' )
);
/** This filter is documented in wp-includes/media.php */
@ -814,7 +814,7 @@ function wp_print_media_templates() {
<div class="setting preload">
<span><?php _e( 'Preload' ); ?></span>
<div class="button-group button-large" data-setting="preload">
<button class="button" value="auto"><?php _e( 'Auto' ); ?></button>
<button class="button" value="auto"><?php _ex( 'Auto', 'auto preload video' ); ?></button>
<button class="button" value="metadata"><?php _e( 'Metadata' ); ?></button>
<button class="button active" value="none"><?php _e( 'None' ); ?></button>
</div>
@ -919,7 +919,7 @@ function wp_print_media_templates() {
<div class="clear"></div>
<label class="setting" data-setting="content">
<span><?php _e( 'Tracks (subtitles, captions, descriptions, chapters or metadata)' ); ?></span>
<span><?php _e( 'Tracks (subtitles, captions, descriptions, chapters, or metadata)' ); ?></span>
<#
var content = '';
if ( ! _.isEmpty( data.model.content ) ) {

View File

@ -1124,8 +1124,8 @@ function wp_get_playlist( $attr, $type ) {
}
$playlist_styles = array(
'light' => _x( 'Light', 'light playlist theme' ),
'dark' => _x( 'Dark', 'dark playlist theme' )
'light' => _x( 'Light', 'playlist theme' ),
'dark' => _x( 'Dark', 'playlist theme' )
);
/**
@ -2480,20 +2480,13 @@ function wp_enqueue_media( $args = array() ) {
'editImage' => __( 'Edit Image' ),
// Crop Image
/* translators: title for Media Manager library view */
'chooseImage' => __( 'Choose Image' ),
/* translators: button to select an image from the MM library to crop */
'selectAndCrop' => __( 'Select and Crop' ),
/* translators: button to choose not to crop the selected image */
'skipCropping' => __( 'Skip Cropping' ),
/* translators: button to choose to crop the selected image */
'cropImage' => __( 'Crop Image' ),
'cropYourImage' => __( 'Crop your image' ),
/* translators: button label changes to this while the image is being cropped server-side */
'cropping' => __( 'Cropping...' ),
/* translators: suggested width of header image in pixels */
'cropping' => __( 'Cropping&hellip;' ),
'suggestedWidth' => __( 'Suggested width is %d pixels.' ),
/* translators: suggested height of header image in pixels */
'suggestedHeight' => __( 'Suggested height is %d pixels.' ),
'mediaHTML5Text' => __( 'Add alternate sources for maximum HTML5 playback:' ),

View File

@ -497,7 +497,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'media', "/wp-admin/js/media$suffix.js", array( 'jquery' ), false, 1 );
did_action( 'init' ) && $scripts->localize( 'media', 'attachMediaBoxL10n', array(
'error' => __( 'An error has occured. Please reload the page and try again.' )
'error' => __( 'An error has occurred. Please reload the page and try again.' ),
));
$scripts->add( 'image-edit', "/wp-admin/js/image-edit$suffix.js", array('jquery', 'json2', 'imgareaselect'), false, 1 );