I18N: Improve translator comments.

* Add missing translator comments.
* Fix placement of some translator comments. Translator comments should be on the line directly above the line containing the translation function call for optimal compatibility with various `.pot` file generation tools. The CS auto-fixing, which changed some inconsistent function calls to multi-line function calls, is part of the reason why this was no longer the case for a select group of translator comments.

Includes minor code layout fixes.

Polyglots, rejoice! All WordPress core files now have translator comments for all strings with placeholders!

Props jrf, subrataemfluence, GaryJ, webdados, Dency, swissspidy, alvarogois, marcomartins, mihaiiceyro, vladwtz, niq1982, flipkeijzer, michielatyoast, chandrapatel, thrijith, joshuanoyce, FesoVik, tessak22, bhaktirajdev, cleancoded, dhavalkasvala, garrett-eclipse, bibliofille, socalchristina, priyankkpatel, 5hel2l2y, adamsilverstein, JeffPaul, pierlo, SergeyBiryukov.
Fixes #44360.
Built from https://develop.svn.wordpress.org/trunk@45926


git-svn-id: http://core.svn.wordpress.org/trunk@45737 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2019-09-01 17:13:59 +00:00
parent 3ab18dba93
commit 16b8d91baa
140 changed files with 1907 additions and 543 deletions

View File

@ -77,7 +77,7 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
if ( current_user_can( 'install_plugins' ) ) {
printf(
/* translators: 1: link to /wp-admin/site-health.php 2: link to /wp-admin/site-health.php?tab=debug */
/* translators: 1: link to /wp-admin/site-health.php, 2: link to /wp-admin/site-health.php?tab=debug */
__( ' <a href="%1$s">Check your site status</a>, and <a href="%2$s">learn how to debug issues</a>.' ),
admin_url( 'site-health.php' ),
admin_url( 'site-health.php?tab=debug' )
@ -142,7 +142,7 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
<p>
<?php
printf(
/* translators: 1: wp_body_open 2: <body> */
/* translators: 1: wp_body_open, 2: <body> */
__( '5.2 introduces a %1$s hook, which lets themes support injecting code right at the beginning of the %2$s element.' ),
'<code>wp_body_open</code>',
'<code>&lt;body&gt;</code>'

View File

@ -32,6 +32,7 @@ global $hook_suffix;
?>
<p id="footer-left" class="alignleft">
<?php
/* translators: %s: https://wordpress.org/ */
$text = sprintf( __( 'Thank you for creating with <a href="%s">WordPress</a>.' ), __( 'https://wordpress.org/' ) );
/**
* Filters the "Thank you" text displayed in the admin footer.

View File

@ -258,6 +258,7 @@ if ( isset( $plugin_page ) ) {
}
if ( ! ( file_exists( WP_PLUGIN_DIR . "/$plugin_page" ) && is_file( WP_PLUGIN_DIR . "/$plugin_page" ) ) && ! ( file_exists( WPMU_PLUGIN_DIR . "/$plugin_page" ) && is_file( WPMU_PLUGIN_DIR . "/$plugin_page" ) ) ) {
/* translators: %s: Admin page generated by a plugin. */
wp_die( sprintf( __( 'Cannot load %s.' ), htmlentities( $plugin_page ) ) );
}

View File

@ -92,10 +92,19 @@ if ( isset( $_REQUEST['post_id'] ) ) {
$id = media_handle_upload( 'async-upload', $post_id );
if ( is_wp_error( $id ) ) {
echo '<div class="error-div error">
<button type="button" class="dismiss button-link" onclick="jQuery(this).parents(\'div.media-item\').slideUp(200, function(){jQuery(this).remove();});">' . __( 'Dismiss' ) . '</button>
<strong>' . sprintf( __( '&#8220;%s&#8221; has failed to upload.' ), esc_html( $_FILES['async-upload']['name'] ) ) . '</strong><br />' .
esc_html( $id->get_error_message() ) . '</div>';
printf(
'<div class="error-div error">%s <strong>%s</strong><br />%s</div>',
sprintf(
'<button type="button" class="dismiss button-link" onclick="jQuery(this).parents(\'div.media-item\').slideUp(200, function(){jQuery(this).remove();});">%s</button>',
__( 'Dismiss' )
),
sprintf(
/* translators: %s: Name of the file that failed to upload. */
__( '&#8220;%s&#8221; has failed to upload.' ),
esc_html( $_FILES['async-upload']['name'] )
),
esc_html( $id->get_error_message() )
);
exit;
}

View File

@ -204,8 +204,8 @@ switch ( $action ) {
<th scope="row"><?php _e( 'Submitted on' ); ?></th>
<td>
<?php
/* translators: 1: comment date, 2: comment time */
$submitted = sprintf(
/* translators: 1: comment date, 2: comment time */
__( '%1$s at %2$s' ),
/* translators: comment date format. See https://secure.php.net/date */
get_comment_date( __( 'Y/m/d' ), $comment ),

View File

@ -207,6 +207,7 @@ do_action( 'customize_controls_print_scripts' );
<div class="accordion-section-title">
<span class="preview-notice">
<?php
/* translators: %s: Site title */
echo sprintf( __( 'You are customizing %s' ), '<strong class="panel-title site-title">' . get_bloginfo( 'name', 'display' ) . '</strong>' );
?>
</span>

View File

@ -152,15 +152,15 @@ if ( $post_id ) {
$comments_count = wp_count_comments( $post_id );
$draft_or_post_title = wp_html_excerpt( _draft_or_post_title( $post_id ), 50, '&hellip;' );
if ( $comments_count->moderated > 0 ) {
/* translators: 1: comments count, 2: post title */
$title = sprintf(
/* translators: 1: comments count, 2: post title */
__( 'Comments (%1$s) on &#8220;%2$s&#8221;' ),
number_format_i18n( $comments_count->moderated ),
$draft_or_post_title
);
} else {
/* translators: %s: post title */
$title = sprintf(
/* translators: %s: post title */
__( 'Comments on &#8220;%s&#8221;' ),
$draft_or_post_title
);
@ -168,8 +168,8 @@ if ( $post_id ) {
} else {
$comments_count = wp_count_comments();
if ( $comments_count->moderated > 0 ) {
/* translators: %s: comments count */
$title = sprintf(
/* translators: %s: comments count */
__( 'Comments (%s)' ),
number_format_i18n( $comments_count->moderated )
);
@ -225,8 +225,8 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
<h1 class="wp-heading-inline">
<?php
if ( $post_id ) {
/* translators: %s: link to post */
printf(
/* translators: %s: link to post */
__( 'Comments on &#8220;%s&#8221;' ),
sprintf(
'<a href="%1$s">%2$s</a>',
@ -243,8 +243,8 @@ if ( $post_id ) {
<?php
if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {
echo '<span class="subtitle">';
/* translators: %s: search keywords */
printf(
/* translators: %s: search keywords */
__( 'Search results for &#8220;%s&#8221;' ),
wp_html_excerpt( esc_html( wp_unslash( $_REQUEST['s'] ) ), 50, '&hellip;' )
);
@ -282,34 +282,34 @@ if ( isset( $_REQUEST['approved'] ) || isset( $_REQUEST['deleted'] ) || isset( $
if ( $approved > 0 || $deleted > 0 || $trashed > 0 || $untrashed > 0 || $spammed > 0 || $unspammed > 0 || $same > 0 ) {
if ( $approved > 0 ) {
/* translators: %s: number of comments approved */
/* translators: %s: number of comments */
$messages[] = sprintf( _n( '%s comment approved', '%s comments approved', $approved ), $approved );
}
if ( $spammed > 0 ) {
$ids = isset( $_REQUEST['ids'] ) ? $_REQUEST['ids'] : 0;
/* translators: %s: number of comments marked as spam */
/* translators: %s: number of comments */
$messages[] = sprintf( _n( '%s comment marked as spam.', '%s comments marked as spam.', $spammed ), $spammed ) . ' <a href="' . esc_url( wp_nonce_url( "edit-comments.php?doaction=undo&action=unspam&ids=$ids", 'bulk-comments' ) ) . '">' . __( 'Undo' ) . '</a><br />';
}
if ( $unspammed > 0 ) {
/* translators: %s: number of comments restored from the spam */
/* translators: %s: number of comments */
$messages[] = sprintf( _n( '%s comment restored from the spam', '%s comments restored from the spam', $unspammed ), $unspammed );
}
if ( $trashed > 0 ) {
$ids = isset( $_REQUEST['ids'] ) ? $_REQUEST['ids'] : 0;
/* translators: %s: number of comments moved to the Trash */
/* translators: %s: number of comments */
$messages[] = sprintf( _n( '%s comment moved to the Trash.', '%s comments moved to the Trash.', $trashed ), $trashed ) . ' <a href="' . esc_url( wp_nonce_url( "edit-comments.php?doaction=undo&action=untrash&ids=$ids", 'bulk-comments' ) ) . '">' . __( 'Undo' ) . '</a><br />';
}
if ( $untrashed > 0 ) {
/* translators: %s: number of comments restored from the Trash */
/* translators: %s: number of comments */
$messages[] = sprintf( _n( '%s comment restored from the Trash', '%s comments restored from the Trash', $untrashed ), $untrashed );
}
if ( $deleted > 0 ) {
/* translators: %s: number of comments permanently deleted */
/* translators: %s: number of comments */
$messages[] = sprintf( _n( '%s comment permanently deleted', '%s comments permanently deleted', $deleted ), $deleted );
}

View File

@ -180,6 +180,7 @@ $messages['post'] = array(
6 => __( 'Post published.' ) . $view_post_link_html,
7 => __( 'Post saved.' ),
8 => __( 'Post submitted.' ) . $preview_post_link_html,
/* translators: %s: scheduled date for the post */
9 => sprintf( __( 'Post scheduled for: %s.' ), '<strong>' . $scheduled_date . '</strong>' ) . $scheduled_post_link_html,
10 => __( 'Post draft updated.' ) . $preview_post_link_html,
);
@ -194,6 +195,7 @@ $messages['page'] = array(
6 => __( 'Page published.' ) . $view_page_link_html,
7 => __( 'Page saved.' ),
8 => __( 'Page submitted.' ) . $preview_page_link_html,
/* translators: %s: scheduled date for the page */
9 => sprintf( __( 'Page scheduled for: %s.' ), '<strong>' . $scheduled_date . '</strong>' ) . $scheduled_page_link_html,
10 => __( 'Page draft updated.' ) . $preview_page_link_html,
);
@ -238,7 +240,11 @@ $form_extra .= "<input type='hidden' id='post_ID' name='post_ID' value='" . esc
if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt, false ) > mysql2date( 'U', $post->post_modified_gmt, false ) ) {
foreach ( _wp_post_revision_fields( $post ) as $autosave_field => $_autosave_field ) {
if ( normalize_whitespace( $autosave->$autosave_field ) != normalize_whitespace( $post->$autosave_field ) ) {
$notice = sprintf( __( 'There is an autosave of this post that is more recent than the version below. <a href="%s">View the autosave</a>' ), get_edit_post_link( $autosave->ID ) );
$notice = sprintf(
/* translators: %s: URL to view the autosave */
__( 'There is an autosave of this post that is more recent than the version below. <a href="%s">View the autosave</a>' ),
get_edit_post_link( $autosave->ID )
);
break;
}
}
@ -292,7 +298,11 @@ if ( 'post' == $post_type ) {
);
get_current_screen()->set_help_sidebar(
'<p>' . sprintf( __( 'You can also create posts with the <a href="%s">Press This bookmarklet</a>.' ), 'tools.php' ) . '</p>' .
'<p>' . sprintf(
/* translators: %s: URL to Press This bookmarklet */
__( 'You can also create posts with the <a href="%s">Press This bookmarklet</a>.' ),
'tools.php'
) . '</p>' .
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
'<p>' . __( '<a href="https://wordpress.org/support/article/wordpress-editor/">Documentation on Writing and Editing Posts</a>' ) . '</p>' .
'<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
@ -359,8 +369,11 @@ if ( 'post' == $post_type ) {
}
if ( current_theme_supports( 'post-thumbnails' ) && post_type_supports( 'post', 'thumbnail' ) ) {
/* translators: %s: Featured Image */
$publish_box .= '<li>' . sprintf( __( '<strong>%s</strong> &mdash; This allows you to associate an image with your post without inserting it. This is usually useful only if your theme makes use of the image as a post thumbnail on the home page, a custom header, etc.' ), esc_html( $post_type_object->labels->featured_image ) ) . '</li>';
$publish_box .= '<li>' . sprintf(
/* translators: %s: Featured Image */
__( '<strong>%s</strong> &mdash; This allows you to associate an image with your post without inserting it. This is usually useful only if your theme makes use of the image as a post thumbnail on the home page, a custom header, etc.' ),
esc_html( $post_type_object->labels->featured_image )
) . '</li>';
}
$publish_box .= '</ul>';
@ -577,7 +590,15 @@ if ( post_type_supports( $post_type, 'editor' ) ) {
);
?>
<table id="post-status-info"><tbody><tr>
<td id="wp-word-count" class="hide-if-no-js"><?php printf( __( 'Word count: %s' ), '<span class="word-count">0</span>' ); ?></td>
<td id="wp-word-count" class="hide-if-no-js">
<?php
printf(
/* translators: %s: Number of words */
__( 'Word count: %s' ),
'<span class="word-count">0</span>'
);
?>
</td>
<td class="autosave-info">
<span class="autosave-message">&nbsp;</span>
<?php

View File

@ -12,11 +12,13 @@ if ( ! defined( 'ABSPATH' ) ) {
}
if ( ! empty( $link_id ) ) {
/* translators: %s: URL to Links screen */
$heading = sprintf( __( '<a href="%s">Links</a> / Edit Link' ), 'link-manager.php' );
$submit_text = __( 'Update Link' );
$form_name = 'editlink';
$nonce_action = 'update-bookmark_' . $link_id;
} else {
/* translators: %s: URL to Links screen */
$heading = sprintf( __( '<a href="%s">Links</a> / Add New Link' ), 'link-manager.php' );
$submit_text = __( 'Add Link' );
$form_name = 'addlink';

View File

@ -242,7 +242,11 @@ if ( current_user_can( $tax->cap->edit_terms ) ) {
if ( 'category' == $taxonomy || 'link_category' == $taxonomy || 'post_tag' == $taxonomy ) {
$help = '';
if ( 'category' == $taxonomy ) {
$help = '<p>' . sprintf( __( 'You can use categories to define sections of your site and group related posts. The default category is &#8220;Uncategorized&#8221; until you change it in your <a href="%s">writing settings</a>.' ), 'options-writing.php' ) . '</p>';
$help = '<p>' . sprintf(
/* translators: %s: URL to Writing Settings screen */
__( 'You can use categories to define sections of your site and group related posts. The default category is &#8220;Uncategorized&#8221; until you change it in your <a href="%s">writing settings</a>.' ),
'options-writing.php'
) . '</p>';
} elseif ( 'link_category' == $taxonomy ) {
$help = '<p>' . __( 'You can create groups of links by using Link Categories. Link Category names must be unique and Link Categories are separate from the categories you use for posts.' ) . '</p>';
} else {
@ -596,13 +600,27 @@ if ( $can_edit_terms ) {
</p>
<?php if ( current_user_can( 'import' ) ) : ?>
<p>
<?php printf( __( 'Categories can be selectively converted to tags using the <a href="%s">category to tag converter</a>.' ), esc_url( $import_link ) ); ?>
<?php
printf(
/* translators: %s: URL to Categories to Tags Converter tool */
__( 'Categories can be selectively converted to tags using the <a href="%s">category to tag converter</a>.' ),
esc_url( $import_link )
);
?>
</p>
<?php endif; ?>
</div>
<?php elseif ( 'post_tag' == $taxonomy && current_user_can( 'import' ) ) : ?>
<div class="form-wrap edit-term-notes">
<p><?php printf( __( 'Tags can be selectively converted to categories using the <a href="%s">tag to category converter</a>.' ), esc_url( $import_link ) ); ?></p>
<p>
<?php
printf(
/* translators: %s: URL to Categories to Tags Converter tool */
__( 'Tags can be selectively converted to categories using the <a href="%s">tag to category converter</a>.' ),
esc_url( $import_link )
);
?>
</p>
</div>
<?php
endif;

View File

@ -314,26 +314,42 @@ $bulk_counts = array(
$bulk_messages = array();
$bulk_messages['post'] = array(
/* translators: %s: number of posts */
'updated' => _n( '%s post updated.', '%s posts updated.', $bulk_counts['updated'] ),
'locked' => ( 1 == $bulk_counts['locked'] ) ? __( '1 post not updated, somebody is editing it.' ) :
/* translators: %s: number of posts */
_n( '%s post not updated, somebody is editing it.', '%s posts not updated, somebody is editing them.', $bulk_counts['locked'] ),
/* translators: %s: number of posts */
'deleted' => _n( '%s post permanently deleted.', '%s posts permanently deleted.', $bulk_counts['deleted'] ),
/* translators: %s: number of posts */
'trashed' => _n( '%s post moved to the Trash.', '%s posts moved to the Trash.', $bulk_counts['trashed'] ),
/* translators: %s: number of posts */
'untrashed' => _n( '%s post restored from the Trash.', '%s posts restored from the Trash.', $bulk_counts['untrashed'] ),
);
$bulk_messages['page'] = array(
/* translators: %s: number of pages */
'updated' => _n( '%s page updated.', '%s pages updated.', $bulk_counts['updated'] ),
'locked' => ( 1 == $bulk_counts['locked'] ) ? __( '1 page not updated, somebody is editing it.' ) :
/* translators: %s: number of pages */
_n( '%s page not updated, somebody is editing it.', '%s pages not updated, somebody is editing them.', $bulk_counts['locked'] ),
/* translators: %s: number of pages */
'deleted' => _n( '%s page permanently deleted.', '%s pages permanently deleted.', $bulk_counts['deleted'] ),
/* translators: %s: number of pages */
'trashed' => _n( '%s page moved to the Trash.', '%s pages moved to the Trash.', $bulk_counts['trashed'] ),
/* translators: %s: number of pages */
'untrashed' => _n( '%s page restored from the Trash.', '%s pages restored from the Trash.', $bulk_counts['untrashed'] ),
);
$bulk_messages['wp_block'] = array(
/* translators: %s: number of blocks */
'updated' => _n( '%s block updated.', '%s blocks updated.', $bulk_counts['updated'] ),
'locked' => ( 1 == $bulk_counts['locked'] ) ? __( '1 block not updated, somebody is editing it.' ) : _n( '%s block not updated, somebody is editing it.', '%s blocks not updated, somebody is editing them.', $bulk_counts['locked'] ),
'locked' => ( 1 == $bulk_counts['locked'] ) ? __( '1 block not updated, somebody is editing it.' ) :
/* translators: %s: number of blocks */
_n( '%s block not updated, somebody is editing it.', '%s blocks not updated, somebody is editing them.', $bulk_counts['locked'] ),
/* translators: %s: number of blocks */
'deleted' => _n( '%s block permanently deleted.', '%s blocks permanently deleted.', $bulk_counts['deleted'] ),
/* translators: %s: number of blocks */
'trashed' => _n( '%s block moved to the Trash.', '%s blocks moved to the Trash.', $bulk_counts['trashed'] ),
/* translators: %s: number of blocks */
'untrashed' => _n( '%s block restored from the Trash.', '%s blocks restored from the Trash.', $bulk_counts['untrashed'] ),
);

View File

@ -114,7 +114,7 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
$plugins_url = current_user_can( 'activate_plugins' ) ? admin_url( 'plugins.php' ) : __( 'https://wordpress.org/plugins/' );
$themes_url = current_user_can( 'switch_themes' ) ? admin_url( 'themes.php' ) : __( 'https://wordpress.org/themes/' );
printf(
/* translators: %s: https://wordpress.org/about/license/ */
/* translators: 1: URL to Plugins screen, 2: URL to Themes screen, 3: https://wordpress.org/about/license/ */
__( 'Every plugin and theme in WordPress.org&#8217;s directory is 100%% GPL or a similarly free and compatible license, so you can feel safe finding <a href="%1$s">plugins</a> and <a href="%2$s">themes</a> there. If you get a plugin or theme from another source, make sure to <a href="%3$s">ask them if it&#8217;s GPL</a> first. If they don&#8217;t respect the WordPress license, we don&#8217;t recommend them.' ),
$plugins_url,
$themes_url,

View File

@ -223,7 +223,11 @@ if ( empty( $importers ) ) {
}
if ( current_user_can( 'install_plugins' ) ) {
echo '<p>' . sprintf( __( 'If the importer you need is not listed, <a href="%s">search the plugin directory</a> to see if an importer is available.' ), esc_url( network_admin_url( 'plugin-install.php?tab=search&type=tag&s=importer' ) ) ) . '</p>';
echo '<p>' . sprintf(
/* translators: %s: URL to Add Plugins screen */
__( 'If the importer you need is not listed, <a href="%s">search the plugin directory</a> to see if an importer is available.' ),
esc_url( network_admin_url( 'plugin-install.php?tab=search&type=tag&s=importer' ) )
) . '</p>';
}
?>

View File

@ -314,7 +314,7 @@ function wp_ajax_autocomplete_user() {
foreach ( $users as $user ) {
$return[] = array(
/* translators: 1: user_login, 2: user_email */
/* translators: 1: user login, 2: user email address */
'label' => sprintf( _x( '%1$s (%2$s)', 'user autocomplete result' ), $user->user_login, $user->user_email ),
'value' => $user->$field,
);
@ -454,12 +454,12 @@ function _wp_ajax_delete_comment_response( $comment_id, $delta = -1 ) {
'time' => $time,
'in_moderation' => $counts->moderated,
'i18n_comments_text' => sprintf(
/* translators: %s: number of comments approved */
/* translators: %s: number of comments */
_n( '%s Comment', '%s Comments', $counts->approved ),
number_format_i18n( $counts->approved )
),
'i18n_moderation_text' => sprintf(
/* translators: %s: number of comments in moderation */
/* translators: %s: number of comments */
_n( '%s Comment in moderation', '%s Comments in moderation', $counts->moderated ),
number_format_i18n( $counts->moderated )
),
@ -526,7 +526,7 @@ function _wp_ajax_delete_comment_response( $comment_id, $delta = -1 ) {
'time' => $time,
'in_moderation' => $counts->moderated,
'i18n_moderation_text' => sprintf(
/* translators: %s: number of comments in moderation */
/* translators: %s: number of comments */
_n( '%s Comment in moderation', '%s Comments in moderation', $counts->moderated ),
number_format_i18n( $counts->moderated )
),
@ -913,8 +913,11 @@ function wp_ajax_dim_comment() {
$x = new WP_Ajax_Response(
array(
'what' => 'comment',
/* translators: %d: comment ID */
'id' => new WP_Error( 'invalid_comment', sprintf( __( 'Comment %d does not exist' ), $id ) ),
'id' => new WP_Error(
'invalid_comment',
/* translators: %d: comment ID */
sprintf( __( 'Comment %d does not exist' ), $id )
),
)
);
$x->send();
@ -1301,12 +1304,12 @@ function wp_ajax_replyto_comment( $action ) {
$response['supplemental'] = array(
'in_moderation' => $counts->moderated,
'i18n_comments_text' => sprintf(
/* translators: %s: number of comments approved */
/* translators: %s: number of comments */
_n( '%s Comment', '%s Comments', $counts->approved ),
number_format_i18n( $counts->approved )
),
'i18n_moderation_text' => sprintf(
/* translators: %s: number of comments in moderation */
/* translators: %s: number of comments */
_n( '%s Comment in moderation', '%s Comments in moderation', $counts->moderated ),
number_format_i18n( $counts->moderated )
),
@ -1914,10 +1917,11 @@ function wp_ajax_inline_save() {
$last_user = get_userdata( $last );
$last_user_name = $last_user ? $last_user->display_name : __( 'Someone' );
/* translators: %s: user who is currently editing the post */
/* translators: %s: user's display name */
$msg_template = __( 'Saving is disabled: %s is currently editing this post.' );
if ( $_POST['post_type'] == 'page' ) {
/* translators: %s: user who is currently editing the page */
/* translators: %s: user's display name */
$msg_template = __( 'Saving is disabled: %s is currently editing this page.' );
}
@ -2626,7 +2630,7 @@ function wp_ajax_wp_fullscreen_save_post() {
$last_id = get_post_meta( $post_id, '_edit_last', true );
if ( $last_id ) {
$last_user = get_userdata( $last_id );
/* translators: 1: display_name of last user, 2: date of last edit, 3: time of last edit. */
/* translators: 1: user's display name, 2: date of last edit, 3: time of last edit. */
$last_edited = sprintf( __( 'Last edited by %1$s on %2$s at %3$s' ), esc_html( $last_user->display_name ), $last_date, $last_time );
} else {
/* translators: 1: date of last edit, 2: time of last edit. */
@ -3480,7 +3484,7 @@ function wp_ajax_parse_embed() {
wp_send_json_error(
array(
'type' => 'not-embeddable',
/* translators: %s: URL which cannot be embedded, between code tags */
/* translators: %s: URL that could not be embedded */
'message' => sprintf( __( '%s failed to embed.' ), '<code>' . esc_html( $url ) . '</code>' ),
)
);

View File

@ -319,7 +319,7 @@ function wp_link_manager_disabled_message() {
if ( $really_can_manage_links && current_user_can( 'install_plugins' ) ) {
$link = network_admin_url( 'plugin-install.php?tab=search&amp;s=Link+Manager' );
/* translators: %s: URL of link manager plugin */
/* translators: %s: URL to install the Link Manager plugin */
wp_die( sprintf( __( 'If you are looking to use the link manager, please install the <a href="%s">Link Manager</a> plugin.' ), $link ) );
}

View File

@ -20,7 +20,7 @@ class Bulk_Plugin_Upgrader_Skin extends Bulk_Upgrader_Skin {
public function add_strings() {
parent::add_strings();
/* translators: 1: name of plugin being updated, 2: number of updating plugin, 3: total number of plugins being updated */
/* translators: 1: plugin name, 2: number of the plugin, 3: total number of plugins being updated */
$this->upgrader->strings['skin_before_update_header'] = __( 'Updating Plugin %1$s (%2$d/%3$d)' );
}
@ -43,10 +43,20 @@ class Bulk_Plugin_Upgrader_Skin extends Bulk_Upgrader_Skin {
*/
public function bulk_footer() {
parent::bulk_footer();
$update_actions = array(
'plugins_page' => '<a href="' . self_admin_url( 'plugins.php' ) . '" target="_parent">' . __( 'Return to Plugins page' ) . '</a>',
'updates_page' => '<a href="' . self_admin_url( 'update-core.php' ) . '" target="_parent">' . __( 'Return to WordPress Updates page' ) . '</a>',
'plugins_page' => sprintf(
'<a href="%s" target="_parent">%s</a>',
self_admin_url( 'plugins.php' ),
__( 'Return to Plugins page' )
),
'updates_page' => sprintf(
'<a href="%s" target="_parent">%s</a>',
self_admin_url( 'update-core.php' ),
__( 'Return to WordPress Updates page' )
),
);
if ( ! current_user_can( 'activate_plugins' ) ) {
unset( $update_actions['plugins_page'] );
}

View File

@ -20,7 +20,7 @@ class Bulk_Theme_Upgrader_Skin extends Bulk_Upgrader_Skin {
public function add_strings() {
parent::add_strings();
/* translators: 1: name of theme being updated, 2: number of updating themes, 3: total number of themes being updated */
/* translators: 1: theme name, 2: number of the theme, 3: total number of themes being updated */
$this->upgrader->strings['skin_before_update_header'] = __( 'Updating Theme %1$s (%2$d/%3$d)' );
}
@ -43,10 +43,20 @@ class Bulk_Theme_Upgrader_Skin extends Bulk_Upgrader_Skin {
*/
public function bulk_footer() {
parent::bulk_footer();
$update_actions = array(
'themes_page' => '<a href="' . self_admin_url( 'themes.php' ) . '" target="_parent">' . __( 'Return to Themes page' ) . '</a>',
'updates_page' => '<a href="' . self_admin_url( 'update-core.php' ) . '" target="_parent">' . __( 'Return to WordPress Updates page' ) . '</a>',
'themes_page' => sprintf(
'<a href="%s" target="_parent">%s</a>',
self_admin_url( 'themes.php' ),
__( 'Return to Themes page' )
),
'updates_page' => sprintf(
'<a href="%s" target="_parent">%s</a>',
self_admin_url( 'update-core.php' ),
__( 'Return to WordPress Updates page' )
),
);
if ( ! current_user_can( 'switch_themes' ) && ! current_user_can( 'edit_theme_options' ) ) {
unset( $update_actions['themes_page'] );
}

View File

@ -229,10 +229,11 @@ class Custom_Background {
<div class="notice notice-info hide-if-no-customize">
<p>
<?php
printf(
__( 'You can now manage and live-preview Custom Backgrounds in the <a href="%1$s">Customizer</a>.' ),
admin_url( 'customize.php?autofocus[control]=background_image' )
);
printf(
/* translators: %s: URL to background image configuration in Customizer */
__( 'You can now manage and live-preview Custom Backgrounds in the <a href="%s">Customizer</a>.' ),
admin_url( 'customize.php?autofocus[control]=background_image' )
);
?>
</p>
</div>
@ -240,7 +241,12 @@ class Custom_Background {
<?php if ( ! empty( $this->updated ) ) { ?>
<div id="message" class="updated">
<p><?php printf( __( 'Background updated. <a href="%s">Visit your site</a> to see how it looks.' ), home_url( '/' ) ); ?></p>
<p>
<?php
/* translators: %s: Home URL */
printf( __( 'Background updated. <a href="%s">Visit your site</a> to see how it looks.' ), home_url( '/' ) );
?>
</p>
</div>
<?php } ?>

View File

@ -118,7 +118,12 @@ class Custom_Image_Header {
'id' => 'set-header-text',
'title' => __( 'Header Text' ),
'content' =>
'<p>' . sprintf( __( 'For most themes, the header text is your Site Title and Tagline, as defined in the <a href="%1$s">General Settings</a> section.' ), admin_url( 'options-general.php' ) ) . '<p>' .
'<p>' . sprintf(
/* translators: %s: URL to General Settings screen */
__( 'For most themes, the header text is your Site Title and Tagline, as defined in the <a href="%s">General Settings</a> section.' ),
admin_url( 'options-general.php' )
) .
'</p>' .
'<p>' . __( 'In the Header Text section of this page, you can choose whether to display this text or hide it. You can also choose a color for the text by clicking the Select Color button and either typing in a legitimate HTML hex value, e.g. &#8220;#ff0000&#8221; for red, or by choosing a color using the color picker.' ) . '</p>' .
'<p>' . __( 'Don&#8217;t forget to click &#8220;Save Changes&#8221; when you&#8217;re done!' ) . '</p>',
)
@ -473,10 +478,11 @@ class Custom_Image_Header {
<div class="notice notice-info hide-if-no-customize">
<p>
<?php
printf(
__( 'You can now manage and live-preview Custom Header in the <a href="%1$s">Customizer</a>.' ),
admin_url( 'customize.php?autofocus[control]=header_image' )
);
printf(
/* translators: %s: URL to header image configuration in Customizer */
__( 'You can now manage and live-preview Custom Header in the <a href="%s">Customizer</a>.' ),
admin_url( 'customize.php?autofocus[control]=header_image' )
);
?>
</p>
</div>
@ -484,7 +490,12 @@ class Custom_Image_Header {
<?php if ( ! empty( $this->updated ) ) { ?>
<div id="message" class="updated">
<p><?php printf( __( 'Header updated. <a href="%s">Visit your site</a> to see how it looks.' ), home_url( '/' ) ); ?></p>
<p>
<?php
/* translators: %s: Home URL */
printf( __( 'Header updated. <a href="%s">Visit your site</a> to see how it looks.' ), home_url( '/' ) );
?>
</p>
</div>
<?php } ?>
@ -540,6 +551,7 @@ class Custom_Image_Header {
<p><?php _e( 'You can select an image to be shown at the top of your site by uploading from your computer or choosing from your media library. After selecting an image you will be able to crop it.' ); ?><br />
<?php
if ( ! current_theme_supports( 'custom-header', 'flex-height' ) && ! current_theme_supports( 'custom-header', 'flex-width' ) ) {
/* translators: 1: image width in pixels, 2: image height in pixels */
printf( __( 'Images of exactly <strong>%1$d &times; %2$d pixels</strong> will be used as-is.' ) . '<br />', get_theme_support( 'custom-header', 'width' ), get_theme_support( 'custom-header', 'height' ) );
} elseif ( current_theme_supports( 'custom-header', 'flex-height' ) ) {
if ( ! current_theme_supports( 'custom-header', 'flex-width' ) ) {
@ -722,6 +734,7 @@ class Custom_Image_Header {
echo '<input type="text" name="text-color" id="text-color" value="' . esc_attr( $header_textcolor ) . '"' . $default_color_attr . ' />';
if ( $default_color ) {
/* translators: %s: Default text color */
echo ' <span class="description hide-if-js">' . sprintf( _x( 'Default: %s', 'color' ), esc_html( $default_color ) ) . '</span>';
}
?>

View File

@ -47,7 +47,7 @@ class Language_Pack_Upgrader_Skin extends WP_Upgrader_Skin {
echo '<div class="update-messages lp-show-latest">';
/* translators: 1: name of project, 2: language */
/* translators: 1: project name (plugin, theme, or WordPress), 2: language */
printf( '<h2>' . __( 'Updating translations for %1$s (%2$s)&#8230;' ) . '</h2>', $name, $this->language_update->language );
}
@ -70,8 +70,14 @@ class Language_Pack_Upgrader_Skin extends WP_Upgrader_Skin {
*/
public function bulk_footer() {
$this->decrement_update_count( 'translation' );
$update_actions = array();
$update_actions['updates_page'] = '<a href="' . self_admin_url( 'update-core.php' ) . '" target="_parent">' . __( 'Return to WordPress Updates page' ) . '</a>';
$update_actions = array(
'updates_page' => sprintf(
'<a href="%s" target="_parent">%s</a>',
self_admin_url( 'update-core.php' ),
__( 'Return to WordPress Updates page' )
),
);
/**
* Filters the list of action links available following a translations update.

View File

@ -42,8 +42,12 @@ class Plugin_Installer_Skin extends WP_Upgrader_Skin {
*/
public function before() {
if ( ! empty( $this->api ) ) {
/* translators: 1: name of API, 2: version of API */
$this->upgrader->strings['process_success'] = sprintf( __( 'Successfully installed the plugin <strong>%1$s %2$s</strong>.' ), $this->api->name, $this->api->version );
$this->upgrader->strings['process_success'] = sprintf(
/* translators: 1: plugin name, 2: plugin version */
__( 'Successfully installed the plugin <strong>%1$s %2$s</strong>.' ),
$this->api->name,
$this->api->version
);
}
}
@ -57,26 +61,58 @@ class Plugin_Installer_Skin extends WP_Upgrader_Skin {
$from = isset( $_GET['from'] ) ? wp_unslash( $_GET['from'] ) : 'plugins';
if ( 'import' == $from ) {
$install_actions['activate_plugin'] = '<a class="button button-primary" href="' . wp_nonce_url( 'plugins.php?action=activate&amp;from=import&amp;plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file ) . '" target="_parent">' . __( 'Activate Plugin &amp; Run Importer' ) . '</a>';
$install_actions['activate_plugin'] = sprintf(
'<a class="button button-primary" href="%s" target="_parent">%s</a>',
wp_nonce_url( 'plugins.php?action=activate&amp;from=import&amp;plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file ),
__( 'Activate Plugin &amp; Run Importer' )
);
} elseif ( 'press-this' == $from ) {
$install_actions['activate_plugin'] = '<a class="button button-primary" href="' . wp_nonce_url( 'plugins.php?action=activate&amp;from=press-this&amp;plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file ) . '" target="_parent">' . __( 'Activate Plugin &amp; Return to Press This' ) . '</a>';
$install_actions['activate_plugin'] = sprintf(
'<a class="button button-primary" href="%s" target="_parent">%s</a>',
wp_nonce_url( 'plugins.php?action=activate&amp;from=press-this&amp;plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file ),
__( 'Activate Plugin &amp; Return to Press This' )
);
} else {
$install_actions['activate_plugin'] = '<a class="button button-primary" href="' . wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file ) . '" target="_parent">' . __( 'Activate Plugin' ) . '</a>';
$install_actions['activate_plugin'] = sprintf(
'<a class="button button-primary" href="%s" target="_parent">%s</a>',
wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file ),
__( 'Activate Plugin' )
);
}
if ( is_multisite() && current_user_can( 'manage_network_plugins' ) ) {
$install_actions['network_activate'] = '<a class="button button-primary" href="' . wp_nonce_url( 'plugins.php?action=activate&amp;networkwide=1&amp;plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file ) . '" target="_parent">' . __( 'Network Activate' ) . '</a>';
$install_actions['network_activate'] = sprintf(
'<a class="button button-primary" href="%s" target="_parent">%s</a>',
wp_nonce_url( 'plugins.php?action=activate&amp;networkwide=1&amp;plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file ),
__( 'Network Activate' )
);
unset( $install_actions['activate_plugin'] );
}
if ( 'import' == $from ) {
$install_actions['importers_page'] = '<a href="' . admin_url( 'import.php' ) . '" target="_parent">' . __( 'Return to Importers' ) . '</a>';
$install_actions['importers_page'] = sprintf(
'<a href="%s" target="_parent">%s</a>',
admin_url( 'import.php' ),
__( 'Return to Importers' )
);
} elseif ( $this->type == 'web' ) {
$install_actions['plugins_page'] = '<a href="' . self_admin_url( 'plugin-install.php' ) . '" target="_parent">' . __( 'Return to Plugin Installer' ) . '</a>';
$install_actions['plugins_page'] = sprintf(
'<a href="%s" target="_parent">%s</a>',
self_admin_url( 'plugin-install.php' ),
__( 'Return to Plugin Installer' )
);
} elseif ( 'upload' == $this->type && 'plugins' == $from ) {
$install_actions['plugins_page'] = '<a href="' . self_admin_url( 'plugin-install.php' ) . '">' . __( 'Return to Plugin Installer' ) . '</a>';
$install_actions['plugins_page'] = sprintf(
'<a href="%s">%s</a>',
self_admin_url( 'plugin-install.php' ),
__( 'Return to Plugin Installer' )
);
} else {
$install_actions['plugins_page'] = '<a href="' . self_admin_url( 'plugins.php' ) . '" target="_parent">' . __( 'Return to Plugins page' ) . '</a>';
$install_actions['plugins_page'] = sprintf(
'<a href="%s" target="_parent">%s</a>',
self_admin_url( 'plugins.php' ),
__( 'Return to Plugins page' )
);
}
if ( ! $this->result || is_wp_error( $this->result ) ) {

View File

@ -46,15 +46,28 @@ class Plugin_Upgrader_Skin extends WP_Upgrader_Skin {
$this->plugin = $this->upgrader->plugin_info();
if ( ! empty( $this->plugin ) && ! is_wp_error( $this->result ) && $this->plugin_active ) {
// Currently used only when JS is off for a single plugin update?
echo '<iframe title="' . esc_attr__( 'Update progress' ) . '" style="border:0;overflow:hidden" width="100%" height="170" src="' . wp_nonce_url( 'update.php?action=activate-plugin&networkwide=' . $this->plugin_network_active . '&plugin=' . urlencode( $this->plugin ), 'activate-plugin_' . $this->plugin ) . '"></iframe>';
printf(
'<iframe title="%s" style="border:0;overflow:hidden" width="100%" height="170" src="%s"></iframe>',
esc_attr__( 'Update progress' ),
wp_nonce_url( 'update.php?action=activate-plugin&networkwide=' . $this->plugin_network_active . '&plugin=' . urlencode( $this->plugin ), 'activate-plugin_' . $this->plugin )
);
}
$this->decrement_update_count( 'plugin' );
$update_actions = array(
'activate_plugin' => '<a href="' . wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . urlencode( $this->plugin ), 'activate-plugin_' . $this->plugin ) . '" target="_parent">' . __( 'Activate Plugin' ) . '</a>',
'plugins_page' => '<a href="' . self_admin_url( 'plugins.php' ) . '" target="_parent">' . __( 'Return to Plugins page' ) . '</a>',
'activate_plugin' => sprintf(
'<a href="%s" target="_parent">%s</a>',
wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . urlencode( $this->plugin ), 'activate-plugin_' . $this->plugin ),
__( 'Activate Plugin' )
),
'plugins_page' => sprintf(
'<a href="%s" target="_parent">%s</a>',
self_admin_url( 'plugins.php' ),
__( 'Return to Plugins page' )
),
);
if ( $this->plugin_active || ! $this->result || is_wp_error( $this->result ) || ! current_user_can( 'activate_plugin', $this->plugin ) ) {
unset( $update_actions['activate_plugin'] );
}

View File

@ -42,7 +42,11 @@ class Theme_Installer_Skin extends WP_Upgrader_Skin {
*/
public function before() {
if ( ! empty( $this->api ) ) {
$this->upgrader->strings['process_success'] = sprintf( $this->upgrader->strings['process_success_specific'], $this->api->name, $this->api->version );
$this->upgrader->strings['process_success'] = sprintf(
$this->upgrader->strings['process_success_specific'],
$this->api->name,
$this->api->version
);
}
}
@ -75,31 +79,53 @@ class Theme_Installer_Skin extends WP_Upgrader_Skin {
$install_actions = array();
if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {
$customize_url = add_query_arg(
$customize_url = add_query_arg(
array(
'theme' => urlencode( $stylesheet ),
'return' => urlencode( admin_url( 'web' === $this->type ? 'theme-install.php' : 'themes.php' ) ),
),
admin_url( 'customize.php' )
);
$install_actions['preview'] = '<a href="' . esc_url( $customize_url ) . '" class="hide-if-no-customize load-customize">';
$install_actions['preview'] .= '<span aria-hidden="true">' . __( 'Live Preview' ) . '</span>';
/* translators: %s: theme name */
$install_actions['preview'] .= '<span class="screen-reader-text">' . sprintf( __( 'Live Preview &#8220;%s&#8221;' ), $name ) . '</span></a>';
$install_actions['preview'] = sprintf(
'<a href="%s" class="hide-if-no-customize load-customize">' .
'<span aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></a>',
esc_url( $customize_url ),
__( 'Live Preview' ),
/* translators: %s: theme name */
sprintf( __( 'Live Preview &#8220;%s&#8221;' ), $name )
);
}
$install_actions['activate'] = '<a href="' . esc_url( $activate_link ) . '" class="activatelink">';
$install_actions['activate'] .= '<span aria-hidden="true">' . __( 'Activate' ) . '</span>';
/* translators: %s: theme name */
$install_actions['activate'] .= '<span class="screen-reader-text">' . sprintf( __( 'Activate &#8220;%s&#8221;' ), $name ) . '</span></a>';
$install_actions['activate'] = sprintf(
'<a href="%s" class="activatelink">' .
'<span aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></a>',
esc_url( $activate_link ),
__( 'Activate' ),
/* translators: %s: theme name */
sprintf( __( 'Activate &#8220;%s&#8221;' ), $name )
);
if ( is_network_admin() && current_user_can( 'manage_network_themes' ) ) {
$install_actions['network_enable'] = '<a href="' . esc_url( wp_nonce_url( 'themes.php?action=enable&amp;theme=' . urlencode( $stylesheet ), 'enable-theme_' . $stylesheet ) ) . '" target="_parent">' . __( 'Network Enable' ) . '</a>';
$install_actions['network_enable'] = sprintf(
'<a href="%s" target="_parent">%s</a>',
esc_url( wp_nonce_url( 'themes.php?action=enable&amp;theme=' . urlencode( $stylesheet ), 'enable-theme_' . $stylesheet ) ),
__( 'Network Enable' )
);
}
if ( $this->type == 'web' ) {
$install_actions['themes_page'] = '<a href="' . self_admin_url( 'theme-install.php' ) . '" target="_parent">' . __( 'Return to Theme Installer' ) . '</a>';
$install_actions['themes_page'] = sprintf(
'<a href="%s" target="_parent">%s</a>',
self_admin_url( 'theme-install.php' ),
__( 'Return to Theme Installer' )
);
} elseif ( current_user_can( 'switch_themes' ) || current_user_can( 'edit_theme_options' ) ) {
$install_actions['themes_page'] = '<a href="' . self_admin_url( 'themes.php' ) . '" target="_parent">' . __( 'Return to Themes page' ) . '</a>';
$install_actions['themes_page'] = sprintf(
'<a href="%s" target="_parent">%s</a>',
self_admin_url( 'themes.php' ),
__( 'Return to Themes page' )
);
}
if ( ! $this->result || is_wp_error( $this->result ) || is_network_admin() || ! current_user_can( 'switch_themes' ) ) {

View File

@ -64,24 +64,38 @@ class Theme_Upgrader_Skin extends WP_Upgrader_Skin {
),
admin_url( 'customize.php' )
);
if ( get_stylesheet() == $stylesheet ) {
if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {
$update_actions['preview'] = '<a href="' . esc_url( $customize_url ) . '" class="hide-if-no-customize load-customize">';
$update_actions['preview'] .= '<span aria-hidden="true">' . __( 'Customize' ) . '</span>';
/* translators: %s: theme name */
$update_actions['preview'] .= '<span class="screen-reader-text">' . sprintf( __( 'Customize &#8220;%s&#8221;' ), $name ) . '</span></a>';
$update_actions['preview'] = sprintf(
'<a href="%s" class="hide-if-no-customize load-customize">' .
'<span aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></a>',
esc_url( $customize_url ),
__( 'Customize' ),
/* translators: %s: theme name */
sprintf( __( 'Customize &#8220;%s&#8221;' ), $name )
);
}
} elseif ( current_user_can( 'switch_themes' ) ) {
if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {
$update_actions['preview'] = '<a href="' . esc_url( $customize_url ) . '" class="hide-if-no-customize load-customize">';
$update_actions['preview'] .= '<span aria-hidden="true">' . __( 'Live Preview' ) . '</span>';
/* translators: %s: theme name */
$update_actions['preview'] .= '<span class="screen-reader-text">' . sprintf( __( 'Live Preview &#8220;%s&#8221;' ), $name ) . '</span></a>';
$update_actions['preview'] = sprintf(
'<a href="%s" class="hide-if-no-customize load-customize">' .
'<span aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></a>',
esc_url( $customize_url ),
__( 'Live Preview' ),
/* translators: %s: theme name */
sprintf( __( 'Live Preview &#8220;%s&#8221;' ), $name )
);
}
$update_actions['activate'] = '<a href="' . esc_url( $activate_link ) . '" class="activatelink">';
$update_actions['activate'] .= '<span aria-hidden="true">' . __( 'Activate' ) . '</span>';
/* translators: %s: theme name */
$update_actions['activate'] .= '<span class="screen-reader-text">' . sprintf( __( 'Activate &#8220;%s&#8221;' ), $name ) . '</span></a>';
$update_actions['activate'] = sprintf(
'<a href="%s" class="activatelink">' .
'<span aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></a>',
esc_url( $activate_link ),
__( 'Activate' ),
/* translators: %s: theme name */
sprintf( __( 'Activate &#8220;%s&#8221;' ), $name )
);
}
if ( ! $this->result || is_wp_error( $this->result ) || is_network_admin() ) {
@ -89,7 +103,11 @@ class Theme_Upgrader_Skin extends WP_Upgrader_Skin {
}
}
$update_actions['themes_page'] = '<a href="' . self_admin_url( 'themes.php' ) . '" target="_parent">' . __( 'Return to Themes page' ) . '</a>';
$update_actions['themes_page'] = sprintf(
'<a href="%s" target="_parent">%s</a>',
self_admin_url( 'themes.php' ),
__( 'Return to Themes page' )
);
/**
* Filters the list of action links available following a single theme update.

View File

@ -99,11 +99,11 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {
if ( ! empty( $item->_invalid ) ) {
$classes[] = 'menu-item-invalid';
/* translators: %s: title of menu item which is invalid */
/* translators: %s: title of an invalid menu item */
$title = sprintf( __( '%s (Invalid)' ), $item->title );
} elseif ( isset( $item->post_status ) && 'draft' == $item->post_status ) {
$classes[] = 'pending';
/* translators: %s: title of menu item in draft status */
/* translators: %s: title of a menu item in draft status */
$title = sprintf( __( '%s (Pending)' ), $item->title );
}
@ -240,7 +240,7 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {
<?php if ( 'custom' !== $item->type && false !== $original_title ) : ?>
<p class="link-to-original">
<?php
/* translators: %s: original title */
/* translators: %s: link to menu item's original object */
printf( __( 'Original: %s' ), '<a href="' . esc_attr( $item->url ) . '">' . esc_html( $original_title ) . '</a>' );
?>
</p>

View File

@ -336,9 +336,9 @@ class WP_Automatic_Updater {
break;
case 'translation':
$language_item_name = $upgrader->get_name_for_update( $item );
/* translators: %s: Name of language item */
/* translators: %s: Project name (plugin, theme, or WordPress) */
$item_name = sprintf( __( 'Translations for %s' ), $language_item_name );
/* translators: 1: Name of language item, 2: Language */
/* translators: 1: Project name (plugin, theme, or WordPress), 2: Language */
$skin->feedback( sprintf( __( 'Updating translations for %1$s (%2$s)&#8230;' ), $language_item_name, $item->language ) );
break;
}
@ -348,7 +348,7 @@ class WP_Automatic_Updater {
$allow_relaxed_file_ownership = true;
}
// Boom, This sites about to get a whole new splash of paint!
// Boom, this site's about to get a whole new splash of paint!
$upgrade_result = $upgrader->upgrade(
$upgrader_item,
array(
@ -649,13 +649,13 @@ class WP_Automatic_Updater {
switch ( $type ) {
case 'success': // We updated.
/* translators: Site updated notification email subject. 1: Site title, 2: WordPress version number. */
/* translators: Site updated notification email subject. 1: Site title, 2: WordPress version. */
$subject = __( '[%1$s] Your site has updated to WordPress %2$s' );
break;
case 'fail': // We tried to update but couldn't.
case 'manual': // We can't update (and made no attempt).
/* translators: Update available notification email subject. 1: Site title, 2: WordPress version number. */
/* translators: Update available notification email subject. 1: Site title, 2: WordPress version. */
$subject = __( '[%1$s] WordPress %2$s is available. Please update!' );
break;
@ -676,8 +676,12 @@ class WP_Automatic_Updater {
switch ( $type ) {
case 'success':
/* translators: 1: Home URL, 2: WordPress version */
$body .= sprintf( __( 'Howdy! Your site at %1$s has been updated automatically to WordPress %2$s.' ), home_url(), $core_update->current );
$body .= sprintf(
/* translators: 1: Home URL, 2: WordPress version */
__( 'Howdy! Your site at %1$s has been updated automatically to WordPress %2$s.' ),
home_url(),
$core_update->current
);
$body .= "\n\n";
if ( ! $newer_version_available ) {
$body .= __( 'No further action is needed on your part.' ) . ' ';
@ -685,12 +689,12 @@ class WP_Automatic_Updater {
// Can only reference the About screen if their update was successful.
list( $about_version ) = explode( '-', $core_update->current, 2 );
/* translators: %s: WordPress core version */
/* translators: %s: WordPress version */
$body .= sprintf( __( 'For more on version %s, see the About WordPress screen:' ), $about_version );
$body .= "\n" . admin_url( 'about.php' );
if ( $newer_version_available ) {
/* translators: %s: WordPress core latest version */
/* translators: %s: WordPress latest version */
$body .= "\n\n" . sprintf( __( 'WordPress %s is also now available.' ), $next_user_core_update->current ) . ' ';
$body .= __( 'Updating is easy and only takes a few moments:' );
$body .= "\n" . network_admin_url( 'update-core.php' );
@ -700,8 +704,12 @@ class WP_Automatic_Updater {
case 'fail':
case 'manual':
/* translators: 1: Home URL, 2: WordPress core latest version */
$body .= sprintf( __( 'Please update your site at %1$s to WordPress %2$s.' ), home_url(), $next_user_core_update->current );
$body .= sprintf(
/* translators: 1: Home URL, 2: WordPress version */
__( 'Please update your site at %1$s to WordPress %2$s.' ),
home_url(),
$next_user_core_update->current
);
$body .= "\n\n";
@ -717,11 +725,19 @@ class WP_Automatic_Updater {
case 'critical':
if ( $newer_version_available ) {
/* translators: 1: Home URL, 2: WordPress core latest version */
$body .= sprintf( __( 'Your site at %1$s experienced a critical failure while trying to update WordPress to version %2$s.' ), home_url(), $core_update->current );
$body .= sprintf(
/* translators: 1: Home URL, 2: WordPress version */
__( 'Your site at %1$s experienced a critical failure while trying to update WordPress to version %2$s.' ),
home_url(),
$core_update->current
);
} else {
/* translators: 1: Home URL, 2: Core update version */
$body .= sprintf( __( 'Your site at %1$s experienced a critical failure while trying to update to the latest version of WordPress, %2$s.' ), home_url(), $core_update->current );
$body .= sprintf(
/* translators: 1: Home URL, 2: WordPress latest version */
__( 'Your site at %1$s experienced a critical failure while trying to update to the latest version of WordPress, %2$s.' ),
home_url(),
$core_update->current
);
}
$body .= "\n\n" . __( "This means your site may be offline or broken. Don't panic; this can be fixed." );
@ -734,8 +750,11 @@ class WP_Automatic_Updater {
$critical_support = 'critical' === $type && ! empty( $core_update->support_email );
if ( $critical_support ) {
// Support offer if available.
/* translators: %s: Support e-mail */
$body .= "\n\n" . sprintf( __( 'The WordPress team is willing to help you. Forward this email to %s and the team will work with you to make sure your site is working.' ), $core_update->support_email );
$body .= "\n\n" . sprintf(
/* translators: %s: Support email address */
__( 'The WordPress team is willing to help you. Forward this email to %s and the team will work with you to make sure your site is working.' ),
$core_update->support_email
);
} else {
// Add a note about the support forums.
$body .= "\n\n" . __( 'If you experience any issues or need support, the volunteers in the WordPress.org support forums may be able to help.' );
@ -845,10 +864,10 @@ class WP_Automatic_Updater {
if ( isset( $this->update_results['core'] ) ) {
$result = $this->update_results['core'][0];
if ( $result->result && ! is_wp_error( $result->result ) ) {
/* translators: %s: WordPress core version */
/* translators: %s: WordPress version */
$body[] = sprintf( __( 'SUCCESS: WordPress was successfully updated to %s' ), $result->name );
} else {
/* translators: %s: WordPress core version */
/* translators: %s: WordPress version */
$body[] = sprintf( __( 'FAILED: WordPress failed to update to %s' ), $result->name );
$failures++;
}
@ -870,7 +889,7 @@ class WP_Automatic_Updater {
$body[] = $messages[ $type ];
foreach ( wp_list_pluck( $success_items, 'name' ) as $name ) {
/* translators: %s: name of plugin / theme / translations */
/* translators: %s: name of plugin / theme / translation */
$body[] = ' * ' . sprintf( __( 'SUCCESS: %s' ), $name );
}
}
@ -885,7 +904,7 @@ class WP_Automatic_Updater {
$body[] = $messages[ $type ];
foreach ( $this->update_results[ $type ] as $item ) {
if ( ! $item->result || is_wp_error( $item->result ) ) {
/* translators: %s: name of plugin / theme / translations */
/* translators: %s: name of plugin / theme / translation */
$body[] = ' * ' . sprintf( __( 'FAILED: %s' ), $item->name );
$failures++;
}

View File

@ -785,8 +785,8 @@ class WP_Comments_List_Table extends WP_List_Table {
* @param WP_Comment $comment The comment object.
*/
public function column_date( $comment ) {
/* translators: 1: comment date, 2: comment time */
$submitted = sprintf(
/* translators: 1: comment date, 2: comment time */
__( '%1$s at %2$s' ),
/* translators: comment date format. See https://secure.php.net/date */
get_comment_date( __( 'Y/m/d' ), $comment ),

View File

@ -92,8 +92,8 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
if ( ! $this->link ) {
$this->errors->add(
'connect',
/* translators: %s: hostname:port */
sprintf(
/* translators: %s: hostname:port */
__( 'Failed to connect to FTP Server %s' ),
$this->options['hostname'] . ':' . $this->options['port']
)
@ -104,8 +104,8 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
if ( ! @ftp_login( $this->link, $this->options['username'], $this->options['password'] ) ) {
$this->errors->add(
'auth',
/* translators: %s: username */
sprintf(
/* translators: %s: username */
__( 'Username/Password incorrect for %s' ),
$this->options['username']
)

View File

@ -81,8 +81,8 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
if ( ! $this->ftp->SetServer( $this->options['hostname'], $this->options['port'] ) ) {
$this->errors->add(
'connect',
/* translators: %s: hostname:port */
sprintf(
/* translators: %s: hostname:port */
__( 'Failed to connect to FTP Server %s' ),
$this->options['hostname'] . ':' . $this->options['port']
)
@ -93,8 +93,8 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
if ( ! $this->ftp->connect() ) {
$this->errors->add(
'connect',
/* translators: %s: hostname:port */
sprintf(
/* translators: %s: hostname:port */
__( 'Failed to connect to FTP Server %s' ),
$this->options['hostname'] . ':' . $this->options['port']
)
@ -105,8 +105,8 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
if ( ! $this->ftp->login( $this->options['username'], $this->options['password'] ) ) {
$this->errors->add(
'auth',
/* translators: %s: username */
sprintf(
/* translators: %s: username */
__( 'Username/Password incorrect for %s' ),
$this->options['username']
)

View File

@ -137,8 +137,8 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
if ( ! $this->link ) {
$this->errors->add(
'connect',
/* translators: %s: hostname:port */
sprintf(
/* translators: %s: hostname:port */
__( 'Failed to connect to SSH2 Server %s' ),
$this->options['hostname'] . ':' . $this->options['port']
)
@ -150,8 +150,8 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
if ( ! @ssh2_auth_password( $this->link, $this->options['username'], $this->options['password'] ) ) {
$this->errors->add(
'auth',
/* translators: %s: username */
sprintf(
/* translators: %s: username */
__( 'Username/Password incorrect for %s' ),
$this->options['username']
)
@ -162,8 +162,8 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
if ( ! @ssh2_auth_pubkey_file( $this->link, $this->options['username'], $this->options['public_key'], $this->options['private_key'], $this->options['password'] ) ) {
$this->errors->add(
'auth',
/* translators: %s: username */
sprintf(
/* translators: %s: username */
__( 'Public and Private keys incorrect for %s' ),
$this->options['username']
)
@ -176,8 +176,8 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
if ( ! $this->sftp_link ) {
$this->errors->add(
'connect',
/* translators: %s: hostname:port */
sprintf(
/* translators: %s: hostname:port */
__( 'Failed to initialize a SFTP subsystem session with the SSH2 Server %s' ),
$this->options['hostname'] . ':' . $this->options['port']
)
@ -225,8 +225,8 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
if ( ! $stream ) {
$this->errors->add(
'command',
/* translators: %s: command */
sprintf(
/* translators: %s: command */
__( 'Unable to perform command: %s' ),
$command
)

View File

@ -170,7 +170,10 @@ class WP_Links_List_Table extends WP_List_Table {
public function column_cb( $link ) {
?>
<label class="screen-reader-text" for="cb-select-<?php echo $link->link_id; ?>">
<?php printf( __( 'Select %s' ), $link->link_name ); ?>
<?php
/* translators: %s: link name */
printf( __( 'Select %s' ), $link->link_name );
?>
</label>
<input type="checkbox" name="linkcheck[]" id="cb-select-<?php echo $link->link_id; ?>" value="<?php echo esc_attr( $link->link_id ); ?>" />
<?php
@ -322,7 +325,14 @@ class WP_Links_List_Table extends WP_List_Table {
$actions = array();
$actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>';
$actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url( "link.php?action=delete&amp;link_id=$link->link_id", 'delete-bookmark_' . $link->link_id ) . "' onclick=\"if ( confirm( '" . esc_js( sprintf( __( "You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete." ), $link->link_name ) ) . "' ) ) { return true;}return false;\">" . __( 'Delete' ) . '</a>';
$actions['delete'] = sprintf(
'<a class="submitdelete" href="%s" onclick="return confirm( \'%s\' );">%s</a>',
wp_nonce_url( "link.php?action=delete&amp;link_id=$link->link_id", 'delete-bookmark_' . $link->link_id ),
/* translators: %s: link name */
esc_js( sprintf( __( "You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete." ), $link->link_name ) ),
__( 'Delete' )
);
return $this->row_actions( $actions );
}
}

View File

@ -661,9 +661,23 @@ class WP_List_Table {
$approved_comments_number = number_format_i18n( $approved_comments );
$pending_comments_number = number_format_i18n( $pending_comments );
$approved_only_phrase = sprintf( _n( '%s comment', '%s comments', $approved_comments ), $approved_comments_number );
$approved_phrase = sprintf( _n( '%s approved comment', '%s approved comments', $approved_comments ), $approved_comments_number );
$pending_phrase = sprintf( _n( '%s pending comment', '%s pending comments', $pending_comments ), $pending_comments_number );
$approved_only_phrase = sprintf(
/* translators: %s: number of comments */
_n( '%s comment', '%s comments', $approved_comments ),
$approved_comments_number
);
$approved_phrase = sprintf(
/* translators: %s: number of comments */
_n( '%s approved comment', '%s approved comments', $approved_comments ),
$approved_comments_number
);
$pending_phrase = sprintf(
/* translators: %s: number of comments */
_n( '%s pending comment', '%s pending comments', $pending_comments ),
$pending_comments_number
);
// No comments at all.
if ( ! $approved_comments && ! $pending_comments ) {
@ -790,7 +804,11 @@ class WP_List_Table {
$this->screen->render_screen_reader_content( 'heading_pagination' );
}
$output = '<span class="displaying-num">' . sprintf( _n( '%s item', '%s items', $total_items ), number_format_i18n( $total_items ) ) . '</span>';
$output = '<span class="displaying-num">' . sprintf(
/* translators: %s: number of items */
_n( '%s item', '%s items', $total_items ),
number_format_i18n( $total_items )
) . '</span>';
$current = $this->get_pagenum();
$removable_query_args = wp_removable_query_args();
@ -858,7 +876,12 @@ class WP_List_Table {
);
}
$html_total_pages = sprintf( "<span class='total-pages'>%s</span>", number_format_i18n( $total_pages ) );
$page_links[] = $total_pages_before . sprintf( _x( '%1$s of %2$s', 'paging' ), $html_current_page, $html_total_pages ) . $total_pages_after;
$page_links[] = $total_pages_before . sprintf(
/* translators: 1: current page, 2: total pages */
_x( '%1$s of %2$s', 'paging' ),
$html_current_page,
$html_total_pages
) . $total_pages_after;
if ( $disable_next ) {
$page_links[] = '<span class="tablenav-pages-navspan button disabled" aria-hidden="true">&rsaquo;</span>';
@ -1374,6 +1397,7 @@ class WP_List_Table {
if ( isset( $this->_pagination_args['total_items'] ) ) {
$response['total_items_i18n'] = sprintf(
/* translators: number of items */
_n( '%s item', '%s items', $this->_pagination_args['total_items'] ),
number_format_i18n( $this->_pagination_args['total_items'] )
);

View File

@ -356,7 +356,10 @@ class WP_Media_List_Table extends WP_List_Table {
if ( current_user_can( 'edit_post', $post->ID ) ) {
?>
<label class="screen-reader-text" for="cb-select-<?php echo $post->ID; ?>">
<?php printf( __( 'Select %s' ), _draft_or_post_title() ); ?>
<?php
/* translators: %s: attachment title */
printf( __( 'Select %s' ), _draft_or_post_title() );
?>
</label>
<input type="checkbox" name="media[]" id="cb-select-<?php echo $post->ID; ?>" value="<?php echo $post->ID; ?>" />
<?php
@ -454,8 +457,10 @@ class WP_Media_List_Table extends WP_List_Table {
$t_diff = time() - $time;
if ( ( abs( $t_diff ) ) < DAY_IN_SECONDS ) {
if ( $t_diff < 0 ) {
/* translators: %s: Human-readable time difference */
$h_time = sprintf( __( '%s from now' ), human_time_diff( $time ) );
} else {
/* translators: %s: Human-readable time difference */
$h_time = sprintf( __( '%s ago' ), human_time_diff( $time ) );
}
} else {

View File

@ -280,7 +280,10 @@ class WP_MS_Sites_List_Table extends WP_List_Table {
$blogname = untrailingslashit( $blog['domain'] . $blog['path'] );
?>
<label class="screen-reader-text" for="blog_<?php echo $blog['blog_id']; ?>">
<?php printf( __( 'Select %s' ), $blogname ); ?>
<?php
/* translators: %s: site URL */
printf( __( 'Select %s' ), $blogname );
?>
</label>
<input type="checkbox" id="blog_<?php echo $blog['blog_id']; ?>" name="allblogs[]" value="<?php echo esc_attr( $blog['blog_id'] ); ?>" />
<?php

View File

@ -300,19 +300,49 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
switch ( $type ) {
case 'all':
$text = _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $count, 'themes' );
/* translators: %s: number of themes */
$text = _nx(
'All <span class="count">(%s)</span>',
'All <span class="count">(%s)</span>',
$count,
'themes'
);
break;
case 'enabled':
$text = _nx( 'Enabled <span class="count">(%s)</span>', 'Enabled <span class="count">(%s)</span>', $count, 'themes' );
/* translators: %s: number of themes */
$text = _nx(
'Enabled <span class="count">(%s)</span>',
'Enabled <span class="count">(%s)</span>',
$count,
'themes'
);
break;
case 'disabled':
$text = _nx( 'Disabled <span class="count">(%s)</span>', 'Disabled <span class="count">(%s)</span>', $count, 'themes' );
/* translators: %s: number of themes */
$text = _nx(
'Disabled <span class="count">(%s)</span>',
'Disabled <span class="count">(%s)</span>',
$count,
'themes'
);
break;
case 'upgrade':
$text = _nx( 'Update Available <span class="count">(%s)</span>', 'Update Available <span class="count">(%s)</span>', $count, 'themes' );
/* translators: %s: number of themes */
$text = _nx(
'Update Available <span class="count">(%s)</span>',
'Update Available <span class="count">(%s)</span>',
$count,
'themes'
);
break;
case 'broken':
$text = _nx( 'Broken <span class="count">(%s)</span>', 'Broken <span class="count">(%s)</span>', $count, 'themes' );
/* translators: %s: number of themes */
$text = _nx(
'Broken <span class="count">(%s)</span>',
'Broken <span class="count">(%s)</span>',
$count,
'themes'
);
break;
}
@ -572,8 +602,11 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
$theme_meta = array();
if ( $theme->get( 'Version' ) ) {
/* translators: %s: theme version */
$theme_meta[] = sprintf( __( 'Version %s' ), $theme->display( 'Version' ) );
}
/* translators: %s: theme author */
$theme_meta[] = sprintf( __( 'By %s' ), $theme->display( 'Author' ) );
if ( $theme->get( 'ThemeURI' ) ) {

View File

@ -139,9 +139,36 @@ class WP_MS_Users_List_Table extends WP_List_Table {
$current_link_attributes = $role !== 'super' ? ' class="current" aria-current="page"' : '';
$role_links = array();
$role_links['all'] = "<a href='" . network_admin_url( 'users.php' ) . "'$current_link_attributes>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_users, 'users' ), number_format_i18n( $total_users ) ) . '</a>';
$role_links['all'] = sprintf(
'<a href="%s"%s>%s</a>',
network_admin_url( 'users.php' ),
$current_link_attributes,
sprintf(
/* translators: number of users */
_nx(
'All <span class="count">(%s)</span>',
'All <span class="count">(%s)</span>',
$total_users,
'users'
),
number_format_i18n( $total_users )
)
);
$current_link_attributes = $role === 'super' ? ' class="current" aria-current="page"' : '';
$role_links['super'] = "<a href='" . network_admin_url( 'users.php?role=super' ) . "'$current_link_attributes>" . sprintf( _n( 'Super Admin <span class="count">(%s)</span>', 'Super Admins <span class="count">(%s)</span>', $total_admins ), number_format_i18n( $total_admins ) ) . '</a>';
$role_links['super'] = sprintf(
'<a href="%s"%s>%s</a>',
network_admin_url( 'users.php?role=super' ),
$current_link_attributes,
sprintf(
/* translators: number of users */
_n(
'Super Admin <span class="count">(%s)</span>',
'Super Admins <span class="count">(%s)</span>',
$total_admins
),
number_format_i18n( $total_admins )
)
);
return $role_links;
}
@ -209,7 +236,10 @@ class WP_MS_Users_List_Table extends WP_List_Table {
}
?>
<label class="screen-reader-text" for="blog_<?php echo $user->ID; ?>">
<?php printf( __( 'Select %s' ), $user->user_login ); ?>
<?php
/* translators: %s: user login */
printf( __( 'Select %s' ), $user->user_login );
?>
</label>
<input type="checkbox" id="blog_<?php echo $user->ID; ?>" name="allusers[]" value="<?php echo esc_attr( $user->ID ); ?>" />
<?php

View File

@ -499,6 +499,7 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
$author = wp_kses( $plugin['author'], $plugins_allowedtags );
if ( ! empty( $author ) ) {
/* translators: %s: plugin author */
$author = ' <cite>' . sprintf( __( 'By %s' ), $author ) . '</cite>';
}
@ -723,13 +724,18 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
<span class="num-ratings" aria-hidden="true">(<?php echo number_format_i18n( $plugin['num_ratings'] ); ?>)</span>
</div>
<div class="column-updated">
<strong><?php _e( 'Last Updated:' ); ?></strong> <?php printf( __( '%s ago' ), human_time_diff( $last_updated_timestamp ) ); ?>
<strong><?php _e( 'Last Updated:' ); ?></strong>
<?php
/* translators: %s: Human-readable time difference */
printf( __( '%s ago' ), human_time_diff( $last_updated_timestamp ) );
?>
</div>
<div class="column-downloaded">
<?php
if ( $plugin['active_installs'] >= 1000000 ) {
$active_installs_millions = floor( $plugin['active_installs'] / 1000000 );
$active_installs_text = sprintf(
/* translators: %s: number of millions */
_nx( '%s+ Million', '%s+ Million', $active_installs_millions, 'Active plugin installations' ),
number_format_i18n( $active_installs_millions )
);
@ -738,6 +744,7 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
} else {
$active_installs_text = number_format_i18n( $plugin['active_installs'] ) . '+';
}
/* translators: %s: number of installations */
printf( __( '%s Active Installations' ), $active_installs_text );
?>
</div>

View File

@ -429,36 +429,69 @@ class WP_Plugins_List_Table extends WP_List_Table {
switch ( $type ) {
case 'all':
/* translators: %s: plugin count */
$text = _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $count, 'plugins' );
/* translators: %s: number of plugins */
$text = _nx(
'All <span class="count">(%s)</span>',
'All <span class="count">(%s)</span>',
$count,
'plugins'
);
break;
case 'active':
/* translators: %s: plugin count */
$text = _n( 'Active <span class="count">(%s)</span>', 'Active <span class="count">(%s)</span>', $count );
/* translators: %s: number of plugins */
$text = _n(
'Active <span class="count">(%s)</span>',
'Active <span class="count">(%s)</span>',
$count
);
break;
case 'recently_activated':
/* translators: %s: plugin count */
$text = _n( 'Recently Active <span class="count">(%s)</span>', 'Recently Active <span class="count">(%s)</span>', $count );
/* translators: %s: number of plugins */
$text = _n(
'Recently Active <span class="count">(%s)</span>',
'Recently Active <span class="count">(%s)</span>',
$count
);
break;
case 'inactive':
/* translators: %s: plugin count */
$text = _n( 'Inactive <span class="count">(%s)</span>', 'Inactive <span class="count">(%s)</span>', $count );
/* translators: %s: number of plugins */
$text = _n(
'Inactive <span class="count">(%s)</span>',
'Inactive <span class="count">(%s)</span>',
$count
);
break;
case 'mustuse':
/* translators: %s: plugin count */
$text = _n( 'Must-Use <span class="count">(%s)</span>', 'Must-Use <span class="count">(%s)</span>', $count );
/* translators: %s: number of plugins */
$text = _n(
'Must-Use <span class="count">(%s)</span>',
'Must-Use <span class="count">(%s)</span>',
$count
);
break;
case 'dropins':
/* translators: %s: plugin count */
$text = _n( 'Drop-in <span class="count">(%s)</span>', 'Drop-ins <span class="count">(%s)</span>', $count );
/* translators: %s: number of plugins */
$text = _n(
'Drop-in <span class="count">(%s)</span>',
'Drop-ins <span class="count">(%s)</span>',
$count
);
break;
case 'paused':
/* translators: %s: plugin count */
$text = _n( 'Paused <span class="count">(%s)</span>', 'Paused <span class="count">(%s)</span>', $count );
/* translators: %s: number of plugins */
$text = _n(
'Paused <span class="count">(%s)</span>',
'Paused <span class="count">(%s)</span>',
$count
);
break;
case 'upgrade':
/* translators: %s: plugin count */
$text = _n( 'Update Available <span class="count">(%s)</span>', 'Update Available <span class="count">(%s)</span>', $count );
/* translators: %s: number of plugins */
$text = _n(
'Update Available <span class="count">(%s)</span>',
'Update Available <span class="count">(%s)</span>',
$count
);
break;
}
@ -768,9 +801,14 @@ class WP_Plugins_List_Table extends WP_List_Table {
if ( $restrict_network_active || $restrict_network_only || in_array( $status, array( 'mustuse', 'dropins' ) ) || ! $compatible_php ) {
$checkbox = '';
} else {
/* translators: %s: plugin name */
$checkbox = "<label class='screen-reader-text' for='" . $checkbox_id . "' >" . sprintf( __( 'Select %s' ), $plugin_data['Name'] ) . '</label>'
. "<input type='checkbox' name='checked[]' value='" . esc_attr( $plugin_file ) . "' id='" . $checkbox_id . "' />";
$checkbox = sprintf(
'<label class="screen-reader-text" for="%1$s">%2$s</label>' .
'<input type="checkbox" name="checked[]" value="%3$s" id="%1$s" />',
$checkbox_id,
/* translators: %s: plugin name */
sprintf( __( 'Select %s' ), $plugin_data['Name'] ),
esc_attr( $plugin_file )
);
}
if ( 'dropins' != $context ) {
$description = '<p>' . ( $plugin_data['Description'] ? $plugin_data['Description'] : '&nbsp;' ) . '</p>';

View File

@ -305,6 +305,7 @@ class WP_Posts_List_Table extends WP_List_Table {
);
$mine_inner_html = sprintf(
/* translators: %s: number of posts */
_nx(
'Mine <span class="count">(%s)</span>',
'Mine <span class="count">(%s)</span>',
@ -325,6 +326,7 @@ class WP_Posts_List_Table extends WP_List_Table {
}
$all_inner_html = sprintf(
/* translators: %s: number of posts */
_nx(
'All <span class="count">(%s)</span>',
'All <span class="count">(%s)</span>',
@ -374,6 +376,7 @@ class WP_Posts_List_Table extends WP_List_Table {
);
$sticky_inner_html = sprintf(
/* translators: %s: number of posts */
_nx(
'Sticky <span class="count">(%s)</span>',
'Sticky <span class="count">(%s)</span>',
@ -917,7 +920,10 @@ class WP_Posts_List_Table extends WP_List_Table {
if ( current_user_can( 'edit_post', $post->ID ) ) :
?>
<label class="screen-reader-text" for="cb-select-<?php the_ID(); ?>">
<?php printf( __( 'Select %s' ), _draft_or_post_title() ); ?>
<?php
/* translators: %s: post title */
printf( __( 'Select %s' ), _draft_or_post_title() );
?>
</label>
<input id="cb-select-<?php the_ID(); ?>" type="checkbox" name="post[]" value="<?php the_ID(); ?>" />
<div class="locked-indicator">
@ -993,7 +999,8 @@ class WP_Posts_List_Table extends WP_List_Table {
if ( $lock_holder ) {
$lock_holder = get_userdata( $lock_holder );
$locked_avatar = get_avatar( $lock_holder->ID, 18 );
$locked_text = esc_html( sprintf( __( '%s is currently editing' ), $lock_holder->display_name ) );
/* translators: %s: user's display name */
$locked_text = esc_html( sprintf( __( '%s is currently editing' ), $lock_holder->display_name ) );
} else {
$locked_avatar = '';
$locked_text = '';
@ -1066,6 +1073,7 @@ class WP_Posts_List_Table extends WP_List_Table {
$time_diff = time() - $time;
if ( $time_diff > 0 && $time_diff < DAY_IN_SECONDS ) {
/* translators: %s: Human-readable time difference */
$h_time = sprintf( __( '%s ago' ), human_time_diff( $time ) );
} else {
$h_time = mysql2date( __( 'Y/m/d' ), $m_time );

View File

@ -204,7 +204,7 @@ final class WP_Privacy_Policy_Content {
*
* @since 4.9.6
*
* @return array The privacy policy text/informtion added by core and plugins.
* @return array The privacy policy text/information added by core and plugins.
*/
public static function get_suggested_policy_text() {
$policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' );
@ -386,14 +386,17 @@ final class WP_Privacy_Policy_Content {
if ( ! empty( $section['removed'] ) ) {
$class = ' text-removed';
$date = date_i18n( $date_format, $section['removed'] );
$meta = sprintf( __( 'Removed %s.' ), $date );
/* translators: %s: date of plugin deactivation */
$meta = sprintf( __( 'Removed %s.' ), $date );
/* translators: %s: date of plugin deactivation */
$removed = __( 'You deactivated this plugin on %s and may no longer need this policy.' );
$removed = '<div class="error inline"><p>' . sprintf( $removed, $date ) . '</p></div>';
} elseif ( ! empty( $section['updated'] ) ) {
$class = ' text-updated';
$date = date_i18n( $date_format, $section['updated'] );
$meta = sprintf( __( 'Updated %s.' ), $date );
/* translators: %s: date of privacy policy text update */
$meta = sprintf( __( 'Updated %s.' ), $date );
}
if ( $meta ) {
@ -417,7 +420,10 @@ final class WP_Privacy_Policy_Content {
$content .= '<div class="privacy-text-actions">';
$content .= '<button type="button" class="privacy-text-copy button">';
$content .= $copy;
$content .= '<span class="screen-reader-text">' . sprintf( __( 'Copy suggested policy text from %s.' ), $plugin_name ) . '</span>';
$content .= '<span class="screen-reader-text">';
/* translators: %s: plugin name */
$content .= sprintf( __( 'Copy suggested policy text from %s.' ), $plugin_name );
$content .= '</span>';
$content .= '</button>';
$content .= '</div>';
}

View File

@ -380,7 +380,7 @@ abstract class WP_Privacy_Requests_Table extends WP_List_Table {
$time_diff = time() - $timestamp;
if ( $time_diff >= 0 && $time_diff < DAY_IN_SECONDS ) {
/* translators: human readable timestamp */
/* translators: %s: Human-readable time difference */
return sprintf( __( '%s ago' ), human_time_diff( $timestamp ) );
}

View File

@ -1162,17 +1162,18 @@ final class WP_Screen {
?>
<fieldset class='columns-prefs'>
<legend class="screen-layout"><?php _e( 'Layout' ); ?></legend>
<?php
for ( $i = 1; $i <= $num; ++$i ) :
?>
<label class="columns-prefs-<?php echo $i; ?>">
<input type='radio' name='screen_columns' value='<?php echo esc_attr( $i ); ?>'
<?php checked( $screen_layout_columns, $i ); ?> />
<?php printf( _n( '%s column', '%s columns', $i ), number_format_i18n( $i ) ); ?>
</label>
<?php
endfor;
?>
<?php for ( $i = 1; $i <= $num; ++$i ) : ?>
<label class="columns-prefs-<?php echo $i; ?>">
<input type='radio' name='screen_columns' value='<?php echo esc_attr( $i ); ?>' <?php checked( $screen_layout_columns, $i ); ?> />
<?php
printf(
/* translators: %s: number of columns on the page */
_n( '%s column', '%s columns', $i ),
number_format_i18n( $i )
);
?>
</label>
<?php endfor; ?>
</fieldset>
<?php
}

View File

@ -355,8 +355,13 @@ class WP_Terms_List_Table extends WP_List_Table {
*/
public function column_cb( $tag ) {
if ( current_user_can( 'delete_term', $tag->term_id ) ) {
return '<label class="screen-reader-text" for="cb-select-' . $tag->term_id . '">' . sprintf( __( 'Select %s' ), $tag->name ) . '</label>'
. '<input type="checkbox" name="delete_tags[]" value="' . $tag->term_id . '" id="cb-select-' . $tag->term_id . '" />';
return sprintf(
'<label class="screen-reader-text" for="cb-select-%1$s">%2$s</label>' .
'<input type="checkbox" name="delete_tags[]" value="%1$s" id="cb-select-%1$s" />',
$tag->term_id,
/* translators: %s: term name */
sprintf( __( 'Select %s' ), $tag->name )
);
}
return '&nbsp;';

View File

@ -97,24 +97,41 @@ class WP_Themes_List_Table extends WP_List_Table {
$blog_id = get_current_blog_id();
if ( is_multisite() ) {
if ( current_user_can( 'install_themes' ) && current_user_can( 'manage_network_themes' ) ) {
printf( __( 'You only have one theme enabled for this site right now. Visit the Network Admin to <a href="%1$s">enable</a> or <a href="%2$s">install</a> more themes.' ), network_admin_url( 'site-themes.php?id=' . $blog_id ), network_admin_url( 'theme-install.php' ) );
printf(
/* translators: 1: URL to Themes tab on Edit Site screen, 2: URL to Add Themes screen */
__( 'You only have one theme enabled for this site right now. Visit the Network Admin to <a href="%1$s">enable</a> or <a href="%2$s">install</a> more themes.' ),
network_admin_url( 'site-themes.php?id=' . $blog_id ),
network_admin_url( 'theme-install.php' )
);
return;
} elseif ( current_user_can( 'manage_network_themes' ) ) {
printf( __( 'You only have one theme enabled for this site right now. Visit the Network Admin to <a href="%1$s">enable</a> more themes.' ), network_admin_url( 'site-themes.php?id=' . $blog_id ) );
printf(
/* translators: %s: URL to Themes tab on Edit Site screen */
__( 'You only have one theme enabled for this site right now. Visit the Network Admin to <a href="%s">enable</a> more themes.' ),
network_admin_url( 'site-themes.php?id=' . $blog_id )
);
return;
}
// Else, fallthrough. install_themes doesn't help if you can't enable it.
} else {
if ( current_user_can( 'install_themes' ) ) {
printf( __( 'You only have one theme installed right now. Live a little! You can choose from over 1,000 free themes in the WordPress Theme Directory at any time: just click on the <a href="%s">Install Themes</a> tab above.' ), admin_url( 'theme-install.php' ) );
printf(
/* translators: %s: URL to Add Themes screen */
__( 'You only have one theme installed right now. Live a little! You can choose from over 1,000 free themes in the WordPress Theme Directory at any time: just click on the <a href="%s">Install Themes</a> tab above.' ),
admin_url( 'theme-install.php' )
);
return;
}
}
// Fallthrough.
printf( __( 'Only the current theme is available to you. Contact the %s administrator for information about accessing additional themes.' ), get_site_option( 'site_name' ) );
printf(
/* translators: %s: network title */
__( 'Only the current theme is available to you. Contact the %s administrator for information about accessing additional themes.' ),
get_site_option( 'site_name' )
);
}
/**
@ -186,18 +203,30 @@ class WP_Themes_List_Table extends WP_List_Table {
$activate_link = wp_nonce_url( 'themes.php?action=activate&amp;template=' . urlencode( $template ) . '&amp;stylesheet=' . urlencode( $stylesheet ), 'switch-theme_' . $stylesheet );
$actions = array();
$actions['activate'] = '<a href="' . $activate_link . '" class="activatelink" title="'
. esc_attr( sprintf( __( 'Activate &#8220;%s&#8221;' ), $title ) ) . '">' . __( 'Activate' ) . '</a>';
$actions['activate'] = sprintf(
'<a href="%s" class="activatelink" title="%s">%s</a>',
$activate_link,
/* translators: %s: theme name */
esc_attr( sprintf( __( 'Activate &#8220;%s&#8221;' ), $title ) ),
__( 'Activate' )
);
if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {
$actions['preview'] .= '<a href="' . wp_customize_url( $stylesheet ) . '" class="load-customize hide-if-no-customize">'
. __( 'Live Preview' ) . '</a>';
$actions['preview'] .= sprintf(
'<a href="%s" class="load-customize hide-if-no-customize">%s</a>',
wp_customize_url( $stylesheet ),
__( 'Live Preview' )
);
}
if ( ! is_multisite() && current_user_can( 'delete_themes' ) ) {
$actions['delete'] = '<a class="submitdelete deletion" href="' . wp_nonce_url( 'themes.php?action=delete&amp;stylesheet=' . urlencode( $stylesheet ), 'delete-theme_' . $stylesheet )
. '" onclick="' . "return confirm( '" . esc_js( sprintf( __( "You are about to delete this theme '%s'\n 'Cancel' to stop, 'OK' to delete." ), $title ) )
. "' );" . '">' . __( 'Delete' ) . '</a>';
$actions['delete'] = sprintf(
'<a class="submitdelete deletion" href="%s" onclick="return confirm( \'%s\' );">%s</a>',
wp_nonce_url( 'themes.php?action=delete&amp;stylesheet=' . urlencode( $stylesheet ), 'delete-theme_' . $stylesheet ),
/* translators: %s: theme name */
esc_js( sprintf( __( "You are about to delete this theme '%s'\n 'Cancel' to stop, 'OK' to delete." ), $title ) ),
__( 'Delete' )
);
}
/** This filter is documented in wp-admin/includes/class-wp-ms-themes-list-table.php */
@ -223,7 +252,12 @@ class WP_Themes_List_Table extends WP_List_Table {
</a>
<h3><?php echo $title; ?></h3>
<div class="theme-author"><?php printf( __( 'By %s' ), $author ); ?></div>
<div class="theme-author">
<?php
/* translators: %s: theme author */
printf( __( 'By %s' ), $author );
?>
</div>
<div class="action-links">
<ul>
<?php foreach ( $actions as $action ) : ?>

View File

@ -194,7 +194,22 @@ class WP_Users_List_Table extends WP_List_Table {
$current_link_attributes = empty( $role ) ? ' class="current" aria-current="page"' : '';
$role_links = array();
$role_links['all'] = "<a href='$url'$current_link_attributes>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_users, 'users' ), number_format_i18n( $total_users ) ) . '</a>';
$role_links['all'] = sprintf(
'<a href="%s"%s>%s</a>',
$url,
$current_link_attributes,
sprintf(
/* translators: %s: number of users */
_nx(
'All <span class="count">(%s)</span>',
'All <span class="count">(%s)</span>',
$total_users,
'users'
),
number_format_i18n( $total_users )
)
);
foreach ( $wp_roles->get_names() as $this_role => $name ) {
if ( ! isset( $avail_roles[ $this_role ] ) ) {
continue;
@ -463,12 +478,19 @@ class WP_Users_List_Table extends WP_List_Table {
$role_classes = esc_attr( implode( ' ', array_keys( $user_roles ) ) );
// Set up the checkbox ( because the user is editable, otherwise it's empty )
$checkbox = '<label class="screen-reader-text" for="user_' . $user_object->ID . '">' . sprintf( __( 'Select %s' ), $user_object->user_login ) . '</label>'
. "<input type='checkbox' name='users[]' id='user_{$user_object->ID}' class='{$role_classes}' value='{$user_object->ID}' />";
$checkbox = sprintf(
'<label class="screen-reader-text" for="user_%1$s">%2$s</label>' .
'<input type="checkbox" name="users[]" id="user_%1$s" class="%3$s" value="%1$s" />',
$user_object->ID,
/* translators: %s: user login */
sprintf( __( 'Select %s' ), $user_object->user_login ),
$role_classes
);
} else {
$edit = "<strong>{$user_object->user_login}{$super_admin}</strong>";
}
$avatar = get_avatar( $user_object->ID, 32 );
// Comma-separated list of user roles.
@ -511,7 +533,10 @@ class WP_Users_List_Table extends WP_List_Table {
} elseif ( $user_object->last_name ) {
$r .= $user_object->last_name;
} else {
$r .= '<span aria-hidden="true">&#8212;</span><span class="screen-reader-text">' . _x( 'Unknown', 'name' ) . '</span>';
$r .= sprintf(
'<span aria-hidden="true">&#8212;</span><span class="screen-reader-text">%s</span>',
_x( 'Unknown', 'name' )
);
}
break;
case 'email':
@ -522,10 +547,16 @@ class WP_Users_List_Table extends WP_List_Table {
break;
case 'posts':
if ( $numposts > 0 ) {
$r .= "<a href='edit.php?author=$user_object->ID' class='edit'>";
$r .= '<span aria-hidden="true">' . $numposts . '</span>';
$r .= '<span class="screen-reader-text">' . sprintf( _n( '%s post by this author', '%s posts by this author', $numposts ), number_format_i18n( $numposts ) ) . '</span>';
$r .= '</a>';
$r .= sprintf(
'<a href="%s" class="edit"><span aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></a>',
"edit.php?author={$user_object->ID}",
$numposts,
sprintf(
/* translators: %s: number of posts */
_n( '%s post by this author', '%s posts by this author', $numposts ),
number_format_i18n( $numposts )
)
);
} else {
$r .= 0;
}

View File

@ -269,8 +269,10 @@ function wp_dashboard_right_now() {
$num_posts = wp_count_posts( $post_type );
if ( $num_posts && $num_posts->publish ) {
if ( 'post' == $post_type ) {
/* translators: %s: number of posts */
$text = _n( '%s Post', '%s Posts', $num_posts->publish );
} else {
/* translators: %s: number of pages */
$text = _n( '%s Page', '%s Pages', $num_posts->publish );
}
$text = sprintf( $text, number_format_i18n( $num_posts->publish ) );
@ -285,12 +287,13 @@ function wp_dashboard_right_now() {
// Comments
$num_comm = wp_count_comments();
if ( $num_comm && ( $num_comm->approved || $num_comm->moderated ) ) {
/* translators: %s: number of comments */
$text = sprintf( _n( '%s Comment', '%s Comments', $num_comm->approved ), number_format_i18n( $num_comm->approved ) );
?>
<li class="comment-count"><a href="edit-comments.php"><?php echo $text; ?></a></li>
<?php
$moderated_comments_count_i18n = number_format_i18n( $num_comm->moderated );
/* translators: %s: number of comments in moderation */
/* translators: %s: number of comments */
$text = sprintf( _n( '%s Comment in moderation', '%s Comments in moderation', $num_comm->moderated ), $moderated_comments_count_i18n );
?>
<li class="comment-mod-count
@ -580,7 +583,11 @@ function wp_dashboard_recent_drafts( $drafts = false ) {
echo '<div class="drafts">';
if ( count( $drafts ) > 3 ) {
echo '<p class="view-all"><a href="' . esc_url( admin_url( 'edit.php?post_status=draft' ) ) . '">' . __( 'View all drafts' ) . "</a></p>\n";
printf(
'<p class="view-all"><a href="%s">%s</a></p>' . "\n",
esc_url( admin_url( 'edit.php?post_status=draft' ) ),
__( 'View all drafts' )
);
}
echo '<h2 class="hide-if-no-js">' . __( 'Your Recent Drafts' ) . "</h2>\n<ul>";
@ -592,9 +599,15 @@ function wp_dashboard_recent_drafts( $drafts = false ) {
$url = get_edit_post_link( $draft->ID );
$title = _draft_or_post_title( $draft->ID );
echo "<li>\n";
/* translators: %s: post title */
echo '<div class="draft-title"><a href="' . esc_url( $url ) . '" aria-label="' . esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $title ) ) . '">' . esc_html( $title ) . '</a>';
echo '<time datetime="' . get_the_time( 'c', $draft ) . '">' . get_the_time( __( 'F j, Y' ), $draft ) . '</time></div>';
printf(
'<div class="draft-title"><a href="%s" aria-label="%s">%s</a><time datetime="%s">%s</time></div>',
esc_url( $url ),
/* translators: %s: post title */
esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $title ) ),
esc_html( $title ),
get_the_time( 'c', $draft ),
get_the_time( __( 'F j, Y' ), $draft )
);
$the_content = wp_trim_words( $draft->post_content, $draft_length );
if ( $the_content ) {
echo '<p>' . $the_content . '</p>';
@ -1495,14 +1508,14 @@ function wp_dashboard_browser_nag() {
if ( $response ) {
if ( $response['insecure'] ) {
/* translators: %s: browser name and link */
$msg = sprintf(
/* translators: %s: browser name and link */
__( "It looks like you're using an insecure version of %s. Using an outdated browser makes your computer unsafe. For the best WordPress experience, please update your browser." ),
sprintf( '<a href="%s">%s</a>', esc_url( $response['update_url'] ), esc_html( $response['name'] ) )
);
} else {
/* translators: %s: browser name and link */
$msg = sprintf(
/* translators: %s: browser name and link */
__( "It looks like you're using an old version of %s. For the best WordPress experience, please update your browser." ),
sprintf( '<a href="%s">%s</a>', esc_url( $response['update_url'] ), esc_html( $response['name'] ) )
);
@ -1523,7 +1536,13 @@ function wp_dashboard_browser_nag() {
$browsehappy = add_query_arg( 'locale', $locale, $browsehappy );
}
$notice .= '<p>' . sprintf( __( '<a href="%1$s" class="update-browser-link">Update %2$s</a> or learn how to <a href="%3$s" class="browse-happy-link">browse happy</a>' ), esc_attr( $response['update_url'] ), esc_html( $response['name'] ), esc_url( $browsehappy ) ) . '</p>';
$notice .= '<p>' . sprintf(
/* translators: 1: browser update URL, 2: browser name, 3: Browse Happy URL */
__( '<a href="%1$s" class="update-browser-link">Update %2$s</a> or learn how to <a href="%3$s" class="browse-happy-link">browse happy</a>' ),
esc_attr( $response['update_url'] ),
esc_html( $response['name'] ),
esc_url( $browsehappy )
) . '</p>';
$notice .= '<p class="hide-if-no-js"><a href="" class="dismiss" aria-label="' . esc_attr__( 'Dismiss the browser warning panel' ) . '">' . __( 'Dismiss' ) . '</a></p>';
$notice .= '<div class="clear"></div>';
}
@ -1697,7 +1716,12 @@ function wp_welcome_panel() {
<a class="button button-primary button-hero hide-if-customize" href="<?php echo admin_url( 'themes.php' ); ?>"><?php _e( 'Customize Your Site' ); ?></a>
<?php if ( current_user_can( 'install_themes' ) || ( current_user_can( 'switch_themes' ) && count( wp_get_themes( array( 'allowed' => true ) ) ) > 1 ) ) : ?>
<?php $themes_link = current_user_can( 'customize' ) ? add_query_arg( 'autofocus[panel]', 'themes', admin_url( 'customize.php' ) ) : admin_url( 'themes.php' ); ?>
<p class="hide-if-no-customize"><?php printf( __( 'or, <a href="%s">change your theme completely</a>' ), $themes_link ); ?></p>
<p class="hide-if-no-customize">
<?php
/* translators: %s: URL to Themes panel in Customizer or Themes screen */
printf( __( 'or, <a href="%s">change your theme completely</a>' ), $themes_link );
?>
</p>
<?php endif; ?>
</div>
<div class="welcome-panel-column">
@ -1725,6 +1749,7 @@ function wp_welcome_panel() {
if ( current_theme_supports( 'widgets' ) || current_theme_supports( 'menus' ) ) :
if ( current_theme_supports( 'widgets' ) && current_theme_supports( 'menus' ) ) {
$widgets_menus_link = sprintf(
/* translators: 1: URL to Widgets screen, 2: URL to Menus screen */
__( 'Manage <a href="%1$s">widgets</a> or <a href="%2$s">menus</a>' ),
admin_url( 'widgets.php' ),
admin_url( 'nav-menus.php' )

View File

@ -599,7 +599,9 @@ class WP_User_Search {
'add_args' => $args
) );
if ( $this->paging_text ) {
$this->paging_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s&#8211;%s of %s' ) . '</span>%s',
$this->paging_text = sprintf(
/* translators: 1: starting number of users on the current page, 2: ending number of users, 3: total number of users */
'<span class="displaying-num">' . __( 'Displaying %1$s&#8211;%2$s of %3$s' ) . '</span>%s',
number_format_i18n( ( $this->page - 1 ) * $this->users_per_page + 1 ),
number_format_i18n( min( $this->page * $this->users_per_page, $this->total_users_for_query ) ),
number_format_i18n( $this->total_users_for_query ),

View File

@ -87,6 +87,7 @@ function get_file_description( $file ) {
} elseif ( file_exists( $file_path ) && is_file( $file_path ) ) {
$template_data = implode( '', file( $file_path ) );
if ( preg_match( '|Template Name:(.*)$|mi', $template_data, $name ) ) {
/* translators: %s: template name */
return sprintf( __( '%s Page Template' ), _cleanup_header_comment( $name[1] ) );
}
}
@ -871,7 +872,14 @@ function _wp_handle_upload( &$file, $overrides, $time, $action ) {
} else {
$error_path = basename( $uploads['basedir'] ) . $uploads['subdir'];
}
return $upload_error_handler( $file, sprintf( __( 'The uploaded file could not be moved to %s.' ), $error_path ) );
return $upload_error_handler(
$file,
sprintf(
/* translators: %s: destination file path */
__( 'The uploaded file could not be moved to %s.' ),
$error_path
)
);
}
}
@ -1154,7 +1162,15 @@ function verify_file_md5( $filename, $expected_md5 ) {
return true;
}
return new WP_Error( 'md5_mismatch', sprintf( __( 'The checksum of the file (%1$s) does not match the expected checksum value (%2$s).' ), bin2hex( $file_md5 ), bin2hex( $expected_raw_md5 ) ) );
return new WP_Error(
'md5_mismatch',
sprintf(
/* translators: 1: file checksum, 2: expected checksum value */
__( 'The checksum of the file (%1$s) does not match the expected checksum value (%2$s).' ),
bin2hex( $file_md5 ),
bin2hex( $expected_raw_md5 )
)
);
}
/**

View File

@ -57,7 +57,15 @@ function wp_image_editor( $post_id, $msg = false ) {
<p><?php _e( 'You can proportionally scale the original image. For best results, scaling should be done before you crop, flip, or rotate. Images can only be scaled down, not up.' ); ?></p>
</div>
<?php if ( isset( $meta['width'], $meta['height'] ) ) : ?>
<p><?php printf( __( 'Original dimensions %s' ), $meta['width'] . ' &times; ' . $meta['height'] ); ?></p>
<p>
<?php
printf(
/* translators: %s: image width and height in pixels */
__( 'Original dimensions %s' ),
$meta['width'] . ' &times; ' . $meta['height']
);
?>
</p>
<?php endif ?>
<div class="imgedit-submit">
@ -85,14 +93,13 @@ function wp_image_editor( $post_id, $msg = false ) {
<h2><button type="button" onclick="imageEdit.toggleHelp(this);" class="button-link"><?php _e( 'Restore Original Image' ); ?> <span class="dashicons dashicons-arrow-down imgedit-help-toggle"></span></button></h2>
<div class="imgedit-help">
<p>
<?php
_e( 'Discard any changes and restore the original image.' );
<?php
_e( 'Discard any changes and restore the original image.' );
if ( ! defined( 'IMAGE_EDIT_OVERWRITE' ) || ! IMAGE_EDIT_OVERWRITE ) {
echo ' ' . __( 'Previously edited copies of the image will not be deleted.' );
}
?>
if ( ! defined( 'IMAGE_EDIT_OVERWRITE' ) || ! IMAGE_EDIT_OVERWRITE ) {
echo ' ' . __( 'Previously edited copies of the image will not be deleted.' );
}
?>
</p>
<div class="imgedit-submit">
<input type="button" onclick="imageEdit.action(<?php echo "$post_id, '$nonce'"; ?>, 'restore')" class="button button-primary" value="<?php esc_attr_e( 'Restore image' ); ?>" <?php echo $can_restore; ?> />

View File

@ -60,6 +60,7 @@ function update_gallery_tab( $tabs ) {
return $tabs;
}
/* translators: %s: number of attachments */
$tabs['gallery'] = sprintf( __( 'Gallery (%s)' ), "<span id='attachments-count'>$attachments</span>" );
return $tabs;
@ -331,7 +332,7 @@ function media_handle_upload( $file_id, $post_id, $post_data = array(), $overrid
/* translators: 1: audio track title, 2: artist name */
$content .= sprintf( __( '"%1$s" by %2$s.' ), $title, $meta['artist'] );
} else {
/* translators: 1: audio track title */
/* translators: %s: audio track title */
$content .= sprintf( __( '"%s".' ), $title );
}
} elseif ( ! empty( $meta['album'] ) ) {
@ -1601,7 +1602,10 @@ function get_media_item( $attachment_id, $args = null ) {
<tbody>
<tr><td colspan='2' class='imgedit-response' id='imgedit-response-$post->ID'></td></tr>\n
<tr><td style='display:none' colspan='2' class='image-editor' id='image-editor-$post->ID'></td></tr>\n
<tr><td colspan='2'><p class='media-types media-types-required-info'>" . sprintf( __( 'Required fields are marked %s' ), '<span class="required">*</span>' ) . "</p></td></tr>\n";
<tr><td colspan='2'><p class='media-types media-types-required-info'>" .
/* translators: %s: an asterisk symbol (*) */
sprintf( __( 'Required fields are marked %s' ), '<span class="required">*</span>' ) .
"</p></td></tr>\n";
$defaults = array(
'input' => 'text',
@ -1906,8 +1910,10 @@ function get_compat_media_markup( $attachment_id, $args = null ) {
if ( $item ) {
$item = '<p class="media-types media-types-required-info">' .
sprintf( __( 'Required fields are marked %s' ), '<span class="required">*</span>' ) . '</p>
<table class="compat-attachment-fields">' . $item . '</table>';
/* translators: %s: an asterisk symbol (*) */
sprintf( __( 'Required fields are marked %s' ), '<span class="required">*</span>' ) .
'</p>' .
'<table class="compat-attachment-fields">' . $item . '</table>';
}
foreach ( $hidden_fields as $hidden_field => $value ) {
@ -1956,7 +1962,11 @@ function media_upload_form( $errors = null ) {
global $type, $tab, $is_IE, $is_opera;
if ( ! _device_can_upload() ) {
echo '<p>' . sprintf( __( 'The web browser on your device cannot be used to upload files. You may be able to use the <a href="%s">native app for your device</a> instead.' ), 'https://apps.wordpress.org/' ) . '</p>';
echo '<p>' . sprintf(
/* translators: %s: https://apps.wordpress.org/ */
__( 'The web browser on your device cannot be used to upload files. You may be able to use the <a href="%s">native app for your device</a> instead.' ),
'https://apps.wordpress.org/'
) . '</p>';
return;
}
@ -2130,7 +2140,12 @@ wpUploaderInit = <?php echo wp_json_encode( $plupload_init ); ?>;
?>
</div>
<p class="max-upload-size"><?php printf( __( 'Maximum upload file size: %s.' ), esc_html( size_format( $max_upload_size ) ) ); ?></p>
<p class="max-upload-size">
<?php
/* translators: %s: maximum allowed file size */
printf( __( 'Maximum upload file size: %s.' ), esc_html( size_format( $max_upload_size ) ) );
?>
</p>
<?php
/**
@ -2775,7 +2790,10 @@ function wp_media_insert_url_form( $default_view = 'image' ) {
return '
<p class="media-types"><label><input type="radio" name="media_type" value="image" id="image-only"' . checked( 'image-only', $view, false ) . ' /> ' . __( 'Image' ) . '</label> &nbsp; &nbsp; <label><input type="radio" name="media_type" value="generic" id="not-image"' . checked( 'not-image', $view, false ) . ' /> ' . __( 'Audio, Video, or Other File' ) . '</label></p>
<p class="media-types media-types-required-info">' . sprintf( __( 'Required fields are marked %s' ), '<span class="required">*</span>' ) . '</p>
<p class="media-types media-types-required-info">' .
/* translators: %s: an asterisk symbol (*) */
sprintf( __( 'Required fields are marked %s' ), '<span class="required">*</span>' ) .
'</p>
<table class="describe ' . $table_class . '"><tbody>
<tr>
<th scope="row" class="label" style="width:130px;">
@ -2862,7 +2880,14 @@ function media_upload_flash_bypass() {
?>
<p class="upload-flash-bypass">
<?php printf( __( 'You are using the multi-file uploader. Problems? Try the <a href="%1$s" target="%2$s">browser uploader</a> instead.' ), $browser_uploader, '_blank' ); ?>
<?php
printf(
/* translators: 1: URL to browser uploader, 2: additional link attributes */
__( 'You are using the multi-file uploader. Problems? Try the <a href="%1$s" %2$s>browser uploader</a> instead.' ),
$browser_uploader,
'target="_blank"'
);
?>
</p>
<?php
}

View File

@ -1026,9 +1026,15 @@ function link_submit_meta_box( $link ) {
<div id="delete-action">
<?php
if ( ! empty( $_GET['action'] ) && 'edit' == $_GET['action'] && current_user_can( 'manage_links' ) ) {
?>
<a class="submitdelete deletion" href="<?php echo wp_nonce_url( "link.php?action=delete&amp;link_id=$link->link_id", 'delete-bookmark_' . $link->link_id ); ?>" onclick="if ( confirm('<?php echo esc_js( sprintf( __( "You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete." ), $link->link_name ) ); ?>') ) {return true;}return false;"><?php _e( 'Delete' ); ?></a>
<?php } ?>
printf(
'<a class="submitdelete deletion" href="%s" onclick="return confirm( \'%s\' );">%s</a>',
wp_nonce_url( "link.php?action=delete&amp;link_id=$link->link_id", 'delete-bookmark_' . $link->link_id ),
/* translators: %s: link name */
esc_js( sprintf( __( "You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete." ), $link->link_name ) ),
__( 'Delete' )
);
}
?>
</div>
<div id="publishing-action">

View File

@ -1013,7 +1013,10 @@ function wp_check_locked_posts( $response, $data, $screen_id ) {
if ( $user_id ) {
$user = get_userdata( $user_id );
if ( $user && current_user_can( 'edit_post', $post_id ) ) {
$send = array( 'text' => sprintf( __( '%s is currently editing' ), $user->display_name ) );
$send = array(
/* translators: %s: user's display name */
'text' => sprintf( __( '%s is currently editing' ), $user->display_name ),
);
$avatar = get_avatar( $user->ID, 18 );
if ( $avatar && preg_match( "|src='([^']+)'|", $avatar, $matches ) ) {
@ -1061,6 +1064,7 @@ function wp_refresh_post_lock( $response, $data, $screen_id ) {
$user = get_userdata( $user_id );
if ( $user ) {
$error = array(
/* translators: %s: user's display name */
'text' => sprintf( __( '%s has taken over and is currently editing.' ), $user->display_name ),
);
@ -1186,9 +1190,9 @@ function heartbeat_autosave( $response, $data ) {
} else {
/* translators: draft saved date format, see https://secure.php.net/date */
$draft_saved_date_format = __( 'g:i:s a' );
/* translators: %s: date and time */
$response['wp_autosave'] = array(
'success' => true,
/* translators: %s: date and time */
'message' => sprintf( __( 'Draft saved at %s.' ), date_i18n( $draft_saved_date_format ) ),
);
}
@ -1341,8 +1345,15 @@ All at ###SITENAME###
$content = str_replace( '###SITENAME###', wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ), $content );
$content = str_replace( '###SITEURL###', home_url(), $content );
/* translators: New admin email address notification email subject. %s: Site title */
wp_mail( $value, sprintf( __( '[%s] New Admin Email Address' ), wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ) ), $content );
wp_mail(
$value,
sprintf(
/* translators: New admin email address notification email subject. %s: Site title */
__( '[%s] New Admin Email Address' ),
wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES )
),
$content
);
if ( $switched_locale ) {
restore_previous_locale();

View File

@ -579,10 +579,21 @@ function _access_denied_splash() {
$blog_name = get_bloginfo( 'name' );
if ( empty( $blogs ) ) {
wp_die( sprintf( __( 'You attempted to access the "%1$s" dashboard, but you do not currently have privileges on this site. If you believe you should be able to access the "%1$s" dashboard, please contact your network administrator.' ), $blog_name ), 403 );
wp_die(
sprintf(
/* translators: 1: Site title */
__( 'You attempted to access the "%1$s" dashboard, but you do not currently have privileges on this site. If you believe you should be able to access the "%1$s" dashboard, please contact your network administrator.' ),
$blog_name
),
403
);
}
$output = '<p>' . sprintf( __( 'You attempted to access the "%1$s" dashboard, but you do not currently have privileges on this site. If you believe you should be able to access the "%1$s" dashboard, please contact your network administrator.' ), $blog_name ) . '</p>';
$output = '<p>' . sprintf(
/* translators: 1: Site title */
__( 'You attempted to access the "%1$s" dashboard, but you do not currently have privileges on this site. If you believe you should be able to access the "%1$s" dashboard, please contact your network administrator.' ),
$blog_name
) . '</p>';
$output .= '<p>' . __( 'If you reached this screen by accident and meant to visit one of your own sites, here are some shortcuts to help you find your way.' ) . '</p>';
$output .= '<h3>' . __( 'Your Sites' ) . '</h3>';
@ -690,7 +701,11 @@ function site_admin_notice() {
}
if ( get_site_option( 'wpmu_upgrade_site' ) != $wp_db_version ) {
echo "<div class='update-nag'>" . sprintf( __( 'Thank you for Updating! Please visit the <a href="%s">Upgrade Network</a> page to update all your sites.' ), esc_url( network_admin_url( 'upgrade.php' ) ) ) . '</div>';
echo "<div class='update-nag'>" . sprintf(
/* translators: %s: URL to Upgrade Network screen */
__( 'Thank you for Updating! Please visit the <a href="%s">Upgrade Network</a> page to update all your sites.' ),
esc_url( network_admin_url( 'upgrade.php' ) )
) . '</div>';
}
}
@ -744,7 +759,7 @@ function choose_primary_blog() {
?>
<table class="form-table" role="presentation">
<tr>
<?php /* translators: My sites label */ ?>
<?php /* translators: My Sites label */ ?>
<th scope="row"><label for="primary_blog"><?php _e( 'Primary Site' ); ?></label></th>
<td>
<?php
@ -862,11 +877,23 @@ function confirm_delete_users( $users ) {
$delete_user = get_userdata( $user_id );
if ( ! current_user_can( 'delete_user', $delete_user->ID ) ) {
wp_die( sprintf( __( 'Warning! User %s cannot be deleted.' ), $delete_user->user_login ) );
wp_die(
sprintf(
/* translators: %s: user login */
__( 'Warning! User %s cannot be deleted.' ),
$delete_user->user_login
)
);
}
if ( in_array( $delete_user->user_login, $site_admins ) ) {
wp_die( sprintf( __( 'Warning! User cannot be deleted. The user %s is a network administrator.' ), '<em>' . $delete_user->user_login . '</em>' ) );
wp_die(
sprintf(
/* translators: %s: user login */
__( 'Warning! User cannot be deleted. The user %s is a network administrator.' ),
'<em>' . $delete_user->user_login . '</em>'
)
);
}
?>
<tr>
@ -912,7 +939,12 @@ function confirm_delete_users( $users ) {
$user_dropdown .= "</select>\n";
?>
<ul style="list-style:none;">
<li><?php printf( __( 'Site: %s' ), $user_site ); ?></li>
<li>
<?php
/* translators: %s: link to user's site */
printf( __( 'Site: %s' ), $user_site );
?>
</li>
<li><label><input type="radio" id="delete_option0" name="delete[<?php echo $details->userblog_id . '][' . $delete_user->ID; ?>]" value="delete" checked="checked" />
<?php _e( 'Delete all content.' ); ?></label></li>
<li><label><input type="radio" id="delete_option1" name="delete[<?php echo $details->userblog_id . '][' . $delete_user->ID; ?>]" value="reassign" />
@ -1099,7 +1131,11 @@ function get_site_screen_help_tab_args() {
'<p>' . __( 'The menu is for editing information specific to individual sites, particularly if the admin area of a site is unavailable.' ) . '</p>' .
'<p>' . __( '<strong>Info</strong> &mdash; The site URL is rarely edited as this can cause the site to not work properly. The Registered date and Last Updated date are displayed. Network admins can mark a site as archived, spam, deleted and mature, to remove from public listings or disable.' ) . '</p>' .
'<p>' . __( '<strong>Users</strong> &mdash; This displays the users associated with this site. You can also change their role, reset their password, or remove them from the site. Removing the user from the site does not remove the user from the network.' ) . '</p>' .
'<p>' . sprintf( __( '<strong>Themes</strong> &mdash; This area shows themes that are not already enabled across the network. Enabling a theme in this menu makes it accessible to this site. It does not activate the theme, but allows it to show in the site&#8217;s Appearance menu. To enable a theme for the entire network, see the <a href="%s">Network Themes</a> screen.' ), network_admin_url( 'themes.php' ) ) . '</p>' .
'<p>' . sprintf(
/* translators: %s: URL to Network Themes screen */
__( '<strong>Themes</strong> &mdash; This area shows themes that are not already enabled across the network. Enabling a theme in this menu makes it accessible to this site. It does not activate the theme, but allows it to show in the site&#8217;s Appearance menu. To enable a theme for the entire network, see the <a href="%s">Network Themes</a> screen.' ),
network_admin_url( 'themes.php' )
) . '</p>' .
'<p>' . __( '<strong>Settings</strong> &mdash; This page shows a list of all settings associated with this site. Some are created by WordPress and others are created by plugins you activate. Note that some fields are grayed out and say Serialized Data. You cannot modify these values due to the way the setting is stored in the database.' ) . '</p>',
);
}

View File

@ -1024,8 +1024,8 @@ function wp_get_nav_menu_to_edit( $menu_id = 0 ) {
} else {
return new WP_Error(
'menu_walker_not_exist',
/* translators: %s: walker class name */
sprintf(
/* translators: %s: walker class name */
__( 'The Walker class named %s does not exist.' ),
'<strong>' . $walker_class_name . '</strong>'
)
@ -1202,8 +1202,8 @@ function wp_nav_menu_update_menu_items( $nav_menu_selected_id, $nav_menu_selecte
do_action( 'wp_update_nav_menu', $nav_menu_selected_id );
$messages[] = '<div id="message" class="updated notice is-dismissible"><p>' .
/* translators: %s: nav menu title */
sprintf(
/* translators: %s: nav menu title */
__( '%s has been updated.' ),
'<strong>' . $nav_menu_selected_title . '</strong>'
) . '</p></div>';

View File

@ -190,16 +190,16 @@ function network_step1( $errors = false ) {
$got_mod_rewrite = got_mod_rewrite();
if ( $got_mod_rewrite ) { // dangerous assumptions
echo '<div class="updated inline"><p><strong>' . __( 'Note:' ) . '</strong> ';
/* translators: %s: mod_rewrite */
printf(
/* translators: %s: mod_rewrite */
__( 'Please make sure the Apache %s module is installed as it will be used at the end of this installation.' ),
'<code>mod_rewrite</code>'
);
echo '</p>';
} elseif ( $is_apache ) {
echo '<div class="error inline"><p><strong>' . __( 'Warning:' ) . '</strong> ';
/* translators: %s: mod_rewrite */
printf(
/* translators: %s: mod_rewrite */
__( 'It looks like the Apache %s module is not installed.' ),
'<code>mod_rewrite</code>'
);
@ -208,8 +208,8 @@ function network_step1( $errors = false ) {
if ( $got_mod_rewrite || $is_apache ) { // Protect against mod_rewrite mimicry (but ! Apache)
echo '<p>';
/* translators: 1: mod_rewrite, 2: mod_rewrite documentation URL, 3: Google search for mod_rewrite */
printf(
/* translators: 1: mod_rewrite, 2: mod_rewrite documentation URL, 3: Google search for mod_rewrite */
__( 'If %1$s is disabled, ask your administrator to enable that module, or look at the <a href="%2$s">Apache documentation</a> or <a href="%3$s">elsewhere</a> for help setting it up.' ),
'<code>mod_rewrite</code>',
'https://httpd.apache.org/docs/mod/mod_rewrite.html',

View File

@ -261,7 +261,15 @@ function install_popular_tags( $args = array() ) {
*/
function install_dashboard() {
?>
<p><?php printf( __( 'Plugins extend and expand the functionality of WordPress. You may automatically install plugins from the <a href="%1$s">WordPress Plugin Directory</a> or upload a plugin in .zip format by clicking the button at the top of this page.' ), __( 'https://wordpress.org/plugins/' ) ); ?></p>
<p>
<?php
printf(
/* translators: %s: https://wordpress.org/plugins/ */
__( 'Plugins extend and expand the functionality of WordPress. You may automatically install plugins from the <a href="%s">WordPress Plugin Directory</a> or upload a plugin in .zip format by clicking the button at the top of this page.' ),
__( 'https://wordpress.org/plugins/' )
);
?>
</p>
<?php display_plugins_table(); ?>
@ -292,7 +300,9 @@ function install_dashboard() {
echo wp_generate_tag_cloud(
$tags,
array(
/* translators: %s: number of plugins */
'single_text' => __( '%s plugin' ),
/* translators: %s: number of plugins */
'multiple_text' => __( '%s plugins' ),
)
);
@ -390,6 +400,7 @@ function display_plugins_table() {
break;
case 'install_plugins_beta':
printf(
/* translators: %s: URL to "Features as Plugins" page */
'<p>' . __( 'You are using a development version of WordPress. These feature plugins are also under development. <a href="%s">Learn more</a>.' ) . '</p>',
'https://make.wordpress.org/core/handbook/about/release-cycle/features-as-plugins/'
);
@ -639,7 +650,7 @@ function install_plugin_information() {
<?php } if ( ! empty( $api->last_updated ) ) { ?>
<li><strong><?php _e( 'Last Updated:' ); ?></strong>
<?php
/* translators: %s: Time since the last update */
/* translators: %s: Human-readable time difference */
printf( __( '%s ago' ), human_time_diff( strtotime( $api->last_updated ) ) );
?>
</li>
@ -667,6 +678,7 @@ function install_plugin_information() {
if ( $api->active_installs >= 1000000 ) {
$active_installs_millions = floor( $api->active_installs / 1000000 );
printf(
/* translators: %s: number of millions */
_nx( '%s+ Million', '%s+ Million', $active_installs_millions, 'Active plugin installations' ),
number_format_i18n( $active_installs_millions )
);
@ -696,7 +708,15 @@ function install_plugin_information() {
)
);
?>
<p aria-hidden="true" class="fyi-description"><?php printf( _n( '(based on %s rating)', '(based on %s ratings)', $api->num_ratings ), number_format_i18n( $api->num_ratings ) ); ?></p>
<p aria-hidden="true" class="fyi-description">
<?php
printf(
/* translators: %s: number of ratings */
_n( '(based on %s rating)', '(based on %s ratings)', $api->num_ratings ),
number_format_i18n( $api->num_ratings )
);
?>
</p>
<?php
}
@ -707,11 +727,15 @@ function install_plugin_information() {
<?php
foreach ( $api->ratings as $key => $ratecount ) {
// Avoid div-by-zero.
$_rating = $api->num_ratings ? ( $ratecount / $api->num_ratings ) : 0;
/* translators: 1: number of stars (used to determine singular/plural), 2: number of reviews */
$_rating = $api->num_ratings ? ( $ratecount / $api->num_ratings ) : 0;
$aria_label = esc_attr(
sprintf(
_n( 'Reviews with %1$d star: %2$s. Opens in a new tab.', 'Reviews with %1$d stars: %2$s. Opens in a new tab.', $key ),
/* translators: 1: number of stars (used to determine singular/plural), 2: number of reviews */
_n(
'Reviews with %1$d star: %2$s. Opens in a new tab.',
'Reviews with %1$d stars: %2$s. Opens in a new tab.',
$key
),
$key,
number_format_i18n( $ratecount )
)
@ -719,8 +743,15 @@ function install_plugin_information() {
?>
<div class="counter-container">
<span class="counter-label">
<a href="https://wordpress.org/support/plugin/<?php echo $api->slug; ?>/reviews/?filter=<?php echo $key; ?>"
target="_blank" aria-label="<?php echo $aria_label; ?>"><?php printf( _n( '%d star', '%d stars', $key ), $key ); ?></a>
<?php
printf(
'<a href="%s" target="_blank" aria-label="%s">%s</a>',
"https://wordpress.org/support/plugin/{$api->slug}/reviews/?filter={$key}",
$aria_label,
/* translators: %s: number of stars */
sprintf( _n( '%d star', '%d stars', $key ), $key )
);
?>
</span>
<span class="counter-back">
<span class="counter-bar" style="width: <?php echo 92 * $_rating; ?>px;"></span>

View File

@ -209,7 +209,11 @@ function _get_plugin_data_markup_translate( $plugin_file, $plugin_data, $markup
$plugin_data['Description'] = wptexturize( $plugin_data['Description'] );
if ( $plugin_data['Author'] ) {
$plugin_data['Description'] .= ' <cite>' . sprintf( __( 'By %s.' ), $plugin_data['Author'] ) . '</cite>';
$plugin_data['Description'] .= sprintf(
/* translators: %s: plugin author */
' <cite>' . __( 'By %s.' ) . '</cite>',
$plugin_data['Author']
);
}
}

View File

@ -241,6 +241,7 @@ function wp_prepare_revisions_for_js( $post, $selected_revision_id, $from = null
'author' => $authors[ $revision->post_author ],
'date' => date_i18n( __( 'M j, Y @ H:i' ), $modified ),
'dateShort' => date_i18n( _x( 'j M @ H:i', 'revision date short format' ), $modified ),
/* translators: %s: Human-readable time difference */
'timeAgo' => sprintf( __( '%s ago' ), human_time_diff( $modified_gmt, $now_gmt ) ),
'autosave' => $autosave,
'current' => $current,
@ -283,6 +284,7 @@ function wp_prepare_revisions_for_js( $post, $selected_revision_id, $from = null
'author' => $authors[ $post->post_author ],
'date' => date_i18n( __( 'M j, Y @ H:i' ), strtotime( $post->post_modified ) ),
'dateShort' => date_i18n( _x( 'j M @ H:i', 'revision date short format' ), strtotime( $post->post_modified ) ),
/* translators: %s: Human-readable time difference */
'timeAgo' => sprintf( __( '%s ago' ), human_time_diff( strtotime( $post->post_modified_gmt ), $now_gmt ) ),
'autosave' => false,
'current' => true,
@ -397,6 +399,7 @@ function wp_print_revision_templates() {
<span class="byline">
<?php
printf(
/* translators: %s: user's display name */
__( 'Autosave by %s' ),
'<span class="author-name">{{ data.attributes.author.name }}</span>'
);
@ -406,6 +409,7 @@ function wp_print_revision_templates() {
<span class="byline">
<?php
printf(
/* translators: %s: user's display name */
__( 'Current Revision by %s' ),
'<span class="author-name">{{ data.attributes.author.name }}</span>'
);
@ -415,6 +419,7 @@ function wp_print_revision_templates() {
<span class="byline">
<?php
printf(
/* translators: %s: user's display name */
__( 'Revision by %s' ),
'<span class="author-name">{{ data.attributes.author.name }}</span>'
);

View File

@ -531,10 +531,22 @@ function wp_comment_reply( $position = 1, $checkbox = false, $mode = 'single', $
function wp_comment_trashnotice() {
?>
<div class="hidden" id="trash-undo-holder">
<div class="trash-undo-inside"><?php printf( __( 'Comment by %s moved to the trash.' ), '<strong></strong>' ); ?> <span class="undo untrash"><a href="#"><?php _e( 'Undo' ); ?></a></span></div>
<div class="trash-undo-inside">
<?php
/* translators: %s: comment author, filled by AJAX */
printf( __( 'Comment by %s moved to the trash.' ), '<strong></strong>' );
?>
<span class="undo untrash"><a href="#"><?php _e( 'Undo' ); ?></a></span>
</div>
</div>
<div class="hidden" id="spam-undo-holder">
<div class="spam-undo-inside"><?php printf( __( 'Comment by %s marked as spam.' ), '<strong></strong>' ); ?> <span class="undo unspam"><a href="#"><?php _e( 'Undo' ); ?></a></span></div>
<div class="spam-undo-inside">
<?php
/* translators: %s: comment author, filled by AJAX */
printf( __( 'Comment by %s marked as spam.' ), '<strong></strong>' );
?>
<span class="undo unspam"><a href="#"><?php _e( 'Undo' ); ?></a></span>
</div>
</div>
<?php
}
@ -955,7 +967,14 @@ function wp_import_upload_form( $action ) {
?>
<form enctype="multipart/form-data" id="import-upload-form" method="post" class="wp-upload-form" action="<?php echo esc_url( wp_nonce_url( $action, 'import-upload' ) ); ?>">
<p>
<label for="upload"><?php _e( 'Choose a file from your computer:' ); ?></label> (<?php printf( __( 'Maximum size: %s' ), $size ); ?>)
<?php
printf(
'<label for="upload">%s</label> (%s)',
__( 'Choose a file from your computer:' ),
/* translators: %s: maximum allowed file size */
sprintf( __( 'Maximum size: %s' ), $size )
);
?>
<input type="file" id="upload" name="import" size="25" />
<input type="hidden" name="action" value="save" />
<input type="hidden" name="max_file_size" value="<?php echo $bytes; ?>" />
@ -1289,7 +1308,11 @@ function do_meta_boxes( $screen, $context, $object ) {
}
echo '<button type="button" class="handlediv" aria-expanded="true">';
echo '<span class="screen-reader-text">' . sprintf( __( 'Toggle panel: %s' ), $widget_title ) . '</span>';
echo '<span class="screen-reader-text">' . sprintf(
/* translators: meta box title */
__( 'Toggle panel: %s' ),
$widget_title
) . '</span>';
echo '<span class="toggle-indicator" aria-hidden="true"></span>';
echo '</button>';
}
@ -1489,8 +1512,8 @@ function add_settings_section( $id, $title, $callback, $page ) {
_deprecated_argument(
__FUNCTION__,
'3.0.0',
/* translators: %s: misc */
sprintf(
/* translators: %s: misc */
__( 'The "%s" options group has been removed. Use another settings group.' ),
'misc'
)
@ -1502,8 +1525,8 @@ function add_settings_section( $id, $title, $callback, $page ) {
_deprecated_argument(
__FUNCTION__,
'3.5.0',
/* translators: %s: privacy */
sprintf(
/* translators: %s: privacy */
__( 'The "%s" options group has been removed. Use another settings group.' ),
'privacy'
)
@ -1560,8 +1583,8 @@ function add_settings_field( $id, $title, $callback, $page, $section = 'default'
_deprecated_argument(
__FUNCTION__,
'3.0.0',
/* translators: %s: misc */
sprintf(
/* translators: %s: misc */
__( 'The "%s" options group has been removed. Use another settings group.' ),
'misc'
)
@ -1573,8 +1596,8 @@ function add_settings_field( $id, $title, $callback, $page, $section = 'default'
_deprecated_argument(
__FUNCTION__,
'3.5.0',
/* translators: %s: privacy */
sprintf(
/* translators: %s: privacy */
__( 'The "%s" options group has been removed. Use another settings group.' ),
'privacy'
)

View File

@ -76,7 +76,11 @@ function delete_theme( $stylesheet, $redirect = '' ) {
$deleted = $wp_filesystem->delete( $theme_dir, true );
if ( ! $deleted ) {
return new WP_Error( 'could_not_remove_theme', sprintf( __( 'Could not fully remove the theme %s.' ), $stylesheet ) );
return new WP_Error(
'could_not_remove_theme',
/* translators: %s: Theme name */
sprintf( __( 'Could not fully remove the theme %s.' ), $stylesheet )
);
}
$theme_translations = wp_get_installed_translations( 'themes' );
@ -195,8 +199,8 @@ function get_theme_update_available( $theme ) {
if ( ! is_multisite() ) {
if ( ! current_user_can( 'update_themes' ) ) {
/* translators: 1: theme name, 2: theme details URL, 3: additional link attributes, 4: version number */
$html = sprintf(
/* translators: 1: theme name, 2: theme details URL, 3: additional link attributes, 4: version number */
'<p><strong>' . __( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a>.' ) . '</strong></p>',
$theme_name,
esc_url( $details_url ),
@ -208,8 +212,8 @@ function get_theme_update_available( $theme ) {
$update['new_version']
);
} elseif ( empty( $update['package'] ) ) {
/* translators: 1: theme name, 2: theme details URL, 3: additional link attributes, 4: version number */
$html = sprintf(
/* translators: 1: theme name, 2: theme details URL, 3: additional link attributes, 4: version number */
'<p><strong>' . __( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a>. <em>Automatic update is unavailable for this theme.</em>' ) . '</strong></p>',
$theme_name,
esc_url( $details_url ),
@ -221,8 +225,8 @@ function get_theme_update_available( $theme ) {
$update['new_version']
);
} else {
/* translators: 1: theme name, 2: theme details URL, 3: additional link attributes, 4: version number, 5: update URL, 6: additional link attributes */
$html = sprintf(
/* translators: 1: theme name, 2: theme details URL, 3: additional link attributes, 4: version number, 5: update URL, 6: additional link attributes */
'<p><strong>' . __( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a> or <a href="%5$s" %6$s>update now</a>.' ) . '</strong></p>',
$theme_name,
esc_url( $details_url ),
@ -717,8 +721,18 @@ function customize_themes_print_templates() {
<# if ( data.active ) { #>
<span class="current-label"><?php _e( 'Current Theme' ); ?></span>
<# } #>
<h2 class="theme-name">{{{ data.name }}}<span class="theme-version"><?php printf( __( 'Version: %s' ), '{{ data.version }}' ); ?></span></h2>
<h3 class="theme-author"><?php printf( __( 'By %s' ), '{{{ data.authorAndUri }}}' ); ?></h3>
<h2 class="theme-name">{{{ data.name }}}<span class="theme-version">
<?php
/* translators: %s: theme version */
printf( __( 'Version: %s' ), '{{ data.version }}' );
?>
</span></h2>
<h3 class="theme-author">
<?php
/* translators: %s: theme author link */
printf( __( 'By %s' ), '{{{ data.authorAndUri }}}' );
?>
</h3>
<# if ( data.stars && 0 != data.num_ratings ) { #>
<div class="theme-rating">
@ -745,7 +759,15 @@ function customize_themes_print_templates() {
<# } #>
<# if ( data.parent ) { #>
<p class="parent-theme"><?php printf( __( 'This is a child theme of %s.' ), '<strong>{{{ data.parent }}}</strong>' ); ?></p>
<p class="parent-theme">
<?php
printf(
/* translators: %s: theme name */
__( 'This is a child theme of %s.' ),
'<strong>{{{ data.parent }}}</strong>'
);
?>
</p>
<# } #>
<p class="theme-description">{{{ data.description }}}</p>

View File

@ -961,11 +961,40 @@ function update_core( $from, $to ) {
}
if ( ! $mysql_compat && ! $php_compat ) {
return new WP_Error( 'php_mysql_not_compatible', sprintf( __( 'The update cannot be installed because WordPress %1$s requires PHP version %2$s or higher and MySQL version %3$s or higher. You are running PHP version %4$s and MySQL version %5$s.' ), $wp_version, $required_php_version, $required_mysql_version, $php_version, $mysql_version ) . $php_update_message );
return new WP_Error(
'php_mysql_not_compatible',
sprintf(
/* translators: 1: WordPress version number, 2: Minimum required PHP version number, 3: Minimum required MySQL version number, 4: Current PHP version number, 5: Current MySQL version number */
__( 'The update cannot be installed because WordPress %1$s requires PHP version %2$s or higher and MySQL version %3$s or higher. You are running PHP version %4$s and MySQL version %5$s.' ),
$wp_version,
$required_php_version,
$required_mysql_version,
$php_version,
$mysql_version
) . $php_update_message
);
} elseif ( ! $php_compat ) {
return new WP_Error( 'php_not_compatible', sprintf( __( 'The update cannot be installed because WordPress %1$s requires PHP version %2$s or higher. You are running version %3$s.' ), $wp_version, $required_php_version, $php_version ) . $php_update_message );
return new WP_Error(
'php_not_compatible',
sprintf(
/* translators: 1: WordPress version number, 2: Minimum required PHP version number, 3: Current PHP version number */
__( 'The update cannot be installed because WordPress %1$s requires PHP version %2$s or higher. You are running version %3$s.' ),
$wp_version,
$required_php_version,
$php_version
) . $php_update_message
);
} elseif ( ! $mysql_compat ) {
return new WP_Error( 'mysql_not_compatible', sprintf( __( 'The update cannot be installed because WordPress %1$s requires MySQL version %2$s or higher. You are running version %3$s.' ), $wp_version, $required_mysql_version, $mysql_version ) );
return new WP_Error(
'mysql_not_compatible',
sprintf(
/* translators: 1: WordPress version number, 2: Minimum required MySQL version number, 3: Current MySQL version number */
__( 'The update cannot be installed because WordPress %1$s requires MySQL version %2$s or higher. You are running version %3$s.' ),
$wp_version,
$required_mysql_version,
$mysql_version
)
);
}
/** This filter is documented in wp-admin/includes/update-core.php */
@ -1354,8 +1383,22 @@ function _redirect_to_about_wordpress( $new_version ) {
show_message( __( 'WordPress updated successfully' ) );
// self_admin_url() won't exist when upgrading from <= 3.0, so relative URLs are intentional.
show_message( '<span class="hide-if-no-js">' . sprintf( __( 'Welcome to WordPress %1$s. You will be redirected to the About WordPress screen. If not, click <a href="%2$s">here</a>.' ), $new_version, 'about.php?updated' ) . '</span>' );
show_message( '<span class="hide-if-js">' . sprintf( __( 'Welcome to WordPress %1$s. <a href="%2$s">Learn more</a>.' ), $new_version, 'about.php?updated' ) . '</span>' );
show_message(
'<span class="hide-if-no-js">' . sprintf(
/* translators: 1: WordPress version, 2: URL to About screen */
__( 'Welcome to WordPress %1$s. You will be redirected to the About WordPress screen. If not, click <a href="%2$s">here</a>.' ),
$new_version,
'about.php?updated'
) . '</span>'
);
show_message(
'<span class="hide-if-js">' . sprintf(
/* translators: 1: WordPress version, 2: URL to About screen */
__( 'Welcome to WordPress %1$s. <a href="%2$s">Learn more</a>.' ),
$new_version,
'about.php?updated'
) . '</span>'
);
echo '</div>';
?>
<script type="text/javascript">

View File

@ -209,6 +209,7 @@ function find_core_update( $version, $locale ) {
*/
function core_update_footer( $msg = '' ) {
if ( ! current_user_can( 'update_core' ) ) {
/* translators: %s: WordPress version */
return sprintf( __( 'Version %s' ), get_bloginfo( 'version', 'display' ) );
}
@ -231,14 +232,24 @@ function core_update_footer( $msg = '' ) {
switch ( $cur->response ) {
case 'development':
/* translators: 1: WordPress version number, 2: WordPress updates admin screen URL */
return sprintf( __( 'You are using a development version (%1$s). Cool! Please <a href="%2$s">stay updated</a>.' ), get_bloginfo( 'version', 'display' ), network_admin_url( 'update-core.php' ) );
return sprintf(
/* translators: 1: WordPress version number, 2: WordPress updates admin screen URL */
__( 'You are using a development version (%1$s). Cool! Please <a href="%2$s">stay updated</a>.' ),
get_bloginfo( 'version', 'display' ),
network_admin_url( 'update-core.php' )
);
case 'upgrade':
return '<strong><a href="' . network_admin_url( 'update-core.php' ) . '">' . sprintf( __( 'Get Version %s' ), $cur->current ) . '</a></strong>';
return sprintf(
'<strong><a href="%s">%s</a></strong>',
network_admin_url( 'update-core.php' ),
/* translators: %s: WordPress version */
sprintf( __( 'Get Version %s' ), $cur->current )
);
case 'latest':
default:
/* translators: %s: WordPress version */
return sprintf( __( 'Version %s' ), get_bloginfo( 'version', 'display' ) );
}
}
@ -303,7 +314,12 @@ function update_right_now_message() {
$cur = get_preferred_from_update_core();
if ( isset( $cur->response ) && $cur->response == 'upgrade' ) {
$msg .= '<a href="' . network_admin_url( 'update-core.php' ) . '" class="button" aria-describedby="wp-version">' . sprintf( __( 'Update to %s' ), $cur->current ? $cur->current : __( 'Latest' ) ) . '</a> ';
$msg .= sprintf(
'<a href="%s" class="button" aria-describedby="wp-version">%s</a> ',
network_admin_url( 'update-core.php' ),
/* translators: %s: WordPress version number, or 'Latest' string */
sprintf( __( 'Update to %s' ), $cur->current ? $cur->current : __( 'Latest' ) )
);
}
}
@ -406,11 +422,21 @@ function wp_plugin_update_row( $file, $plugin_data ) {
$compatible_php = is_php_version_compatible( $requires_php );
$notice_type = $compatible_php ? 'notice-warning' : 'notice-error';
echo '<tr class="plugin-update-tr' . $active_class . '" id="' . esc_attr( $response->slug . '-update' ) . '" data-slug="' . esc_attr( $response->slug ) . '" data-plugin="' . esc_attr( $file ) . '"><td colspan="' . esc_attr( $wp_list_table->get_column_count() ) . '" class="plugin-update colspanchange"><div class="update-message notice inline ' . $notice_type . ' notice-alt"><p>';
printf(
'<tr class="plugin-update-tr%s" id="%s" data-slug="%s" data-plugin="%s">' .
'<td colspan="%s" class="plugin-update colspanchange">' .
'<div class="update-message notice inline %s notice-alt"><p>',
$active_class,
esc_attr( $response->slug . '-update' ),
esc_attr( $response->slug ),
esc_attr( $file ),
esc_attr( $wp_list_table->get_column_count() ),
$notice_type
);
if ( ! current_user_can( 'update_plugins' ) ) {
/* translators: 1: plugin name, 2: details URL, 3: additional link attributes, 4: version number */
printf(
/* translators: 1: plugin name, 2: details URL, 3: additional link attributes, 4: version number */
__( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a>.' ),
$plugin_name,
esc_url( $details_url ),
@ -422,8 +448,8 @@ function wp_plugin_update_row( $file, $plugin_data ) {
esc_attr( $response->new_version )
);
} elseif ( empty( $response->package ) ) {
/* translators: 1: plugin name, 2: details URL, 3: additional link attributes, 4: version number */
printf(
/* translators: 1: plugin name, 2: details URL, 3: additional link attributes, 4: version number */
__( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a>. <em>Automatic update is unavailable for this plugin.</em>' ),
$plugin_name,
esc_url( $details_url ),
@ -436,8 +462,8 @@ function wp_plugin_update_row( $file, $plugin_data ) {
);
} else {
if ( $compatible_php ) {
/* translators: 1: plugin name, 2: details URL, 3: additional link attributes, 4: version number, 5: update URL, 6: additional link attributes */
printf(
/* translators: 1: plugin name, 2: details URL, 3: additional link attributes, 4: version number, 5: update URL, 6: additional link attributes */
__( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a> or <a href="%5$s" %6$s>update now</a>.' ),
$plugin_name,
esc_url( $details_url ),
@ -455,8 +481,8 @@ function wp_plugin_update_row( $file, $plugin_data ) {
)
);
} else {
/* translators: 1: plugin name, 2: details URL, 3: additional link attributes, 4: version number 5: Update PHP page URL */
printf(
/* translators: 1: plugin name, 2: details URL, 3: additional link attributes, 4: version number 5: Update PHP page URL */
__( 'There is a new version of %1$s available, but it doesn&#8217;t work with your version of PHP. <a href="%2$s" %3$s>View version %4$s details</a> or <a href="%5$s">learn more about updating PHP</a>.' ),
$plugin_name,
esc_url( $details_url ),
@ -580,10 +606,19 @@ function wp_theme_update_row( $theme_key, $theme ) {
$active = $theme->is_allowed( 'network' ) ? ' active' : '';
echo '<tr class="plugin-update-tr' . $active . '" id="' . esc_attr( $theme->get_stylesheet() . '-update' ) . '" data-slug="' . esc_attr( $theme->get_stylesheet() ) . '"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange"><div class="update-message notice inline notice-warning notice-alt"><p>';
printf(
'<tr class="plugin-update-tr%s" id="%s" data-slug="%s">' .
'<td colspan="%s" class="plugin-update colspanchange">' .
'<div class="update-message notice inline notice-warning notice-alt"><p>',
$active,
esc_attr( $theme->get_stylesheet() . '-update' ),
esc_attr( $theme->get_stylesheet() ),
$wp_list_table->get_column_count()
);
if ( ! current_user_can( 'update_themes' ) ) {
/* translators: 1: theme name, 2: details URL, 3: additional link attributes, 4: version number */
printf(
/* translators: 1: theme name, 2: details URL, 3: additional link attributes, 4: version number */
__( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a>.' ),
$theme['Name'],
esc_url( $details_url ),
@ -595,8 +630,8 @@ function wp_theme_update_row( $theme_key, $theme ) {
$response['new_version']
);
} elseif ( empty( $response['package'] ) ) {
/* translators: 1: theme name, 2: details URL, 3: additional link attributes, 4: version number */
printf(
/* translators: 1: theme name, 2: details URL, 3: additional link attributes, 4: version number */
__( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a>. <em>Automatic update is unavailable for this theme.</em>' ),
$theme['Name'],
esc_url( $details_url ),
@ -608,8 +643,8 @@ function wp_theme_update_row( $theme_key, $theme ) {
$response['new_version']
);
} else {
/* translators: 1: theme name, 2: details URL, 3: additional link attributes, 4: version number, 5: update URL, 6: additional link attributes */
printf(
/* translators: 1: theme name, 2: details URL, 3: additional link attributes, 4: version number, 5: update URL, 6: additional link attributes */
__( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a> or <a href="%5$s" %6$s>update now</a>.' ),
$theme['Name'],
esc_url( $details_url ),
@ -682,7 +717,11 @@ function maintenance_nag() {
}
if ( current_user_can( 'update_core' ) ) {
$msg = sprintf( __( 'An automated WordPress update has failed to complete - <a href="%s">please attempt the update again now</a>.' ), 'update-core.php' );
$msg = sprintf(
/* translators: %s: URL to WordPress Updates screen */
__( 'An automated WordPress update has failed to complete - <a href="%s">please attempt the update again now</a>.' ),
'update-core.php'
);
} else {
$msg = __( 'An automated WordPress update has failed to complete! Please notify the site administrator.' );
}

View File

@ -583,8 +583,9 @@ if ( ! function_exists( 'wp_new_blog_notification' ) ) :
$email = $user->user_email;
$name = $user->user_login;
$login_url = wp_login_url();
/* translators: New site notification email. 1: New site URL, 2: User login, 3: User password or password reset link, 4: Login URL */
$message = sprintf(
/* translators: New site notification email. 1: New site URL, 2: User login, 3: User password or password reset link, 4: Login URL */
__(
'Your new WordPress site has been successfully set up at:

View File

@ -563,14 +563,17 @@ function use_ssl_preference( $user ) {
}
/**
* @since MU (3.0.0)
*
* @param string $text
* @return string
*/
function admin_created_user_email( $text ) {
$roles = get_editable_roles();
$role = $roles[ $_REQUEST['role'] ];
/* translators: 1: site name, 2: site URL, 3: role */
return sprintf(
/* translators: 1: site name, 2: site URL, 3: role */
__(
'Hi,
You\'ve been invited to join \'%1$s\' at

View File

@ -244,8 +244,18 @@ function wp_widget_control( $sidebar_args ) {
<div class="widget-top">
<div class="widget-title-action">
<button type="button" class="widget-action hide-if-no-js" aria-expanded="false">
<span class="screen-reader-text edit"><?php printf( __( 'Edit widget: %s' ), $widget_title ); ?></span>
<span class="screen-reader-text add"><?php printf( __( 'Add widget: %s' ), $widget_title ); ?></span>
<span class="screen-reader-text edit">
<?php
/* translators: %s: widget title */
printf( __( 'Edit widget: %s' ), $widget_title );
?>
</span>
<span class="screen-reader-text add">
<?php
/* translators: %s: widget title */
printf( __( 'Add widget: %s' ), $widget_title );
?>
</span>
<span class="toggle-indicator" aria-hidden="true"></span>
</button>
<a class="widget-control-edit hide-if-js" href="<?php echo esc_url( add_query_arg( $query_arg ) ); ?>">

View File

@ -53,7 +53,11 @@ get_current_screen()->add_help_tab(
'id' => 'overview',
'title' => __( 'Overview' ),
'content' =>
'<p>' . sprintf( __( 'You can add links here to be displayed on your site, usually using <a href="%s">Widgets</a>. By default, links to several sites in the WordPress community are included as examples.' ), 'widgets.php' ) . '</p>' .
'<p>' . sprintf(
/* translators: %s: URL to Widgets screen */
__( 'You can add links here to be displayed on your site, usually using <a href="%s">Widgets</a>. By default, links to several sites in the WordPress community are included as examples.' ),
'widgets.php'
) . '</p>' .
'<p>' . __( 'Links may be separated into Link Categories; these are different than the categories used on your posts.' ) . '</p>' .
'<p>' . __( 'You can customize the display of this screen using the Screen Options tab and/or the dropdown filters above the links table.' ) . '</p>',
)
@ -109,6 +113,7 @@ if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {
if ( isset( $_REQUEST['deleted'] ) ) {
echo '<div id="message" class="updated notice is-dismissible"><p>';
$deleted = (int) $_REQUEST['deleted'];
/* translators: %s: number of links */
printf( _n( '%s link deleted.', '%s links deleted.', $deleted ), $deleted );
echo '</p></div>';
$_SERVER['REQUEST_URI'] = remove_query_arg( array( 'deleted' ), $_SERVER['REQUEST_URI'] );

View File

@ -141,7 +141,11 @@ if ( ! defined( 'WP_ALLOW_REPAIR' ) || ! WP_ALLOW_REPAIR ) {
}
if ( $problems ) {
printf( '<p>' . __( 'Some database problems could not be repaired. Please copy-and-paste the following list of errors to the <a href="%s">WordPress support forums</a> to get additional assistance.' ) . '</p>', __( 'https://wordpress.org/support/forum/how-to-and-troubleshooting' ) );
printf(
/* translators: %s: URL to "Fixing WordPress" forum */
'<p>' . __( 'Some database problems could not be repaired. Please copy-and-paste the following list of errors to the <a href="%s">WordPress support forums</a> to get additional assistance.' ) . '</p>',
__( 'https://wordpress.org/support/forum/how-to-and-troubleshooting' )
);
$problem_output = '';
foreach ( $problems as $table => $problem ) {
$problem_output .= "$table: $problem\n";

View File

@ -42,8 +42,19 @@ if ( ! is_multisite() ) {
} else {
$cap = 'update_languages';
}
/* translators: %s: number of pending updates */
$submenu['index.php'][10] = array( sprintf( __( 'Updates %s' ), "<span class='update-plugins count-{$update_data['counts']['total']}'><span class='update-count'>" . number_format_i18n( $update_data['counts']['total'] ) . '</span></span>' ), $cap, 'update-core.php' );
$submenu['index.php'][10] = array(
sprintf(
/* translators: %s: number of pending updates */
__( 'Updates %s' ),
sprintf(
'<span class="update-plugins count-%s"><span class="update-count">%s</span></span>',
$update_data['counts']['total'],
number_format_i18n( $update_data['counts']['total'] )
)
),
$cap,
'update-core.php',
);
unset( $cap );
}
@ -78,11 +89,11 @@ if ( current_user_can( 'edit_posts' ) ) {
$awaiting_mod = wp_count_comments();
$awaiting_mod = $awaiting_mod->moderated;
$awaiting_mod_i18n = number_format_i18n( $awaiting_mod );
/* translators: %s: number of comments in moderation */
/* translators: %s: number of comments */
$awaiting_mod_text = sprintf( _n( '%s Comment in moderation', '%s Comments in moderation', $awaiting_mod ), $awaiting_mod_i18n );
$menu[25] = array(
/* translators: %s: number of comments in moderation */
/* translators: %s: number of comments */
sprintf( __( 'Comments %s' ), '<span class="awaiting-mod count-' . absint( $awaiting_mod ) . '"><span class="pending-count" aria-hidden="true">' . $awaiting_mod_i18n . '</span><span class="comments-in-moderation-text screen-reader-text">' . $awaiting_mod_text . '</span></span>' ),
'edit_posts',
'edit-comments.php',
@ -217,7 +228,11 @@ if ( ! is_multisite() && current_user_can( 'update_plugins' ) ) {
if ( ! isset( $update_data ) ) {
$update_data = wp_get_update_data();
}
$count = "<span class='update-plugins count-{$update_data['counts']['plugins']}'><span class='plugin-count'>" . number_format_i18n( $update_data['counts']['plugins'] ) . '</span></span>';
$count = sprintf(
'<span class="update-plugins count-%s"><span class="plugin-count">%s</span></span>',
$update_data['counts']['plugins'],
number_format_i18n( $update_data['counts']['plugins'] )
);
}
/* translators: %s: number of pending plugin updates */

View File

@ -20,7 +20,13 @@ if ( ! current_user_can( 'delete_site' ) ) {
if ( isset( $_GET['h'] ) && $_GET['h'] != '' && get_option( 'delete_blog_hash' ) != false ) {
if ( hash_equals( get_option( 'delete_blog_hash' ), $_GET['h'] ) ) {
wpmu_delete_blog( get_current_blog_id() );
wp_die( sprintf( __( 'Thank you for using %s, your site has been deleted. Happy trails to you until we meet again.' ), get_network()->site_name ) );
wp_die(
sprintf(
/* translators: %s: Network name */
__( 'Thank you for using %s, your site has been deleted. Happy trails to you until we meet again.' ),
get_network()->site_name
)
);
} else {
wp_die( __( 'Sorry, the link you clicked is stale. Please select another option.' ) );
}
@ -98,7 +104,15 @@ Webmaster
<?php
} else {
?>
<p><?php printf( __( 'If you do not want to use your %s site any more, you can delete it using the form below. When you click <strong>Delete My Site Permanently</strong> you will be sent an email with a link in it. Click on this link to delete your site.' ), get_network()->site_name ); ?></p>
<p>
<?php
printf(
/* translators: %s: Network name */
__( 'If you do not want to use your %s site any more, you can delete it using the form below. When you click <strong>Delete My Site Permanently</strong> you will be sent an email with a link in it. Click on this link to delete your site.' ),
get_network()->site_name
);
?>
</p>
<p><?php _e( 'Remember, once deleted your site cannot be restored.' ); ?></p>
<form method="post" name="deletedirect">

View File

@ -529,13 +529,22 @@ wp_nav_menu_setup();
wp_initial_nav_menu_meta_boxes();
if ( ! current_theme_supports( 'menus' ) && ! $num_locations ) {
$messages[] = '<div id="message" class="updated"><p>' . sprintf( __( 'Your theme does not natively support menus, but you can use them in sidebars by adding a &#8220;Navigation Menu&#8221; widget on the <a href="%s">Widgets</a> screen.' ), admin_url( 'widgets.php' ) ) . '</p></div>';
$messages[] = '<div id="message" class="updated"><p>' . sprintf(
/* translators: URL to Widgets screen */
__( 'Your theme does not natively support menus, but you can use them in sidebars by adding a &#8220;Navigation Menu&#8221; widget on the <a href="%s">Widgets</a> screen.' ),
admin_url( 'widgets.php' )
) . '</p></div>';
}
if ( ! $locations_screen ) : // Main tab
$overview = '<p>' . __( 'This screen is used for managing your navigation menus.' ) . '</p>';
/* translators: 1: Widgets admin screen URL, 2 and 3: The name of the default themes */
$overview .= '<p>' . sprintf( __( 'Menus can be displayed in locations defined by your theme, even used in sidebars by adding a &#8220;Navigation Menu&#8221; widget on the <a href="%1$s">Widgets</a> screen. If your theme does not support the navigation menus feature (the default themes, %2$s and %3$s, do), you can learn about adding this support by following the Documentation link to the side.' ), admin_url( 'widgets.php' ), 'Twenty Seventeen', 'Twenty Nineteen' ) . '</p>';
$overview = '<p>' . __( 'This screen is used for managing your navigation menus.' ) . '</p>';
$overview .= '<p>' . sprintf(
/* translators: 1: Widgets admin screen URL, 2 and 3: The names of the default themes */
__( 'Menus can be displayed in locations defined by your theme, even used in sidebars by adding a &#8220;Navigation Menu&#8221; widget on the <a href="%1$s">Widgets</a> screen. If your theme does not support the navigation menus feature (the default themes, %2$s and %3$s, do), you can learn about adding this support by following the Documentation link to the side.' ),
admin_url( 'widgets.php' ),
'Twenty Seventeen',
'Twenty Nineteen'
) . '</p>';
$overview .= '<p>' . __( 'From this screen you can:' ) . '</p>';
$overview .= '<ul><li>' . __( 'Create, edit, and delete menus' ) . '</li>';
$overview .= '<li>' . __( 'Add, organize, and modify individual menu items' ) . '</li></ul>';
@ -655,7 +664,15 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
if ( 1 == $num_locations ) {
echo '<p>' . __( 'Your theme supports one menu. Select which menu you would like to use.' ) . '</p>';
} else {
echo '<p>' . sprintf( _n( 'Your theme supports %s menu. Select which menu appears in each location.', 'Your theme supports %s menus. Select which menu appears in each location.', $num_locations ), number_format_i18n( $num_locations ) ) . '</p>';
echo '<p>' . sprintf(
/* translators: %s: number of menus */
_n(
'Your theme supports %s menu. Select which menu appears in each location.',
'Your theme supports %s menus. Select which menu appears in each location.',
$num_locations
),
number_format_i18n( $num_locations )
) . '</p>';
}
?>
<div id="menu-locations-wrap">
@ -755,6 +772,7 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
<span class="add-edit-menu-action">
<?php
printf(
/* translators: %s: URL to create a new menu */
__( 'Edit your menu below, or <a href="%s">create a new menu</a>. Don&#8217;t forget to save your changes!' ),
esc_url(
add_query_arg(
@ -816,6 +834,7 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
<span class="add-new-menu-action">
<?php
printf(
/* translators: %s: URL to create a new menu */
__( 'or <a href="%s">create a new menu</a>. Don&#8217;t forget to save your changes!' ),
esc_url(
add_query_arg(

View File

@ -40,7 +40,7 @@ foreach ( $wpdb->tables( 'ms_global' ) as $table => $prefixed_table ) {
if ( ! network_domain_check() && ( ! defined( 'WP_ALLOW_MULTISITE' ) || ! WP_ALLOW_MULTISITE ) ) {
wp_die(
printf(
/* translators: 1: WP_ALLOW_MULTISITE 2: wp-config.php */
/* translators: 1: WP_ALLOW_MULTISITE, 2: wp-config.php */
__( 'You must define the %1$s constant as true in your %2$s file to allow creation of a Network.' ),
'<code>WP_ALLOW_MULTISITE</code>',
'<code>wp-config.php</code>'

View File

@ -24,7 +24,19 @@ if ( current_user_can( 'update_core' ) ) {
$update_data = wp_get_update_data();
if ( $update_data['counts']['total'] ) {
$submenu['index.php'][10] = array( sprintf( __( 'Updates %s' ), "<span class='update-plugins count-{$update_data['counts']['total']}'><span class='update-count'>" . number_format_i18n( $update_data['counts']['total'] ) . '</span></span>' ), $cap, 'update-core.php' );
$submenu['index.php'][10] = array(
sprintf(
/* translators: %s: number of available updates */
__( 'Updates %s' ),
sprintf(
'<span class="update-plugins count-%s"><span class="update-count">%s</span></span>',
$update_data['counts']['total'],
number_format_i18n( $update_data['counts']['total'] )
)
),
$cap,
'update-core.php',
);
} else {
$submenu['index.php'][10] = array( __( 'Updates' ), $cap, 'update-core.php' );
}
@ -45,7 +57,23 @@ $submenu['users.php'][5] = array( __( 'All Users' ), 'manage_network_users', 'u
$submenu['users.php'][10] = array( _x( 'Add New', 'user' ), 'create_users', 'user-new.php' );
if ( current_user_can( 'update_themes' ) && $update_data['counts']['themes'] ) {
$menu[15] = array( sprintf( __( 'Themes %s' ), "<span class='update-plugins count-{$update_data['counts']['themes']}'><span class='theme-count'>" . number_format_i18n( $update_data['counts']['themes'] ) . '</span></span>' ), 'manage_network_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'dashicons-admin-appearance' );
$menu[15] = array(
sprintf(
/* translators: %s: number of available theme updates */
__( 'Themes %s' ),
sprintf(
'<span class="update-plugins count-%s"><span class="theme-count">%s</span></span>',
$update_data['counts']['themes'],
number_format_i18n( $update_data['counts']['themes'] )
)
),
'manage_network_themes',
'themes.php',
'',
'menu-top menu-icon-appearance',
'menu-appearance',
'dashicons-admin-appearance',
);
} else {
$menu[15] = array( __( 'Themes' ), 'manage_network_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'dashicons-admin-appearance' );
}
@ -54,7 +82,23 @@ $submenu['themes.php'][10] = array( _x( 'Add New', 'theme' ), 'install_themes',
$submenu['themes.php'][15] = array( __( 'Theme Editor' ), 'edit_themes', 'theme-editor.php' );
if ( current_user_can( 'update_plugins' ) && $update_data['counts']['plugins'] ) {
$menu[20] = array( sprintf( __( 'Plugins %s' ), "<span class='update-plugins count-{$update_data['counts']['plugins']}'><span class='plugin-count'>" . number_format_i18n( $update_data['counts']['plugins'] ) . '</span></span>' ), 'manage_network_plugins', 'plugins.php', '', 'menu-top menu-icon-plugins', 'menu-plugins', 'dashicons-admin-plugins' );
$menu[20] = array(
sprintf(
/* translators: %s: number of available plugin updates */
__( 'Plugins %s' ),
sprintf(
'<span class="update-plugins count-%s"><span class="plugin-count">%s</span></span>',
$update_data['counts']['plugins'],
number_format_i18n( $update_data['counts']['plugins'] )
)
),
'manage_network_plugins',
'plugins.php',
'',
'menu-top menu-icon-plugins',
'menu-plugins',
'dashicons-admin-plugins',
);
} else {
$menu[20] = array( __( 'Plugins' ), 'manage_network_plugins', 'plugins.php', '', 'menu-top menu-icon-plugins', 'menu-plugins', 'dashicons-admin-plugins' );
}

View File

@ -207,8 +207,8 @@ if ( isset( $_GET['updated'] ) ) {
<?php
if ( is_subdomain_install() ) {
echo '<p class="description">';
/* translators: 1: NOBLOGREDIRECT, 2: wp-config.php */
printf(
/* translators: 1: NOBLOGREDIRECT, 2: wp-config.php */
__( 'If registration is disabled, please set %1$s in %2$s to a URL you will redirect visitors to if they visit a non-existent site.' ),
'<code>NOBLOGREDIRECT</code>',
'<code>wp-config.php</code>'
@ -362,7 +362,15 @@ if ( isset( $_GET['updated'] ) ) {
<tr>
<th scope="row"><?php _e( 'Site upload space' ); ?></th>
<td>
<label><input type="checkbox" id="upload_space_check_disabled" name="upload_space_check_disabled" value="0"<?php checked( (bool) get_site_option( 'upload_space_check_disabled' ), false ); ?>/> <?php printf( __( 'Limit total size of files uploaded to %s MB' ), '</label><label><input name="blog_upload_space" type="number" min="0" style="width: 100px" id="blog_upload_space" aria-describedby="blog-upload-space-desc" value="' . esc_attr( get_site_option( 'blog_upload_space', 100 ) ) . '" />' ); ?></label><br />
<label><input type="checkbox" id="upload_space_check_disabled" name="upload_space_check_disabled" value="0"<?php checked( (bool) get_site_option( 'upload_space_check_disabled' ), false ); ?>/>
<?php
printf(
/* translators: %s: number of megabytes to limit uploads to */
__( 'Limit total size of files uploaded to %s MB' ),
'</label><label><input name="blog_upload_space" type="number" min="0" style="width: 100px" id="blog_upload_space" aria-describedby="blog-upload-space-desc" value="' . esc_attr( get_site_option( 'blog_upload_space', 100 ) ) . '" />'
);
?>
</label><br />
<p class="screen-reader-text" id="blog-upload-space-desc">
<?php _e( 'Size in megabytes' ); ?>
</p>

View File

@ -54,8 +54,8 @@ if ( isset( $_REQUEST['action'] ) && 'add-site' == $_REQUEST['action'] ) {
if ( in_array( $domain, $subdirectory_reserved_names ) ) {
wp_die(
/* translators: %s: reserved names list */
sprintf(
/* translators: %s: reserved names list */
__( 'The following words are reserved for use by WordPress functions and cannot be used as blog names: %s' ),
'<code>' . implode( '</code>, <code>', $subdirectory_reserved_names ) . '</code>'
)
@ -147,12 +147,12 @@ if ( isset( $_REQUEST['action'] ) && 'add-site' == $_REQUEST['action'] ) {
wp_mail(
get_site_option( 'admin_email' ),
sprintf(
/* translators: %s: network name */
/* translators: New site notification email subject. %s: Network name */
__( '[%s] New Site Created' ),
get_network()->site_name
),
sprintf(
/* translators: 1: user login, 2: site url, 3: site name/title */
/* translators: New site notification email. 1: User login, 2: Site URL, 3: Site title */
__(
'New site created by %1$s

View File

@ -191,6 +191,7 @@ if ( isset( $_GET['enabled'] ) ) {
if ( 1 == $enabled ) {
$message = __( 'Theme enabled.' );
} else {
/* translators: %s: number of themes */
$message = _n( '%s theme enabled.', '%s themes enabled.', $enabled );
}
echo '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $enabled ) ) . '</p></div>';
@ -199,6 +200,7 @@ if ( isset( $_GET['enabled'] ) ) {
if ( 1 == $disabled ) {
$message = __( 'Theme disabled.' );
} else {
/* translators: %s: number of themes */
$message = _n( '%s theme disabled.', '%s themes disabled.', $disabled );
}
echo '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $disabled ) ) . '</p></div>';

View File

@ -61,14 +61,23 @@ if ( isset( $_GET['action'] ) ) {
// A list of valid actions and their associated messaging for confirmation output.
$manage_actions = array(
/* translators: %s: Site URL */
'activateblog' => __( 'You are about to activate the site %s.' ),
/* translators: %s: Site URL */
'deactivateblog' => __( 'You are about to deactivate the site %s.' ),
/* translators: %s: Site URL */
'unarchiveblog' => __( 'You are about to unarchive the site %s.' ),
/* translators: %s: Site URL */
'archiveblog' => __( 'You are about to archive the site %s.' ),
/* translators: %s: Site URL */
'unspamblog' => __( 'You are about to unspam the site %s.' ),
/* translators: %s: Site URL */
'spamblog' => __( 'You are about to mark the site %s as spam.' ),
/* translators: %s: Site URL */
'deleteblog' => __( 'You are about to delete the site %s.' ),
/* translators: %s: Site URL */
'unmatureblog' => __( 'You are about to mark the site %s as mature.' ),
/* translators: %s: Site URL */
'matureblog' => __( 'You are about to mark the site %s as not mature.' ),
);
@ -152,7 +161,14 @@ if ( isset( $_GET['action'] ) ) {
$site = get_site( $site_id );
$site_address = untrailingslashit( $site->domain . $site->path );
wp_die( sprintf( __( 'Sorry, you are not allowed to delete the site %s.' ), $site_address ), 403 );
wp_die(
sprintf(
/* translators: %s: Site URL */
__( 'Sorry, you are not allowed to delete the site %s.' ),
$site_address
),
403
);
}
$updated_action = 'all_delete';

View File

@ -287,6 +287,7 @@ if ( isset( $_GET['enabled'] ) ) {
if ( 1 == $enabled ) {
$message = __( 'Theme enabled.' );
} else {
/* translators: %s: number of themes */
$message = _n( '%s theme enabled.', '%s themes enabled.', $enabled );
}
echo '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $enabled ) ) . '</p></div>';
@ -295,6 +296,7 @@ if ( isset( $_GET['enabled'] ) ) {
if ( 1 == $disabled ) {
$message = __( 'Theme disabled.' );
} else {
/* translators: %s: number of themes */
$message = _n( '%s theme disabled.', '%s themes disabled.', $disabled );
}
echo '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $disabled ) ) . '</p></div>';
@ -303,6 +305,7 @@ if ( isset( $_GET['enabled'] ) ) {
if ( 1 == $deleted ) {
$message = __( 'Theme deleted.' );
} else {
/* translators: %s: number of themes */
$message = _n( '%s theme deleted.', '%s themes deleted.', $deleted );
}
echo '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $deleted ) ) . '</p></div>';

View File

@ -89,11 +89,7 @@ if ( isset( $_GET['update'] ) ) {
$message = __( 'User added.' );
if ( $edit_link ) {
$message .= sprintf(
' <a href="%s">%s</a>',
$edit_link,
__( 'Edit user' )
);
$message .= sprintf( ' <a href="%s">%s</a>', $edit_link, __( 'Edit user' ) );
}
$messages[] = $message;

View File

@ -71,7 +71,13 @@ if ( isset( $_GET['action'] ) ) {
case 'spam':
$user = get_userdata( $user_id );
if ( is_super_admin( $user->ID ) ) {
wp_die( sprintf( __( 'Warning! User cannot be modified. The user %s is a network administrator.' ), esc_html( $user->user_login ) ) );
wp_die(
sprintf(
/* translators: %s: user login */
__( 'Warning! User cannot be modified. The user %s is a network administrator.' ),
esc_html( $user->user_login )
)
);
}
$userfunction = 'all_spam';

View File

@ -79,6 +79,7 @@ if ( ! get_option( 'users_can_register' ) && is_multisite() ) {
<input name="close_comments_for_old_posts" type="checkbox" id="close_comments_for_old_posts" value="1" <?php checked( '1', get_option( 'close_comments_for_old_posts' ) ); ?> />
<?php
printf(
/* translators: %s: number of days */
__( 'Automatically close comments on posts older than %s days' ),
'</label> <label for="close_comments_days_old"><input name="close_comments_days_old" type="number" min="0" step="1" id="close_comments_days_old" value="' . esc_attr( get_option( 'close_comments_days_old' ) ) . '" class="small-text" />'
);
@ -114,6 +115,7 @@ for ( $i = 2; $i <= $maxdeep; $i++ ) {
}
$thread_comments_depth .= '</select>';
/* translators: %s: number of levels */
printf( __( 'Enable threaded (nested) comments %s levels deep' ), $thread_comments_depth );
?>
@ -153,6 +155,7 @@ if ( 'desc' == get_option( 'comment_order' ) ) {
}
$comment_order .= '>' . __( 'newer' ) . '</option></select>';
/* translators: %s: Form field control for 'older' or 'newer' comments */
printf( __( 'Comments should be displayed with the %s comments at the top of each page' ), $comment_order );
?>
@ -184,7 +187,15 @@ printf( __( 'Comments should be displayed with the %s comments at the top of eac
<tr>
<th scope="row"><?php _e( 'Comment Moderation' ); ?></th>
<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Comment Moderation' ); ?></span></legend>
<p><label for="comment_max_links"><?php printf( __( 'Hold a comment in the queue if it contains %s or more links. (A common characteristic of comment spam is a large number of hyperlinks.)' ), '<input name="comment_max_links" type="number" step="1" min="0" id="comment_max_links" value="' . esc_attr( get_option( 'comment_max_links' ) ) . '" class="small-text" />' ); ?></label></p>
<p><label for="comment_max_links">
<?php
printf(
/* translators: %s: number of links */
__( 'Hold a comment in the queue if it contains %s or more links. (A common characteristic of comment spam is a large number of hyperlinks.)' ),
'<input name="comment_max_links" type="number" step="1" min="0" id="comment_max_links" value="' . esc_attr( get_option( 'comment_max_links' ) ) . '" class="small-text" />'
);
?>
</label></p>
<p><label for="moderation_keys"><?php _e( 'When a comment contains any of these words in its content, name, URL, email, or IP address, it will be held in the <a href="edit-comments.php?comment_status=moderated">moderation queue</a>. One word or IP address per line. It will match inside words, so &#8220;press&#8221; will match &#8220;WordPress&#8221;.' ); ?></label></p>
<p>

View File

@ -184,7 +184,12 @@ if ( ! empty( $languages ) || ! empty( $translations ) ) {
// Add note about deprecated WPLANG constant.
if ( defined( 'WPLANG' ) && ( '' !== WPLANG ) && $locale !== WPLANG ) {
_deprecated_argument( 'define()', '4.0.0', sprintf( __( 'The %1$s constant in your %2$s file is no longer needed.' ), 'WPLANG', 'wp-config.php' ) );
_deprecated_argument(
'define()',
'4.0.0',
/* translators: 1: WPLANG, 2: wp-config.php */
sprintf( __( 'The %1$s constant in your %2$s file is no longer needed.' ), 'WPLANG', 'wp-config.php' )
);
}
?>
</td>
@ -228,8 +233,8 @@ if ( empty( $tzstring ) ) { // Create a UTC+- zone if no timezone string exists
<p class="timezone-info">
<span id="utc-time">
<?php
/* translators: 1: UTC abbreviation, 2: UTC time */
printf(
/* translators: 1: UTC abbreviation, 2: UTC time */
__( 'Universal time (%1$s) is %2$s.' ),
'<abbr>' . __( 'UTC' ) . '</abbr>',
'<code>' . date_i18n( $timezone_format, false, true ) . '</code>'
@ -239,8 +244,8 @@ if ( empty( $tzstring ) ) { // Create a UTC+- zone if no timezone string exists
<?php if ( get_option( 'timezone_string' ) || ! empty( $current_offset ) ) : ?>
<span id="local-time">
<?php
/* translators: %s: local time */
printf(
/* translators: %s: local time */
__( 'Local time is %s.' ),
'<code>' . date_i18n( $timezone_format ) . '</code>'
);

View File

@ -31,8 +31,17 @@ get_current_screen()->add_help_tab(
'id' => 'permalink-settings',
'title' => __( 'Permalink Settings' ),
'content' => '<p>' . __( 'Permalinks can contain useful information, such as the post date, title, or other elements. You can choose from any of the suggested permalink formats, or you can craft your own if you select Custom Structure.' ) . '</p>' .
'<p>' . __( 'If you pick an option other than Plain, your general URL path with structure tags (terms surrounded by <code>%</code>) will also appear in the custom structure field and your path can be further modified there.' ) . '</p>' .
'<p>' . __( 'When you assign multiple categories or tags to a post, only one can show up in the permalink: the lowest numbered category. This applies if your custom structure includes <code>%category%</code> or <code>%tag%</code>.' ) . '</p>' .
'<p>' . sprintf(
/* translators: '%' character */
__( 'If you pick an option other than Plain, your general URL path with structure tags (terms surrounded by %s) will also appear in the custom structure field and your path can be further modified there.' ),
'<code>%</code>'
) . '</p>' .
'<p>' . sprintf(
/* translators: 1: %category%, 2: %tag% */
__( 'When you assign multiple categories or tags to a post, only one can show up in the permalink: the lowest numbered category. This applies if your custom structure includes %1$s or %2$s.' ),
'<code>%category%</code>',
'<code>%tag%</code>'
) . '</p>' .
'<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>',
)
);

View File

@ -24,7 +24,7 @@ get_current_screen()->add_help_tab(
'title' => __( 'Overview' ),
'content' => '<p>' . __( 'This screen contains the settings that affect the display of your content.' ) . '</p>' .
'<p>' . sprintf(
/* translators: %s: URL to Pages screen */
/* translators: %s: URL to create a new page */
__( 'You can choose what&#8217;s displayed on the homepage of your site. It can be posts in reverse chronological order (classic blog), or a fixed/static page. To set a static homepage, you first need to create two <a href="%s">Pages</a>. One will become the homepage, and the other will be where your posts are displayed.' ),
'post-new.php?post_type=page'
) . '</p>' .
@ -91,13 +91,20 @@ else :
</p>
<p><label>
<input name="show_on_front" type="radio" value="page" class="tog" <?php checked( 'page', get_option( 'show_on_front' ) ); ?> />
<?php printf( __( 'A <a href="%s">static page</a> (select below)' ), 'edit.php?post_type=page' ); ?>
<?php
printf(
/* translators: %s: URL to Pages screen */
__( 'A <a href="%s">static page</a> (select below)' ),
'edit.php?post_type=page'
);
?>
</label>
</p>
<ul>
<li><label for="page_on_front">
<?php
printf(
/* translators: %s: select field to choose the front page */
__( 'Homepage: %s' ),
wp_dropdown_pages(
array(
@ -114,6 +121,7 @@ else :
<li><label for="page_for_posts">
<?php
printf(
/* translators: %s: select field to choose the page for posts */
__( 'Posts page: %s' ),
wp_dropdown_pages(
array(

View File

@ -83,7 +83,11 @@ get_current_screen()->add_help_tab(
'id' => 'overview',
'title' => __( 'Overview' ),
'content' =>
'<p>' . sprintf( __( 'Plugins hook into WordPress to extend its functionality with custom features. Plugins are developed independently from the core WordPress application by thousands of developers all over the world. All plugins in the official <a href="%s">WordPress Plugin Directory</a> are compatible with the license WordPress uses.' ), __( 'https://wordpress.org/plugins/' ) ) . '</p>' .
'<p>' . sprintf(
/* translators: %s: https://wordpress.org/plugins/ */
__( 'Plugins hook into WordPress to extend its functionality with custom features. Plugins are developed independently from the core WordPress application by thousands of developers all over the world. All plugins in the official <a href="%s">WordPress Plugin Directory</a> are compatible with the license WordPress uses.' ),
__( 'https://wordpress.org/plugins/' )
) . '</p>' .
'<p>' . __( 'You can find new plugins to install by searching or browsing the directory right here in your own Plugins section.' ) . ' <span id="live-search-desc" class="hide-if-no-js">' . __( 'The search results will be updated as you type.' ) . '</span></p>',
)

View File

@ -501,7 +501,8 @@ if ( isset( $_GET['error'] ) ) :
if ( isset( $_GET['main'] ) ) {
$errmsg = __( 'You cannot delete a plugin while it is active on the main site.' );
} elseif ( isset( $_GET['charsout'] ) ) {
$errmsg = sprintf(
$errmsg = sprintf(
/* translators: %d: number of characters */
_n(
'The plugin generated %d character of <strong>unexpected output</strong> during activation.',
'The plugin generated %d characters of <strong>unexpected output</strong> during activation.',
@ -541,7 +542,17 @@ elseif ( isset( $_GET['deleted'] ) ) :
if ( is_wp_error( $delete_result ) ) :
?>
<div id="message" class="error notice is-dismissible"><p><?php printf( __( 'Plugin could not be deleted due to an error: %s' ), $delete_result->get_error_message() ); ?></p></div>
<div id="message" class="error notice is-dismissible">
<p>
<?php
printf(
/* translators: %s: error message */
__( 'Plugin could not be deleted due to an error: %s' ),
$delete_result->get_error_message()
);
?>
</p>
</div>
<?php else : ?>
<div id="message" class="updated notice is-dismissible">
<p>

View File

@ -245,6 +245,7 @@ switch ( $action ) {
$user_id = wp_check_post_lock( $post_id );
if ( $user_id ) {
$user = get_userdata( $user_id );
/* translators: %s: user's display name */
wp_die( sprintf( __( 'You cannot move this item to the Trash. %s is currently editing.' ), $user->display_name ) );
}

View File

@ -169,16 +169,16 @@ switch ( $step ) {
</ol>
<p>
<?php
/* translators: %s: wp-config.php */
printf(
/* translators: %s: wp-config.php */
__( 'We&#8217;re going to use this information to create a %s file.' ),
'<code>wp-config.php</code>'
);
?>
<strong>
<?php
/* translators: 1: wp-config-sample.php, 2: wp-config.php */
printf(
/* translators: 1: wp-config-sample.php, 2: wp-config.php */
__( 'If for any reason this automatic file creation doesn&#8217;t work, don&#8217;t worry. All this does is fill in the database information to a configuration file. You may also simply open %1$s in a text editor, fill in your information, and save it as %2$s.' ),
'<code>wp-config-sample.php</code>',
'<code>wp-config.php</code>'
@ -186,8 +186,8 @@ switch ( $step ) {
?>
</strong>
<?php
/* translators: %s: Documentation URL */
printf(
/* translators: %s: Documentation URL */
__( 'Need more help? <a href="%s">We got it</a>.' ),
__( 'https://wordpress.org/support/article/editing-wp-config-php/' )
);

View File

@ -251,8 +251,8 @@ if ( $theme->errors() ) {
<?php if ( ( $has_templates || $theme->parent() ) && $theme->parent() ) : ?>
<li class="howto">
<?php
/* translators: %s: link to edit parent theme */
echo sprintf(
printf(
/* translators: %s: link to edit parent theme */
__( 'This child theme inherits templates from a parent theme, %s.' ),
sprintf(
'<a href="%s">%s</a>',

View File

@ -63,6 +63,7 @@ wp_localize_script(
__( 'https://wordpress.org/support/forums/' )
),
'tryAgain' => __( 'Try Again' ),
/* translators: %d: number of themes */
'themesFound' => __( 'Number of Themes found: %d' ),
'noThemesFound' => __( 'No themes found. Try a different search.' ),
'collapseSidebar' => __( 'Collapse Sidebar' ),
@ -93,14 +94,14 @@ if ( $tab ) {
$help_overview =
'<p>' . sprintf(
/* translators: %s: Theme Directory URL */
__( 'You can find additional themes for your site by using the Theme Browser/Installer on this screen, which will display themes from the <a href="%s">WordPress Theme Directory</a>. These themes are designed and developed by third parties, are available free of charge, and are compatible with the license WordPress uses.' ),
__( 'You can find additional themes for your site by using the Theme Browser/Installer on this screen, which will display themes from the <a href="%s">WordPress Theme Directory</a>. These themes are designed and developed by third parties, are available free of charge, and are compatible with the license WordPress uses.' ),
__( 'https://wordpress.org/themes/' )
) . '</p>' .
'<p>' . __( 'You can Search for themes by keyword, author, or tag, or can get more specific and search by criteria listed in the feature filter.' ) . ' <span id="live-search-desc">' . __( 'The search results will be updated as you type.' ) . '</span></p>' .
'<p>' . __( 'Alternately, you can browse the themes that are Featured, Popular, or Latest. When you find a theme you like, you can preview it or install it.' ) . '</p>' .
'<p>' . sprintf(
/* translators: %s: /wp-content/themes */
__( 'You can Upload a theme manually if you have already downloaded its ZIP archive onto your computer (make sure it is from a trusted and original source). You can also do it the old-fashioned way and copy a downloaded theme&#8217;s folder via FTP into your %s directory.' ),
__( 'You can Upload a theme manually if you have already downloaded its ZIP archive onto your computer (make sure it is from a trusted and original source). You can also do it the old-fashioned way and copy a downloaded theme&#8217;s folder via FTP into your %s directory.' ),
'<code>/wp-content/themes</code>'
) . '</p>';

View File

@ -111,7 +111,11 @@ if ( current_user_can( 'install_themes' ) ) {
if ( is_multisite() ) {
$help_install = '<p>' . __( 'Installing themes on Multisite can only be done from the Network Admin section.' ) . '</p>';
} else {
$help_install = '<p>' . sprintf( __( 'If you would like to see more themes to choose from, click on the &#8220;Add New&#8221; button and you will be able to browse or search for additional themes from the <a href="%s">WordPress Theme Directory</a>. Themes in the WordPress Theme Directory are designed and developed by third parties, and are compatible with the license WordPress uses. Oh, and they&#8217;re free!' ), __( 'https://wordpress.org/themes/' ) ) . '</p>';
$help_install = '<p>' . sprintf(
/* translators: %s: https://wordpress.org/themes/ */
__( 'If you would like to see more themes to choose from, click on the &#8220;Add New&#8221; button and you will be able to browse or search for additional themes from the <a href="%s">WordPress Theme Directory</a>. Themes in the WordPress Theme Directory are designed and developed by third parties, and are compatible with the license WordPress uses. Oh, and they&#8217;re free!' ),
__( 'https://wordpress.org/themes/' )
) . '</p>';
}
get_current_screen()->add_help_tab(
@ -167,6 +171,7 @@ wp_localize_script(
'addNew' => __( 'Add New Theme' ),
'search' => __( 'Search Installed Themes' ),
'searchPlaceholder' => __( 'Search installed themes...' ), // placeholder (no ellipsis)
/* translators: %d: number of themes */
'themesFound' => __( 'Number of Themes found: %d' ),
'noThemesFound' => __( 'No themes found. Try a different search.' ),
),
@ -327,13 +332,18 @@ foreach ( $themes as $theme ) :
<?php endif; ?>
<span class="more-details" id="<?php echo $aria_action; ?>"><?php _e( 'Theme Details' ); ?></span>
<div class="theme-author"><?php printf( __( 'By %s' ), $theme['author'] ); ?></div>
<div class="theme-author">
<?php
/* translators: %s: Theme author name */
printf( __( 'By %s' ), $theme['author'] );
?>
</div>
<div class="theme-id-container">
<?php if ( $theme['active'] ) { ?>
<h2 class="theme-name" id="<?php echo $aria_name; ?>">
<?php
/* translators: %s: theme name */
/* translators: %s: Theme name */
printf( __( '<span>Active:</span> %s' ), $theme['name'] );
?>
</h2>
@ -546,8 +556,18 @@ if ( ! is_multisite() && current_user_can( 'edit_themes' ) && $broken_themes ) {
<# if ( data.active ) { #>
<span class="current-label"><?php _e( 'Current Theme' ); ?></span>
<# } #>
<h2 class="theme-name">{{{ data.name }}}<span class="theme-version"><?php printf( __( 'Version: %s' ), '{{ data.version }}' ); ?></span></h2>
<p class="theme-author"><?php printf( __( 'By %s' ), '{{{ data.authorAndUri }}}' ); ?></p>
<h2 class="theme-name">{{{ data.name }}}<span class="theme-version">
<?php
/* translators: %s: Theme version */
printf( __( 'Version: %s' ), '{{ data.version }}' );
?>
</span></h2>
<p class="theme-author">
<?php
/* translators: %s: Theme author link */
printf( __( 'By %s' ), '{{{ data.authorAndUri }}}' );
?>
</p>
<# if ( data.hasUpdate ) { #>
<div class="notice notice-warning notice-alt notice-large">
@ -558,7 +578,12 @@ if ( ! is_multisite() && current_user_can( 'edit_themes' ) && $broken_themes ) {
<p class="theme-description">{{{ data.description }}}</p>
<# if ( data.parent ) { #>
<p class="parent-theme"><?php printf( __( 'This is a child theme of %s.' ), '<strong>{{{ data.parent }}}</strong>' ); ?></p>
<p class="parent-theme">
<?php
/* translators: %s: Theme name */
printf( __( 'This is a child theme of %s.' ), '<strong>{{{ data.parent }}}</strong>' );
?>
</p>
<# } #>
<# if ( data.tags ) { #>

View File

@ -67,7 +67,15 @@ if ( current_user_can( 'import' ) ) :
?>
<div class="card">
<h2 class="title"><?php _e( 'Categories and Tags Converter' ); ?></h2>
<p><?php printf( __( 'If you want to convert your categories to tags (or vice versa), use the <a href="%s">Categories and Tags Converter</a> available from the Import screen.' ), 'import.php' ); ?></p>
<p>
<?php
printf(
/* translators: URL to Import screen */
__( 'If you want to convert your categories to tags (or vice versa), use the <a href="%s">Categories and Tags Converter</a> available from the Import screen.' ),
'import.php'
);
?>
</p>
</div>
<?php
endif;

View File

@ -61,6 +61,7 @@ function list_core_update( $update ) {
$message = __( 'You are using a development version of WordPress. You can update to the latest nightly build automatically:' );
} else {
if ( $current ) {
/* translators: %s: WordPress version */
$message = sprintf( __( 'If you need to re-install version %s, you can do so here:' ), $version_string );
$submit = __( 'Re-install Now' );
$form_action = 'update-core.php?action=do-core-reinstall';
@ -78,8 +79,11 @@ function list_core_update( $update ) {
sanitize_title( $update->current )
);
/* translators: %s: Update PHP page URL */
$php_update_message = '</p><p>' . sprintf( __( '<a href="%s">Learn more about updating PHP</a>.' ), esc_url( wp_get_update_php_url() ) );
$php_update_message = '</p><p>' . sprintf(
/* translators: %s: Update PHP page URL */
__( '<a href="%s">Learn more about updating PHP</a>.' ),
esc_url( wp_get_update_php_url() )
);
$annotation = wp_get_update_php_annotation();
if ( $annotation ) {
@ -87,17 +91,41 @@ function list_core_update( $update ) {
}
if ( ! $mysql_compat && ! $php_compat ) {
/* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Minimum required MySQL version number, 5: Current PHP version number, 6: Current MySQL version number */
$message = sprintf( __( 'You cannot update because <a href="%1$s">WordPress %2$s</a> requires PHP version %3$s or higher and MySQL version %4$s or higher. You are running PHP version %5$s and MySQL version %6$s.' ), $version_url, $update->current, $update->php_version, $update->mysql_version, $php_version, $mysql_version ) . $php_update_message;
$message = sprintf(
/* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Minimum required MySQL version number, 5: Current PHP version number, 6: Current MySQL version number */
__( 'You cannot update because <a href="%1$s">WordPress %2$s</a> requires PHP version %3$s or higher and MySQL version %4$s or higher. You are running PHP version %5$s and MySQL version %6$s.' ),
$version_url,
$update->current,
$update->php_version,
$update->mysql_version,
$php_version,
$mysql_version
) . $php_update_message;
} elseif ( ! $php_compat ) {
/* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Current PHP version number */
$message = sprintf( __( 'You cannot update because <a href="%1$s">WordPress %2$s</a> requires PHP version %3$s or higher. You are running version %4$s.' ), $version_url, $update->current, $update->php_version, $php_version ) . $php_update_message;
$message = sprintf(
/* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Current PHP version number */
__( 'You cannot update because <a href="%1$s">WordPress %2$s</a> requires PHP version %3$s or higher. You are running version %4$s.' ),
$version_url,
$update->current,
$update->php_version,
$php_version
) . $php_update_message;
} elseif ( ! $mysql_compat ) {
/* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required MySQL version number, 4: Current MySQL version number */
$message = sprintf( __( 'You cannot update because <a href="%1$s">WordPress %2$s</a> requires MySQL version %3$s or higher. You are running version %4$s.' ), $version_url, $update->current, $update->mysql_version, $mysql_version );
$message = sprintf(
/* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required MySQL version number, 4: Current MySQL version number */
__( 'You cannot update because <a href="%1$s">WordPress %2$s</a> requires MySQL version %3$s or higher. You are running version %4$s.' ),
$version_url,
$update->current,
$update->mysql_version,
$mysql_version
);
} else {
/* translators: 1: URL to WordPress release notes, 2: WordPress version number including locale if necessary */
$message = sprintf( __( 'You can update to <a href="%1$s">WordPress %2$s</a> automatically:' ), $version_url, $version_string );
$message = sprintf(
/* translators: 1: URL to WordPress release notes, 2: WordPress version number including locale if necessary */
__( 'You can update to <a href="%1$s">WordPress %2$s</a> automatically:' ),
$version_url,
$version_string
);
}
if ( ! $mysql_compat || ! $php_compat ) {
$show_buttons = false;
@ -133,7 +161,11 @@ function list_core_update( $update ) {
echo '<p class="hint">' . __( 'This localized version contains both the translation and various other localization fixes. You can skip upgrading if you want to keep your current translation.' ) . '</p>';
} elseif ( 'en_US' == $update->locale && get_locale() != 'en_US' && ( ! $update->packages->partial && $wp_version == $update->partial_version ) ) {
// Partial builds don't need language-specific warnings.
echo '<p class="hint">' . sprintf( __( 'You are about to install WordPress %s <strong>in English (US).</strong> There is a chance this update will break your translation. You may prefer to wait for the localized version to be released.' ), $update->response != 'development' ? $update->current : '' ) . '</p>';
echo '<p class="hint">' . sprintf(
/* translators: %s: WordPress version */
__( 'You are about to install WordPress %s <strong>in English (US).</strong> There is a chance this update will break your translation. You may prefer to wait for the localized version to be released.' ),
$update->response != 'development' ? $update->current : ''
) . '</p>';
}
echo '</form>';
@ -240,7 +272,12 @@ function core_upgrade_preamble() {
echo '<p>' . __( 'While your site is being updated, it will be in maintenance mode. As soon as your updates are complete, your site will return to normal.' ) . '</p>';
} elseif ( ! $updates ) {
list( $normalized_version ) = explode( '-', $wp_version );
echo '<p>' . sprintf( __( '<a href="%1$s">Learn more about WordPress %2$s</a>.' ), esc_url( self_admin_url( 'about.php' ) ), $normalized_version ) . '</p>';
echo '<p>' . sprintf(
/* translators: 1: URL to About screen, 2: WordPress version */
__( '<a href="%1$s">Learn more about WordPress %2$s</a>.' ),
esc_url( self_admin_url( 'about.php' ) ),
$normalized_version
) . '</p>';
}
dismissed_updates();
}
@ -299,16 +336,20 @@ function list_plugin_updates() {
// Get plugin compat for running version of WordPress.
if ( isset( $plugin_data->update->tested ) && version_compare( $plugin_data->update->tested, $cur_wp_version, '>=' ) ) {
$compat = '<br />' . sprintf( __( 'Compatibility with WordPress %1$s: 100%% (according to its author)' ), $cur_wp_version );
/* translators: %s: WordPress version */
$compat = '<br />' . sprintf( __( 'Compatibility with WordPress %s: 100%% (according to its author)' ), $cur_wp_version );
} else {
$compat = '<br />' . sprintf( __( 'Compatibility with WordPress %1$s: Unknown' ), $cur_wp_version );
/* translators: %s: WordPress version */
$compat = '<br />' . sprintf( __( 'Compatibility with WordPress %s: Unknown' ), $cur_wp_version );
}
// Get plugin compat for updated version of WordPress.
if ( $core_update_version ) {
if ( isset( $plugin_data->update->tested ) && version_compare( $plugin_data->update->tested, $core_update_version, '>=' ) ) {
$compat .= '<br />' . sprintf( __( 'Compatibility with WordPress %1$s: 100%% (according to its author)' ), $core_update_version );
/* translators: %s: WordPress version */
$compat .= '<br />' . sprintf( __( 'Compatibility with WordPress %s: 100%% (according to its author)' ), $core_update_version );
} else {
$compat .= '<br />' . sprintf( __( 'Compatibility with WordPress %1$s: Unknown' ), $core_update_version );
/* translators: %s: WordPress version */
$compat .= '<br />' . sprintf( __( 'Compatibility with WordPress %s: Unknown' ), $core_update_version );
}
}
@ -317,8 +358,8 @@ function list_plugin_updates() {
if ( ! $compatible_php && current_user_can( 'update_php' ) ) {
$compat .= '<br>' . __( 'This update doesn&#8217;t work with your version of PHP.' ) . '&nbsp;';
/* translators: %s: Update PHP page URL */
$compat .= sprintf(
/* translators: %s: Update PHP page URL */
__( '<a href="%s">Learn more about updating PHP</a>.' ),
esc_url( wp_get_update_php_url() )
);
@ -354,13 +395,10 @@ function list_plugin_updates() {
<?php if ( $compatible_php ) : ?>
<input type="checkbox" name="checked[]" id="<?php echo $checkbox_id; ?>" value="<?php echo esc_attr( $plugin_file ); ?>" />
<label for="<?php echo $checkbox_id; ?>" class="screen-reader-text">
<?php
<?php
/* translators: %s: plugin name */
printf(
__( 'Select %s' ),
$plugin_data->Name
);
?>
printf( __( 'Select %s' ), $plugin_data->Name );
?>
</label>
<?php endif; ?>
</td>
@ -368,8 +406,8 @@ function list_plugin_updates() {
<?php echo $icon; ?>
<strong><?php echo $plugin_data->Name; ?></strong>
<?php
/* translators: 1: plugin version, 2: new version */
printf(
/* translators: 1: plugin version, 2: new version */
__( 'You have version %1$s installed. Update to %2$s.' ),
$plugin_data->Version,
$plugin_data->update->new_version
@ -439,21 +477,18 @@ function list_theme_updates() {
<td class="check-column">
<input type="checkbox" name="checked[]" id="<?php echo $checkbox_id; ?>" value="<?php echo esc_attr( $stylesheet ); ?>" />
<label for="<?php echo $checkbox_id; ?>" class="screen-reader-text">
<?php
<?php
/* translators: %s: theme name */
printf(
__( 'Select %s' ),
$theme->display( 'Name' )
);
?>
printf( __( 'Select %s' ), $theme->display( 'Name' ) );
?>
</label>
</td>
<td class="plugin-title"><p>
<img src="<?php echo esc_url( $theme->get_screenshot() ); ?>" width="85" height="64" class="updates-table-screenshot" alt="" />
<strong><?php echo $theme->display( 'Name' ); ?></strong>
<?php
/* translators: 1: theme version, 2: new version */
printf(
/* translators: 1: theme version, 2: new version */
__( 'You have version %1$s installed. Update to %2$s.' ),
$theme->display( 'Version' ),
$theme->update['new_version']
@ -584,8 +619,22 @@ function do_core_upgrade( $reinstall = false ) {
}
show_message( __( 'WordPress updated successfully' ) );
show_message( '<span class="hide-if-no-js">' . sprintf( __( 'Welcome to WordPress %1$s. You will be redirected to the About WordPress screen. If not, click <a href="%2$s">here</a>.' ), $result, esc_url( self_admin_url( 'about.php?updated' ) ) ) . '</span>' );
show_message( '<span class="hide-if-js">' . sprintf( __( 'Welcome to WordPress %1$s. <a href="%2$s">Learn more</a>.' ), $result, esc_url( self_admin_url( 'about.php?updated' ) ) ) . '</span>' );
show_message(
'<span class="hide-if-no-js">' . sprintf(
/* translators: 1: WordPress version, 2: URL to About screen */
__( 'Welcome to WordPress %1$s. You will be redirected to the About WordPress screen. If not, click <a href="%2$s">here</a>.' ),
$result,
esc_url( self_admin_url( 'about.php?updated' ) )
) . '</span>'
);
show_message(
'<span class="hide-if-js">' . sprintf(
/* translators: 1: WordPress version, 2: URL to About screen */
__( 'Welcome to WordPress %1$s. <a href="%2$s">Learn more</a>.' ),
$result,
esc_url( self_admin_url( 'about.php?updated' ) )
) . '</span>'
);
?>
</div>
<script type="text/javascript">

View File

@ -124,6 +124,7 @@ if ( isset( $_GET['action'] ) ) {
$submenu_file = 'plugin-install.php';
require_once( ABSPATH . 'wp-admin/admin-header.php' );
/* translators: %s: plugin name and version */
$title = sprintf( __( 'Installing Plugin: %s' ), $api->name . ' ' . $api->version );
$nonce = 'install-plugin_' . $plugin;
$url = 'update.php?action=install-plugin&plugin=' . urlencode( $plugin );
@ -153,6 +154,7 @@ if ( isset( $_GET['action'] ) ) {
$submenu_file = 'plugin-install.php';
require_once( ABSPATH . 'wp-admin/admin-header.php' );
/* translators: %s: file name */
$title = sprintf( __( 'Installing Plugin from uploaded file: %s' ), esc_html( basename( $file_upload->filename ) ) );
$nonce = 'plugin-upload';
$url = add_query_arg( array( 'package' => $file_upload->id ), 'update.php?action=upload-plugin' );
@ -245,6 +247,7 @@ if ( isset( $_GET['action'] ) ) {
$submenu_file = 'themes.php';
require_once( ABSPATH . 'wp-admin/admin-header.php' );
/* translators: %s: theme name and version */
$title = sprintf( __( 'Installing Theme: %s' ), $api->name . ' ' . $api->version );
$nonce = 'install-theme_' . $theme;
$url = 'update.php?action=install-theme&theme=' . urlencode( $theme );
@ -271,6 +274,7 @@ if ( isset( $_GET['action'] ) ) {
require_once( ABSPATH . 'wp-admin/admin-header.php' );
/* translators: %s: file name */
$title = sprintf( __( 'Installing Theme from uploaded file: %s' ), esc_html( basename( $file_upload->filename ) ) );
$nonce = 'theme-upload';
$url = add_query_arg( array( 'package' => $file_upload->id ), 'update.php?action=upload-theme' );

View File

@ -93,14 +93,34 @@ elseif ( ! $php_compat || ! $mysql_compat ) :
}
if ( ! $mysql_compat && ! $php_compat ) {
/* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Minimum required MySQL version number, 5: Current PHP version number, 6: Current MySQL version number */
$message = sprintf( __( 'You cannot update because <a href="%1$s">WordPress %2$s</a> requires PHP version %3$s or higher and MySQL version %4$s or higher. You are running PHP version %5$s and MySQL version %6$s.' ), $version_url, $wp_version, $required_php_version, $required_mysql_version, $php_version, $mysql_version ) . $php_update_message;
$message = sprintf(
/* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Minimum required MySQL version number, 5: Current PHP version number, 6: Current MySQL version number */
__( 'You cannot update because <a href="%1$s">WordPress %2$s</a> requires PHP version %3$s or higher and MySQL version %4$s or higher. You are running PHP version %5$s and MySQL version %6$s.' ),
$version_url,
$wp_version,
$required_php_version,
$required_mysql_version,
$php_version,
$mysql_version
) . $php_update_message;
} elseif ( ! $php_compat ) {
/* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Current PHP version number */
$message = sprintf( __( 'You cannot update because <a href="%1$s">WordPress %2$s</a> requires PHP version %3$s or higher. You are running version %4$s.' ), $version_url, $wp_version, $required_php_version, $php_version ) . $php_update_message;
$message = sprintf(
/* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Current PHP version number */
__( 'You cannot update because <a href="%1$s">WordPress %2$s</a> requires PHP version %3$s or higher. You are running version %4$s.' ),
$version_url,
$wp_version,
$required_php_version,
$php_version
) . $php_update_message;
} elseif ( ! $mysql_compat ) {
/* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required MySQL version number, 4: Current MySQL version number */
$message = sprintf( __( 'You cannot update because <a href="%1$s">WordPress %2$s</a> requires MySQL version %3$s or higher. You are running version %4$s.' ), $version_url, $wp_version, $required_mysql_version, $mysql_version );
$message = sprintf(
/* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required MySQL version number, 4: Current MySQL version number */
__( 'You cannot update because <a href="%1$s">WordPress %2$s</a> requires MySQL version %3$s or higher. You are running version %4$s.' ),
$version_url,
$wp_version,
$required_mysql_version,
$mysql_version
);
}
echo '<p>' . $message . '</p>';

View File

@ -259,7 +259,11 @@ switch ( $action ) {
<?php if ( ! ( IS_PROFILE_PAGE && ! $user_can_edit ) ) : ?>
<tr class="user-rich-editing-wrap">
<th scope="row"><?php _e( 'Visual Editor' ); ?></th>
<td><label for="rich_editing"><input name="rich_editing" type="checkbox" id="rich_editing" value="false" <?php checked( 'false', $profileuser->rich_editing ); ?> /> <?php _e( 'Disable the visual editor when writing' ); ?></label></td>
<td>
<label for="rich_editing"><input name="rich_editing" type="checkbox" id="rich_editing" value="false" <?php checked( 'false', $profileuser->rich_editing ); ?> />
<?php _e( 'Disable the visual editor when writing' ); ?>
</label>
</td>
</tr>
<?php endif; ?>
<?php
@ -274,18 +278,22 @@ switch ( $action ) {
user_can( $profileuser, 'edit_themes' )
);
?>
<?php if ( $show_syntax_highlighting_preference ) : ?>
<tr class="user-syntax-highlighting-wrap">
<th scope="row"><?php _e( 'Syntax Highlighting' ); ?></th>
<td>
<label for="syntax_highlighting"><input name="syntax_highlighting" type="checkbox" id="syntax_highlighting" value="false" <?php checked( 'false', $profileuser->syntax_highlighting ); ?> /> <?php _e( 'Disable syntax highlighting when editing code' ); ?></label>
<label for="syntax_highlighting"><input name="syntax_highlighting" type="checkbox" id="syntax_highlighting" value="false" <?php checked( 'false', $profileuser->syntax_highlighting ); ?> />
<?php _e( 'Disable syntax highlighting when editing code' ); ?>
</label>
</td>
</tr>
<?php endif; ?>
<?php endif; ?>
<?php if ( count( $_wp_admin_css_colors ) > 1 && has_action( 'admin_color_scheme_picker' ) ) : ?>
<tr class="user-admin-color-wrap">
<th scope="row"><?php _e( 'Admin Color Scheme' ); ?></th>
<td>
<tr class="user-admin-color-wrap">
<th scope="row"><?php _e( 'Admin Color Scheme' ); ?></th>
<td>
<?php
/**
* Fires in the 'Admin Color Scheme' section of the user editing screen.
@ -300,36 +308,44 @@ switch ( $action ) {
*/
do_action( 'admin_color_scheme_picker', $user_id );
?>
</td>
</tr>
</td>
</tr>
<?php
endif; // $_wp_admin_css_colors
if ( ! ( IS_PROFILE_PAGE && ! $user_can_edit ) ) :
?>
<tr class="user-comment-shortcuts-wrap">
<th scope="row"><?php _e( 'Keyboard Shortcuts' ); ?></th>
<td><label for="comment_shortcuts"><input type="checkbox" name="comment_shortcuts" id="comment_shortcuts" value="true" <?php checked( 'true', $profileuser->comment_shortcuts ); ?> /> <?php _e( 'Enable keyboard shortcuts for comment moderation.' ); ?></label> <?php _e( '<a href="https://wordpress.org/support/article/keyboard-shortcuts/" target="_blank">More information</a>' ); ?></td>
</tr>
<tr class="user-comment-shortcuts-wrap">
<th scope="row"><?php _e( 'Keyboard Shortcuts' ); ?></th>
<td>
<label for="comment_shortcuts">
<input type="checkbox" name="comment_shortcuts" id="comment_shortcuts" value="true" <?php checked( 'true', $profileuser->comment_shortcuts ); ?> />
<?php _e( 'Enable keyboard shortcuts for comment moderation.' ); ?>
</label>
<?php _e( '<a href="https://wordpress.org/support/article/keyboard-shortcuts/" target="_blank">More information</a>' ); ?>
</td>
</tr>
<?php endif; ?>
<tr class="show-admin-bar user-admin-bar-front-wrap">
<th scope="row"><?php _e( 'Toolbar' ); ?></th>
<td>
<label for="admin_bar_front">
<input name="admin_bar_front" type="checkbox" id="admin_bar_front" value="1"<?php checked( _get_admin_bar_pref( 'front', $profileuser->ID ) ); ?> />
<?php _e( 'Show Toolbar when viewing site' ); ?></label><br />
</td>
</tr>
<tr class="show-admin-bar user-admin-bar-front-wrap">
<th scope="row"><?php _e( 'Toolbar' ); ?></th>
<td>
<label for="admin_bar_front">
<input name="admin_bar_front" type="checkbox" id="admin_bar_front" value="1"<?php checked( _get_admin_bar_pref( 'front', $profileuser->ID ) ); ?> />
<?php _e( 'Show Toolbar when viewing site' ); ?>
</label><br />
</td>
</tr>
<?php
$languages = get_available_languages();
if ( $languages ) :
?>
<tr class="user-language-wrap">
<th scope="row">
<tr class="user-language-wrap">
<th scope="row">
<?php /* translators: The user language selection field label */ ?>
<label for="locale"><?php _e( 'Language' ); ?><span class="dashicons dashicons-translation" aria-hidden="true"></span></label>
</th>
<td>
<label for="locale"><?php _e( 'Language' ); ?><span class="dashicons dashicons-translation" aria-hidden="true"></span></label>
</th>
<td>
<?php
$user_locale = $profileuser->locale;
@ -350,8 +366,8 @@ endif; // $_wp_admin_css_colors
)
);
?>
</td>
</tr>
</td>
</tr>
<?php
endif;
?>
@ -566,8 +582,8 @@ endif; //!IS_PROFILE_PAGE
<p class="description">
<?php
if ( IS_PROFILE_PAGE ) {
/* translators: %s: Gravatar URL */
$description = sprintf(
/* translators: %s: Gravatar URL */
__( '<a href="%s">You can change your profile picture on Gravatar</a>.' ),
__( 'https://en.gravatar.com/' )
);
@ -740,7 +756,13 @@ endif; //!IS_PROFILE_PAGE
if ( '' != $output ) {
$output .= ', ';
}
$output .= $value ? $cap : sprintf( __( 'Denied: %s' ), $cap );
if ( $value ) {
$output .= $value;
} else {
/* translators: %s: capability name */
$output .= sprintf( __( 'Denied: %s' ), $cap );
}
}
}
echo $output;

View File

@ -123,8 +123,21 @@ Please click the following link to confirm the invite:
%4$s'
);
/* translators: Joining confirmation notification email subject. %s: Site title */
wp_mail( $new_user_email, sprintf( __( '[%s] Joining Confirmation' ), wp_specialchars_decode( get_option( 'blogname' ) ) ), sprintf( $message, get_option( 'blogname' ), home_url(), wp_specialchars_decode( translate_user_role( $role['name'] ) ), home_url( "/newbloguser/$newuser_key/" ) ) );
wp_mail(
$new_user_email,
sprintf(
/* translators: Joining confirmation notification email subject. %s: Site title */
__( '[%s] Joining Confirmation' ),
wp_specialchars_decode( get_option( 'blogname' ) )
),
sprintf(
$message,
get_option( 'blogname' ),
home_url(),
wp_specialchars_decode( translate_user_role( $role['name'] ) ),
home_url( "/newbloguser/$newuser_key/" )
)
);
if ( $switched_locale ) {
restore_previous_locale();
@ -296,11 +309,7 @@ if ( isset( $_GET['update'] ) ) {
$message = __( 'User has been added to your site.' );
if ( $edit_link ) {
$message .= sprintf(
' <a href="%s">%s</a>',
$edit_link,
__( 'Edit user' )
);
$message .= sprintf( ' <a href="%s">%s</a>', $edit_link, __( 'Edit user' ) );
}
$messages[] = $message;

View File

@ -289,10 +289,10 @@ switch ( $wp_list_table->current_action() ) {
foreach ( $all_userids as $id ) {
$user = get_userdata( $id );
if ( $id == $current_user->ID ) {
/* translators: 1: user id, 2: user login */
/* translators: 1: user ID, 2: user login */
echo '<li>' . sprintf( __( 'ID #%1$s: %2$s <strong>The current user will not be deleted.</strong>' ), $id, $user->user_login ) . "</li>\n";
} else {
/* translators: 1: user id, 2: user login */
/* translators: 1: user ID, 2: user login */
echo '<li><input type="hidden" name="users[]" value="' . esc_attr( $id ) . '" />' . sprintf( __( 'ID #%1$s: %2$s' ), $id, $user->user_login ) . "</li>\n";
$go_delete++;
}
@ -427,10 +427,10 @@ switch ( $wp_list_table->current_action() ) {
$id = (int) $id;
$user = get_userdata( $id );
if ( ! current_user_can( 'remove_user', $id ) ) {
/* translators: 1: user id, 2: user login */
/* translators: 1: user ID, 2: user login */
echo '<li>' . sprintf( __( 'ID #%1$s: %2$s <strong>Sorry, you are not allowed to remove this user.</strong>' ), $id, $user->user_login ) . "</li>\n";
} else {
/* translators: 1: user id, 2: user login */
/* translators: 1: user ID, 2: user login */
echo "<li><input type=\"hidden\" name=\"users[]\" value=\"{$id}\" />" . sprintf( __( 'ID #%1$s: %2$s' ), $id, $user->user_login ) . "</li>\n";
$go_remove = true;
}
@ -484,6 +484,7 @@ switch ( $wp_list_table->current_action() ) {
if ( 1 == $delete_count ) {
$message = __( 'User deleted.' );
} else {
/* translators: %s: number of users */
$message = _n( '%s user deleted.', '%s users deleted.', $delete_count );
}
$messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $delete_count ) ) . '</p></div>';

View File

@ -292,7 +292,12 @@ if ( isset( $_GET['editwidget'] ) && $_GET['editwidget'] ) {
<div class="wrap">
<h1><?php echo esc_html( $title ); ?></h1>
<div class="editwidget"<?php echo $width; ?>>
<h2><?php printf( __( 'Widget %s' ), $name ); ?></h2>
<h2>
<?php
/* translators: %s: widget name */
printf( __( 'Widget %s' ), $name );
?>
</h2>
<form action="widgets.php" method="post">
<div class="widget-inside">

View File

@ -896,7 +896,7 @@ function wp_admin_bar_comments_menu( $wp_admin_bar ) {
$awaiting_mod = wp_count_comments();
$awaiting_mod = $awaiting_mod->moderated;
$awaiting_text = sprintf(
/* translators: %s: number of comments in moderation */
/* translators: %s: number of comments */
_n( '%s Comment in moderation', '%s Comments in moderation', $awaiting_mod ),
number_format_i18n( $awaiting_mod )
);

View File

@ -65,8 +65,8 @@ function the_author( $deprecated = '', $deprecated_echo = true ) {
_deprecated_argument(
__FUNCTION__,
'1.5.0',
/* translators: %s: get_the_author() */
sprintf(
/* translators: %s: get_the_author() */
__( 'Use %s instead if you do not want the value echoed.' ),
'<code>get_the_author()</code>'
)

Some files were not shown because too many files have changed in this diff Show More