diff --git a/src/wp-admin/about.php b/src/wp-admin/about.php index cc0db6a8b9..2731a54a1c 100644 --- a/src/wp-admin/about.php +++ b/src/wp-admin/about.php @@ -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 */ __( ' Check your site status, and learn how to debug issues.' ), admin_url( 'site-health.php' ), admin_url( 'site-health.php?tab=debug' ) @@ -142,7 +142,7 @@ include( ABSPATH . 'wp-admin/admin-header.php' );

*/ + /* translators: 1: wp_body_open, 2: */ __( '5.2 introduces a %1$s hook, which lets themes support injecting code right at the beginning of the %2$s element.' ), 'wp_body_open', '<body>' diff --git a/src/wp-admin/admin-footer.php b/src/wp-admin/admin-footer.php index 1061f6b9a7..0a77d3ac14 100644 --- a/src/wp-admin/admin-footer.php +++ b/src/wp-admin/admin-footer.php @@ -32,6 +32,7 @@ global $hook_suffix; ?>

- - ' . sprintf( __( '“%s” has failed to upload.' ), esc_html( $_FILES['async-upload']['name'] ) ) . '
' . - esc_html( $id->get_error_message() ) . '
'; + printf( + '
%s %s
%s
', + sprintf( + '', + __( 'Dismiss' ) + ), + sprintf( + /* translators: %s: Name of the file that failed to upload. */ + __( '“%s” has failed to upload.' ), + esc_html( $_FILES['async-upload']['name'] ) + ), + esc_html( $id->get_error_message() ) + ); exit; } diff --git a/src/wp-admin/comment.php b/src/wp-admin/comment.php index 9980bd181b..80aa3a0f05 100644 --- a/src/wp-admin/comment.php +++ b/src/wp-admin/comment.php @@ -204,8 +204,8 @@ switch ( $action ) { ' . get_bloginfo( 'name', 'display' ) . '' ); ?> diff --git a/src/wp-admin/edit-comments.php b/src/wp-admin/edit-comments.php index 29f82a197d..9436efc540 100644 --- a/src/wp-admin/edit-comments.php +++ b/src/wp-admin/edit-comments.php @@ -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, '…' ); 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 “%2$s”' ), number_format_i18n( $comments_count->moderated ), $draft_or_post_title ); } else { - /* translators: %s: post title */ $title = sprintf( + /* translators: %s: post title */ __( 'Comments on “%s”' ), $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' );

%2$s', @@ -243,8 +243,8 @@ if ( $post_id ) { '; - /* translators: %s: search keywords */ printf( + /* translators: %s: search keywords */ __( 'Search results for “%s”' ), wp_html_excerpt( esc_html( wp_unslash( $_REQUEST['s'] ) ), 50, '…' ) ); @@ -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 ) . ' ' . __( 'Undo' ) . '
'; } 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 ) . ' ' . __( 'Undo' ) . '
'; } 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 ); } diff --git a/src/wp-admin/edit-form-advanced.php b/src/wp-admin/edit-form-advanced.php index 977448aaf5..9e6ed11e0c 100644 --- a/src/wp-admin/edit-form-advanced.php +++ b/src/wp-admin/edit-form-advanced.php @@ -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.' ), '' . $scheduled_date . '' ) . $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.' ), '' . $scheduled_date . '' ) . $scheduled_page_link_html, 10 => __( 'Page draft updated.' ) . $preview_page_link_html, ); @@ -238,7 +240,11 @@ $form_extra .= "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. View the autosave' ), 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. View the autosave' ), + get_edit_post_link( $autosave->ID ) + ); break; } } @@ -292,7 +298,11 @@ if ( 'post' == $post_type ) { ); get_current_screen()->set_help_sidebar( - '

' . sprintf( __( 'You can also create posts with the Press This bookmarklet.' ), 'tools.php' ) . '

' . + '

' . sprintf( + /* translators: %s: URL to Press This bookmarklet */ + __( 'You can also create posts with the Press This bookmarklet.' ), + 'tools.php' + ) . '

' . '

' . __( 'For more information:' ) . '

' . '

' . __( 'Documentation on Writing and Editing Posts' ) . '

' . '

' . __( 'Support' ) . '

' @@ -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 .= '
  • ' . sprintf( __( '%s — 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 ) ) . '
  • '; + $publish_box .= '
  • ' . sprintf( + /* translators: %s: Featured Image */ + __( '%s — 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 ) + ) . '
  • '; } $publish_box .= ''; @@ -577,7 +590,15 @@ if ( post_type_supports( $post_type, 'editor' ) ) { ); ?> - + \n \n - \n"; + \n"; $defaults = array( 'input' => 'text', @@ -1906,8 +1910,10 @@ function get_compat_media_markup( $attachment_id, $args = null ) { if ( $item ) { $item = '

    ' . - sprintf( __( 'Required fields are marked %s' ), '*' ) . '

    -
    0' ); ?> + 0' + ); + ?> +   Links / 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( __( 'Links / Add New Link' ), 'link-manager.php' ); $submit_text = __( 'Add Link' ); $form_name = 'addlink'; diff --git a/src/wp-admin/edit-tags.php b/src/wp-admin/edit-tags.php index cc5f118997..517bb359af 100644 --- a/src/wp-admin/edit-tags.php +++ b/src/wp-admin/edit-tags.php @@ -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 = '

    ' . sprintf( __( 'You can use categories to define sections of your site and group related posts. The default category is “Uncategorized” until you change it in your writing settings.' ), 'options-writing.php' ) . '

    '; + $help = '

    ' . 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 “Uncategorized” until you change it in your writing settings.' ), + 'options-writing.php' + ) . '

    '; } elseif ( 'link_category' == $taxonomy ) { $help = '

    ' . __( '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.' ) . '

    '; } else { @@ -596,13 +600,27 @@ if ( $can_edit_terms ) {

    - category to tag converter.' ), esc_url( $import_link ) ); ?> + category to tag converter.' ), + esc_url( $import_link ) + ); + ?>

    -

    tag to category converter.' ), esc_url( $import_link ) ); ?>

    +

    + tag to category converter.' ), + esc_url( $import_link ) + ); + ?> +

    _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'] ), ); diff --git a/src/wp-admin/freedoms.php b/src/wp-admin/freedoms.php index e860ebbe83..9b59d820df 100644 --- a/src/wp-admin/freedoms.php +++ b/src/wp-admin/freedoms.php @@ -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’s directory is 100%% GPL or a similarly free and compatible license, so you can feel safe finding plugins and themes there. If you get a plugin or theme from another source, make sure to ask them if it’s GPL first. If they don’t respect the WordPress license, we don’t recommend them.' ), $plugins_url, $themes_url, diff --git a/src/wp-admin/import.php b/src/wp-admin/import.php index bf0eb60cec..c3fbcfd7b7 100644 --- a/src/wp-admin/import.php +++ b/src/wp-admin/import.php @@ -223,7 +223,11 @@ if ( empty( $importers ) ) { } if ( current_user_can( 'install_plugins' ) ) { - echo '

    ' . sprintf( __( 'If the importer you need is not listed, search the plugin directory to see if an importer is available.' ), esc_url( network_admin_url( 'plugin-install.php?tab=search&type=tag&s=importer' ) ) ) . '

    '; + echo '

    ' . sprintf( + /* translators: %s: URL to Add Plugins screen */ + __( 'If the importer you need is not listed, search the plugin directory to see if an importer is available.' ), + esc_url( network_admin_url( 'plugin-install.php?tab=search&type=tag&s=importer' ) ) + ) . '

    '; } ?> diff --git a/src/wp-admin/includes/ajax-actions.php b/src/wp-admin/includes/ajax-actions.php index 5ad5eac8a6..c1f5c8f1fc 100644 --- a/src/wp-admin/includes/ajax-actions.php +++ b/src/wp-admin/includes/ajax-actions.php @@ -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.' ), '' . esc_html( $url ) . '' ), ) ); diff --git a/src/wp-admin/includes/bookmark.php b/src/wp-admin/includes/bookmark.php index 05165dd9d1..73102b96a1 100644 --- a/src/wp-admin/includes/bookmark.php +++ b/src/wp-admin/includes/bookmark.php @@ -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&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 Link Manager plugin.' ), $link ) ); } diff --git a/src/wp-admin/includes/class-bulk-plugin-upgrader-skin.php b/src/wp-admin/includes/class-bulk-plugin-upgrader-skin.php index a568d6b107..62b877918a 100644 --- a/src/wp-admin/includes/class-bulk-plugin-upgrader-skin.php +++ b/src/wp-admin/includes/class-bulk-plugin-upgrader-skin.php @@ -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' => '' . __( 'Return to Plugins page' ) . '', - 'updates_page' => '' . __( 'Return to WordPress Updates page' ) . '', + 'plugins_page' => sprintf( + '%s', + self_admin_url( 'plugins.php' ), + __( 'Return to Plugins page' ) + ), + 'updates_page' => sprintf( + '%s', + self_admin_url( 'update-core.php' ), + __( 'Return to WordPress Updates page' ) + ), ); + if ( ! current_user_can( 'activate_plugins' ) ) { unset( $update_actions['plugins_page'] ); } diff --git a/src/wp-admin/includes/class-bulk-theme-upgrader-skin.php b/src/wp-admin/includes/class-bulk-theme-upgrader-skin.php index ce426e0154..687a921529 100644 --- a/src/wp-admin/includes/class-bulk-theme-upgrader-skin.php +++ b/src/wp-admin/includes/class-bulk-theme-upgrader-skin.php @@ -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' => '' . __( 'Return to Themes page' ) . '', - 'updates_page' => '' . __( 'Return to WordPress Updates page' ) . '', + 'themes_page' => sprintf( + '%s', + self_admin_url( 'themes.php' ), + __( 'Return to Themes page' ) + ), + 'updates_page' => sprintf( + '%s', + 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'] ); } diff --git a/src/wp-admin/includes/class-custom-background.php b/src/wp-admin/includes/class-custom-background.php index 0e463bd0ca..16ba6c0f33 100644 --- a/src/wp-admin/includes/class-custom-background.php +++ b/src/wp-admin/includes/class-custom-background.php @@ -229,10 +229,11 @@ class Custom_Background {

    Customizer.' ), - 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 Customizer.' ), + admin_url( 'customize.php?autofocus[control]=background_image' ) + ); ?>

    @@ -240,7 +241,12 @@ class Custom_Background { updated ) ) { ?>
    -

    Visit your site to see how it looks.' ), home_url( '/' ) ); ?>

    +

    + Visit your site to see how it looks.' ), home_url( '/' ) ); + ?> +

    diff --git a/src/wp-admin/includes/class-custom-image-header.php b/src/wp-admin/includes/class-custom-image-header.php index d2e6ca55f3..faf9efc13c 100644 --- a/src/wp-admin/includes/class-custom-image-header.php +++ b/src/wp-admin/includes/class-custom-image-header.php @@ -118,7 +118,12 @@ class Custom_Image_Header { 'id' => 'set-header-text', 'title' => __( 'Header Text' ), 'content' => - '

    ' . sprintf( __( 'For most themes, the header text is your Site Title and Tagline, as defined in the General Settings section.' ), admin_url( 'options-general.php' ) ) . '

    ' . + '

    ' . sprintf( + /* translators: %s: URL to General Settings screen */ + __( 'For most themes, the header text is your Site Title and Tagline, as defined in the General Settings section.' ), + admin_url( 'options-general.php' ) + ) . + '

    ' . '

    ' . __( '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. “#ff0000” for red, or by choosing a color using the color picker.' ) . '

    ' . '

    ' . __( 'Don’t forget to click “Save Changes” when you’re done!' ) . '

    ', ) @@ -473,10 +478,11 @@ class Custom_Image_Header {

    Customizer.' ), - 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 Customizer.' ), + admin_url( 'customize.php?autofocus[control]=header_image' ) + ); ?>

    @@ -484,7 +490,12 @@ class Custom_Image_Header { updated ) ) { ?>
    -

    Visit your site to see how it looks.' ), home_url( '/' ) ); ?>

    +

    + Visit your site to see how it looks.' ), home_url( '/' ) ); + ?> +

    @@ -540,6 +551,7 @@ class Custom_Image_Header {


    %1$d × %2$d pixels will be used as-is.' ) . '
    ', 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 ''; if ( $default_color ) { + /* translators: %s: Default text color */ echo ' ' . sprintf( _x( 'Default: %s', 'color' ), esc_html( $default_color ) ) . ''; } ?> diff --git a/src/wp-admin/includes/class-language-pack-upgrader-skin.php b/src/wp-admin/includes/class-language-pack-upgrader-skin.php index 1d59cc73cb..19ef44393e 100644 --- a/src/wp-admin/includes/class-language-pack-upgrader-skin.php +++ b/src/wp-admin/includes/class-language-pack-upgrader-skin.php @@ -47,7 +47,7 @@ class Language_Pack_Upgrader_Skin extends WP_Upgrader_Skin { echo '

    '; - /* translators: 1: name of project, 2: language */ + /* translators: 1: project name (plugin, theme, or WordPress), 2: language */ printf( '

    ' . __( 'Updating translations for %1$s (%2$s)…' ) . '

    ', $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'] = '' . __( 'Return to WordPress Updates page' ) . ''; + + $update_actions = array( + 'updates_page' => sprintf( + '%s', + self_admin_url( 'update-core.php' ), + __( 'Return to WordPress Updates page' ) + ), + ); /** * Filters the list of action links available following a translations update. diff --git a/src/wp-admin/includes/class-plugin-installer-skin.php b/src/wp-admin/includes/class-plugin-installer-skin.php index 1d6dd01876..ee1e7828e7 100644 --- a/src/wp-admin/includes/class-plugin-installer-skin.php +++ b/src/wp-admin/includes/class-plugin-installer-skin.php @@ -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 %1$s %2$s.' ), $this->api->name, $this->api->version ); + $this->upgrader->strings['process_success'] = sprintf( + /* translators: 1: plugin name, 2: plugin version */ + __( 'Successfully installed the plugin %1$s %2$s.' ), + $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'] = '' . __( 'Activate Plugin & Run Importer' ) . ''; + $install_actions['activate_plugin'] = sprintf( + '%s', + wp_nonce_url( 'plugins.php?action=activate&from=import&plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file ), + __( 'Activate Plugin & Run Importer' ) + ); } elseif ( 'press-this' == $from ) { - $install_actions['activate_plugin'] = '' . __( 'Activate Plugin & Return to Press This' ) . ''; + $install_actions['activate_plugin'] = sprintf( + '%s', + wp_nonce_url( 'plugins.php?action=activate&from=press-this&plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file ), + __( 'Activate Plugin & Return to Press This' ) + ); } else { - $install_actions['activate_plugin'] = '' . __( 'Activate Plugin' ) . ''; + $install_actions['activate_plugin'] = sprintf( + '%s', + wp_nonce_url( 'plugins.php?action=activate&plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file ), + __( 'Activate Plugin' ) + ); } if ( is_multisite() && current_user_can( 'manage_network_plugins' ) ) { - $install_actions['network_activate'] = '' . __( 'Network Activate' ) . ''; + $install_actions['network_activate'] = sprintf( + '%s', + wp_nonce_url( 'plugins.php?action=activate&networkwide=1&plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file ), + __( 'Network Activate' ) + ); unset( $install_actions['activate_plugin'] ); } if ( 'import' == $from ) { - $install_actions['importers_page'] = '' . __( 'Return to Importers' ) . ''; + $install_actions['importers_page'] = sprintf( + '%s', + admin_url( 'import.php' ), + __( 'Return to Importers' ) + ); } elseif ( $this->type == 'web' ) { - $install_actions['plugins_page'] = '' . __( 'Return to Plugin Installer' ) . ''; + $install_actions['plugins_page'] = sprintf( + '%s', + self_admin_url( 'plugin-install.php' ), + __( 'Return to Plugin Installer' ) + ); } elseif ( 'upload' == $this->type && 'plugins' == $from ) { - $install_actions['plugins_page'] = '' . __( 'Return to Plugin Installer' ) . ''; + $install_actions['plugins_page'] = sprintf( + '%s', + self_admin_url( 'plugin-install.php' ), + __( 'Return to Plugin Installer' ) + ); } else { - $install_actions['plugins_page'] = '' . __( 'Return to Plugins page' ) . ''; + $install_actions['plugins_page'] = sprintf( + '%s', + self_admin_url( 'plugins.php' ), + __( 'Return to Plugins page' ) + ); } if ( ! $this->result || is_wp_error( $this->result ) ) { diff --git a/src/wp-admin/includes/class-plugin-upgrader-skin.php b/src/wp-admin/includes/class-plugin-upgrader-skin.php index 87cbefbc7d..5d06c7c2c6 100644 --- a/src/wp-admin/includes/class-plugin-upgrader-skin.php +++ b/src/wp-admin/includes/class-plugin-upgrader-skin.php @@ -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 ''; + printf( + '', + 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' => '' . __( 'Activate Plugin' ) . '', - 'plugins_page' => '' . __( 'Return to Plugins page' ) . '', + 'activate_plugin' => sprintf( + '%s', + wp_nonce_url( 'plugins.php?action=activate&plugin=' . urlencode( $this->plugin ), 'activate-plugin_' . $this->plugin ), + __( 'Activate Plugin' ) + ), + 'plugins_page' => sprintf( + '%s', + 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'] ); } diff --git a/src/wp-admin/includes/class-theme-installer-skin.php b/src/wp-admin/includes/class-theme-installer-skin.php index 5f62e2c00b..1da2d0fceb 100644 --- a/src/wp-admin/includes/class-theme-installer-skin.php +++ b/src/wp-admin/includes/class-theme-installer-skin.php @@ -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'] = ''; - $install_actions['preview'] .= ''; - /* translators: %s: theme name */ - $install_actions['preview'] .= '' . sprintf( __( 'Live Preview “%s”' ), $name ) . ''; + + $install_actions['preview'] = sprintf( + '' . + '%s', + esc_url( $customize_url ), + __( 'Live Preview' ), + /* translators: %s: theme name */ + sprintf( __( 'Live Preview “%s”' ), $name ) + ); } - $install_actions['activate'] = ''; - $install_actions['activate'] .= ''; - /* translators: %s: theme name */ - $install_actions['activate'] .= '' . sprintf( __( 'Activate “%s”' ), $name ) . ''; + + $install_actions['activate'] = sprintf( + '' . + '%s', + esc_url( $activate_link ), + __( 'Activate' ), + /* translators: %s: theme name */ + sprintf( __( 'Activate “%s”' ), $name ) + ); if ( is_network_admin() && current_user_can( 'manage_network_themes' ) ) { - $install_actions['network_enable'] = '' . __( 'Network Enable' ) . ''; + $install_actions['network_enable'] = sprintf( + '%s', + esc_url( wp_nonce_url( 'themes.php?action=enable&theme=' . urlencode( $stylesheet ), 'enable-theme_' . $stylesheet ) ), + __( 'Network Enable' ) + ); } if ( $this->type == 'web' ) { - $install_actions['themes_page'] = '' . __( 'Return to Theme Installer' ) . ''; + $install_actions['themes_page'] = sprintf( + '%s', + 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'] = '' . __( 'Return to Themes page' ) . ''; + $install_actions['themes_page'] = sprintf( + '%s', + 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' ) ) { diff --git a/src/wp-admin/includes/class-theme-upgrader-skin.php b/src/wp-admin/includes/class-theme-upgrader-skin.php index 3dce0fe30b..cc4874f29f 100644 --- a/src/wp-admin/includes/class-theme-upgrader-skin.php +++ b/src/wp-admin/includes/class-theme-upgrader-skin.php @@ -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'] = ''; - $update_actions['preview'] .= ''; - /* translators: %s: theme name */ - $update_actions['preview'] .= '' . sprintf( __( 'Customize “%s”' ), $name ) . ''; + $update_actions['preview'] = sprintf( + '' . + '%s', + esc_url( $customize_url ), + __( 'Customize' ), + /* translators: %s: theme name */ + sprintf( __( 'Customize “%s”' ), $name ) + ); } } elseif ( current_user_can( 'switch_themes' ) ) { if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { - $update_actions['preview'] = ''; - $update_actions['preview'] .= ''; - /* translators: %s: theme name */ - $update_actions['preview'] .= '' . sprintf( __( 'Live Preview “%s”' ), $name ) . ''; + $update_actions['preview'] = sprintf( + '' . + '%s', + esc_url( $customize_url ), + __( 'Live Preview' ), + /* translators: %s: theme name */ + sprintf( __( 'Live Preview “%s”' ), $name ) + ); } - $update_actions['activate'] = ''; - $update_actions['activate'] .= ''; - /* translators: %s: theme name */ - $update_actions['activate'] .= '' . sprintf( __( 'Activate “%s”' ), $name ) . ''; + + $update_actions['activate'] = sprintf( + '' . + '%s', + esc_url( $activate_link ), + __( 'Activate' ), + /* translators: %s: theme name */ + sprintf( __( 'Activate “%s”' ), $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'] = '' . __( 'Return to Themes page' ) . ''; + $update_actions['themes_page'] = sprintf( + '%s', + self_admin_url( 'themes.php' ), + __( 'Return to Themes page' ) + ); /** * Filters the list of action links available following a single theme update. diff --git a/src/wp-admin/includes/class-walker-nav-menu-edit.php b/src/wp-admin/includes/class-walker-nav-menu-edit.php index 29f579ab93..ad37de2629 100644 --- a/src/wp-admin/includes/class-walker-nav-menu-edit.php +++ b/src/wp-admin/includes/class-walker-nav-menu-edit.php @@ -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 { type && false !== $original_title ) : ?> diff --git a/src/wp-admin/includes/class-wp-automatic-updater.php b/src/wp-admin/includes/class-wp-automatic-updater.php index f06959d69d..b6213cca2a 100644 --- a/src/wp-admin/includes/class-wp-automatic-updater.php +++ b/src/wp-admin/includes/class-wp-automatic-updater.php @@ -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)…' ), $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++; } diff --git a/src/wp-admin/includes/class-wp-comments-list-table.php b/src/wp-admin/includes/class-wp-comments-list-table.php index 72a7668ba4..d6a23ae523 100644 --- a/src/wp-admin/includes/class-wp-comments-list-table.php +++ b/src/wp-admin/includes/class-wp-comments-list-table.php @@ -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 ), diff --git a/src/wp-admin/includes/class-wp-filesystem-ftpext.php b/src/wp-admin/includes/class-wp-filesystem-ftpext.php index 53b1899666..86a1c3d03e 100644 --- a/src/wp-admin/includes/class-wp-filesystem-ftpext.php +++ b/src/wp-admin/includes/class-wp-filesystem-ftpext.php @@ -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'] ) diff --git a/src/wp-admin/includes/class-wp-filesystem-ftpsockets.php b/src/wp-admin/includes/class-wp-filesystem-ftpsockets.php index 0482663a65..c37b36cab7 100644 --- a/src/wp-admin/includes/class-wp-filesystem-ftpsockets.php +++ b/src/wp-admin/includes/class-wp-filesystem-ftpsockets.php @@ -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'] ) diff --git a/src/wp-admin/includes/class-wp-filesystem-ssh2.php b/src/wp-admin/includes/class-wp-filesystem-ssh2.php index 39d830d076..d93d709359 100644 --- a/src/wp-admin/includes/class-wp-filesystem-ssh2.php +++ b/src/wp-admin/includes/class-wp-filesystem-ssh2.php @@ -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 ) diff --git a/src/wp-admin/includes/class-wp-links-list-table.php b/src/wp-admin/includes/class-wp-links-list-table.php index e4b883547d..1e36038ef9 100644 --- a/src/wp-admin/includes/class-wp-links-list-table.php +++ b/src/wp-admin/includes/class-wp-links-list-table.php @@ -170,7 +170,10 @@ class WP_Links_List_Table extends WP_List_Table { public function column_cb( $link ) { ?> ' . __( 'Edit' ) . ''; - $actions['delete'] = "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' ) . ''; + $actions['delete'] = sprintf( + '%s', + wp_nonce_url( "link.php?action=delete&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 ); } } diff --git a/src/wp-admin/includes/class-wp-list-table.php b/src/wp-admin/includes/class-wp-list-table.php index 6923da55bc..b20cb5b73d 100644 --- a/src/wp-admin/includes/class-wp-list-table.php +++ b/src/wp-admin/includes/class-wp-list-table.php @@ -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 = '' . sprintf( _n( '%s item', '%s items', $total_items ), number_format_i18n( $total_items ) ) . ''; + $output = '' . sprintf( + /* translators: %s: number of items */ + _n( '%s item', '%s items', $total_items ), + number_format_i18n( $total_items ) + ) . ''; $current = $this->get_pagenum(); $removable_query_args = wp_removable_query_args(); @@ -858,7 +876,12 @@ class WP_List_Table { ); } $html_total_pages = sprintf( "%s", 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[] = ''; @@ -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'] ) ); diff --git a/src/wp-admin/includes/class-wp-media-list-table.php b/src/wp-admin/includes/class-wp-media-list-table.php index 86d668a5a7..d54f9eb1f7 100644 --- a/src/wp-admin/includes/class-wp-media-list-table.php +++ b/src/wp-admin/includes/class-wp-media-list-table.php @@ -356,7 +356,10 @@ class WP_Media_List_Table extends WP_List_Table { if ( current_user_can( 'edit_post', $post->ID ) ) { ?> (%s)', 'All (%s)', $count, 'themes' ); + /* translators: %s: number of themes */ + $text = _nx( + 'All (%s)', + 'All (%s)', + $count, + 'themes' + ); break; case 'enabled': - $text = _nx( 'Enabled (%s)', 'Enabled (%s)', $count, 'themes' ); + /* translators: %s: number of themes */ + $text = _nx( + 'Enabled (%s)', + 'Enabled (%s)', + $count, + 'themes' + ); break; case 'disabled': - $text = _nx( 'Disabled (%s)', 'Disabled (%s)', $count, 'themes' ); + /* translators: %s: number of themes */ + $text = _nx( + 'Disabled (%s)', + 'Disabled (%s)', + $count, + 'themes' + ); break; case 'upgrade': - $text = _nx( 'Update Available (%s)', 'Update Available (%s)', $count, 'themes' ); + /* translators: %s: number of themes */ + $text = _nx( + 'Update Available (%s)', + 'Update Available (%s)', + $count, + 'themes' + ); break; case 'broken': - $text = _nx( 'Broken (%s)', 'Broken (%s)', $count, 'themes' ); + /* translators: %s: number of themes */ + $text = _nx( + 'Broken (%s)', + 'Broken (%s)', + $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' ) ) { diff --git a/src/wp-admin/includes/class-wp-ms-users-list-table.php b/src/wp-admin/includes/class-wp-ms-users-list-table.php index 68ab5ae577..e181723585 100644 --- a/src/wp-admin/includes/class-wp-ms-users-list-table.php +++ b/src/wp-admin/includes/class-wp-ms-users-list-table.php @@ -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'] = "" . sprintf( _nx( 'All (%s)', 'All (%s)', $total_users, 'users' ), number_format_i18n( $total_users ) ) . ''; + $role_links['all'] = sprintf( + '%s', + network_admin_url( 'users.php' ), + $current_link_attributes, + sprintf( + /* translators: number of users */ + _nx( + 'All (%s)', + 'All (%s)', + $total_users, + 'users' + ), + number_format_i18n( $total_users ) + ) + ); $current_link_attributes = $role === 'super' ? ' class="current" aria-current="page"' : ''; - $role_links['super'] = "" . sprintf( _n( 'Super Admin (%s)', 'Super Admins (%s)', $total_admins ), number_format_i18n( $total_admins ) ) . ''; + $role_links['super'] = sprintf( + '%s', + network_admin_url( 'users.php?role=super' ), + $current_link_attributes, + sprintf( + /* translators: number of users */ + _n( + 'Super Admin (%s)', + 'Super Admins (%s)', + $total_admins + ), + number_format_i18n( $total_admins ) + ) + ); return $role_links; } @@ -209,7 +236,10 @@ class WP_MS_Users_List_Table extends WP_List_Table { } ?> ' . sprintf( __( 'By %s' ), $author ) . ''; } @@ -723,13 +724,18 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
    - + +
    = 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 ); ?>
    diff --git a/src/wp-admin/includes/class-wp-plugins-list-table.php b/src/wp-admin/includes/class-wp-plugins-list-table.php index fa4f6e21dd..ad19b140f4 100644 --- a/src/wp-admin/includes/class-wp-plugins-list-table.php +++ b/src/wp-admin/includes/class-wp-plugins-list-table.php @@ -429,36 +429,69 @@ class WP_Plugins_List_Table extends WP_List_Table { switch ( $type ) { case 'all': - /* translators: %s: plugin count */ - $text = _nx( 'All (%s)', 'All (%s)', $count, 'plugins' ); + /* translators: %s: number of plugins */ + $text = _nx( + 'All (%s)', + 'All (%s)', + $count, + 'plugins' + ); break; case 'active': - /* translators: %s: plugin count */ - $text = _n( 'Active (%s)', 'Active (%s)', $count ); + /* translators: %s: number of plugins */ + $text = _n( + 'Active (%s)', + 'Active (%s)', + $count + ); break; case 'recently_activated': - /* translators: %s: plugin count */ - $text = _n( 'Recently Active (%s)', 'Recently Active (%s)', $count ); + /* translators: %s: number of plugins */ + $text = _n( + 'Recently Active (%s)', + 'Recently Active (%s)', + $count + ); break; case 'inactive': - /* translators: %s: plugin count */ - $text = _n( 'Inactive (%s)', 'Inactive (%s)', $count ); + /* translators: %s: number of plugins */ + $text = _n( + 'Inactive (%s)', + 'Inactive (%s)', + $count + ); break; case 'mustuse': - /* translators: %s: plugin count */ - $text = _n( 'Must-Use (%s)', 'Must-Use (%s)', $count ); + /* translators: %s: number of plugins */ + $text = _n( + 'Must-Use (%s)', + 'Must-Use (%s)', + $count + ); break; case 'dropins': - /* translators: %s: plugin count */ - $text = _n( 'Drop-in (%s)', 'Drop-ins (%s)', $count ); + /* translators: %s: number of plugins */ + $text = _n( + 'Drop-in (%s)', + 'Drop-ins (%s)', + $count + ); break; case 'paused': - /* translators: %s: plugin count */ - $text = _n( 'Paused (%s)', 'Paused (%s)', $count ); + /* translators: %s: number of plugins */ + $text = _n( + 'Paused (%s)', + 'Paused (%s)', + $count + ); break; case 'upgrade': - /* translators: %s: plugin count */ - $text = _n( 'Update Available (%s)', 'Update Available (%s)', $count ); + /* translators: %s: number of plugins */ + $text = _n( + 'Update Available (%s)', + 'Update Available (%s)', + $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 = "' - . ""; + $checkbox = sprintf( + '' . + '', + $checkbox_id, + /* translators: %s: plugin name */ + sprintf( __( 'Select %s' ), $plugin_data['Name'] ), + esc_attr( $plugin_file ) + ); } if ( 'dropins' != $context ) { $description = '

    ' . ( $plugin_data['Description'] ? $plugin_data['Description'] : ' ' ) . '

    '; diff --git a/src/wp-admin/includes/class-wp-posts-list-table.php b/src/wp-admin/includes/class-wp-posts-list-table.php index 64118b95c2..3f95a2e7a8 100644 --- a/src/wp-admin/includes/class-wp-posts-list-table.php +++ b/src/wp-admin/includes/class-wp-posts-list-table.php @@ -305,6 +305,7 @@ class WP_Posts_List_Table extends WP_List_Table { ); $mine_inner_html = sprintf( + /* translators: %s: number of posts */ _nx( 'Mine (%s)', 'Mine (%s)', @@ -325,6 +326,7 @@ class WP_Posts_List_Table extends WP_List_Table { } $all_inner_html = sprintf( + /* translators: %s: number of posts */ _nx( 'All (%s)', 'All (%s)', @@ -374,6 +376,7 @@ class WP_Posts_List_Table extends WP_List_Table { ); $sticky_inner_html = sprintf( + /* translators: %s: number of posts */ _nx( 'Sticky (%s)', 'Sticky (%s)', @@ -917,7 +920,10 @@ class WP_Posts_List_Table extends WP_List_Table { if ( current_user_can( 'edit_post', $post->ID ) ) : ?>
    @@ -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 ); diff --git a/src/wp-admin/includes/class-wp-privacy-policy-content.php b/src/wp-admin/includes/class-wp-privacy-policy-content.php index 6e823d6692..723986e99f 100644 --- a/src/wp-admin/includes/class-wp-privacy-policy-content.php +++ b/src/wp-admin/includes/class-wp-privacy-policy-content.php @@ -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 = '

    ' . sprintf( $removed, $date ) . '

    '; } 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 .= '
    '; $content .= ''; $content .= '
    '; } diff --git a/src/wp-admin/includes/class-wp-privacy-requests-table.php b/src/wp-admin/includes/class-wp-privacy-requests-table.php index dc49e91288..125e6bae9a 100644 --- a/src/wp-admin/includes/class-wp-privacy-requests-table.php +++ b/src/wp-admin/includes/class-wp-privacy-requests-table.php @@ -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 ) ); } diff --git a/src/wp-admin/includes/class-wp-screen.php b/src/wp-admin/includes/class-wp-screen.php index c6f47a5179..a54cfca527 100644 --- a/src/wp-admin/includes/class-wp-screen.php +++ b/src/wp-admin/includes/class-wp-screen.php @@ -1162,17 +1162,18 @@ final class WP_Screen { ?>
    - - - + + +
    term_id ) ) { - return '' - . ''; + return sprintf( + '' . + '', + $tag->term_id, + /* translators: %s: term name */ + sprintf( __( 'Select %s' ), $tag->name ) + ); } return ' '; diff --git a/src/wp-admin/includes/class-wp-themes-list-table.php b/src/wp-admin/includes/class-wp-themes-list-table.php index 6635d755d1..81cdffac8b 100644 --- a/src/wp-admin/includes/class-wp-themes-list-table.php +++ b/src/wp-admin/includes/class-wp-themes-list-table.php @@ -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 enable or install 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 enable or install 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 enable 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 enable 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 Install Themes 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 Install Themes 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&template=' . urlencode( $template ) . '&stylesheet=' . urlencode( $stylesheet ), 'switch-theme_' . $stylesheet ); $actions = array(); - $actions['activate'] = '' . __( 'Activate' ) . ''; + $actions['activate'] = sprintf( + '%s', + $activate_link, + /* translators: %s: theme name */ + esc_attr( sprintf( __( 'Activate “%s”' ), $title ) ), + __( 'Activate' ) + ); if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { - $actions['preview'] .= '' - . __( 'Live Preview' ) . ''; + $actions['preview'] .= sprintf( + '%s', + wp_customize_url( $stylesheet ), + __( 'Live Preview' ) + ); } if ( ! is_multisite() && current_user_can( 'delete_themes' ) ) { - $actions['delete'] = '' . __( 'Delete' ) . ''; + $actions['delete'] = sprintf( + '%s', + wp_nonce_url( 'themes.php?action=delete&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 {

    -
    +
    + +
    @@ -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 widgets or menus' ), admin_url( 'widgets.php' ), admin_url( 'nav-menus.php' ) diff --git a/src/wp-admin/includes/deprecated.php b/src/wp-admin/includes/deprecated.php index 45583c102a..f55725491f 100644 --- a/src/wp-admin/includes/deprecated.php +++ b/src/wp-admin/includes/deprecated.php @@ -599,7 +599,9 @@ class WP_User_Search { 'add_args' => $args ) ); if ( $this->paging_text ) { - $this->paging_text = sprintf( '' . __( 'Displaying %s–%s of %s' ) . '%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 */ + '' . __( 'Displaying %1$s–%2$s of %3$s' ) . '%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 ), diff --git a/src/wp-admin/includes/file.php b/src/wp-admin/includes/file.php index bc98129855..78ed0421bf 100644 --- a/src/wp-admin/includes/file.php +++ b/src/wp-admin/includes/file.php @@ -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 ) + ) + ); } /** diff --git a/src/wp-admin/includes/image-edit.php b/src/wp-admin/includes/image-edit.php index 95a97232f2..711c95ca85 100644 --- a/src/wp-admin/includes/image-edit.php +++ b/src/wp-admin/includes/image-edit.php @@ -57,7 +57,15 @@ function wp_image_editor( $post_id, $msg = false ) {

    -

    +

    + +

    @@ -85,14 +93,13 @@ function wp_image_editor( $post_id, $msg = false ) {

    - + if ( ! defined( 'IMAGE_EDIT_OVERWRITE' ) || ! IMAGE_EDIT_OVERWRITE ) { + echo ' ' . __( 'Previously edited copies of the image will not be deleted.' ); + } + ?>

    , 'restore')" class="button button-primary" value="" /> diff --git a/src/wp-admin/includes/media.php b/src/wp-admin/includes/media.php index 88de8fa60d..1058a1b1b7 100644 --- a/src/wp-admin/includes/media.php +++ b/src/wp-admin/includes/media.php @@ -60,6 +60,7 @@ function update_gallery_tab( $tabs ) { return $tabs; } + /* translators: %s: number of attachments */ $tabs['gallery'] = sprintf( __( 'Gallery (%s)' ), "$attachments" ); 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 ) {

    " . sprintf( __( 'Required fields are marked %s' ), '*' ) . "

    " . + /* translators: %s: an asterisk symbol (*) */ + sprintf( __( 'Required fields are marked %s' ), '*' ) . + "

    ' . $item . '
    '; + /* translators: %s: an asterisk symbol (*) */ + sprintf( __( 'Required fields are marked %s' ), '*' ) . + '

    ' . + '' . $item . '
    '; } 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 '

    ' . sprintf( __( 'The web browser on your device cannot be used to upload files. You may be able to use the native app for your device instead.' ), 'https://apps.wordpress.org/' ) . '

    '; + echo '

    ' . 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 native app for your device instead.' ), + 'https://apps.wordpress.org/' + ) . '

    '; return; } @@ -2130,7 +2140,12 @@ wpUploaderInit = ; ?> -

    +

    + +

       

    -

    ' . sprintf( __( 'Required fields are marked %s' ), '*' ) . '

    +

    ' . + /* translators: %s: an asterisk symbol (*) */ + sprintf( __( 'Required fields are marked %s' ), '*' ) . + '

    @@ -2862,7 +2880,14 @@ function media_upload_flash_bypass() { ?>

    - browser uploader instead.' ), $browser_uploader, '_blank' ); ?> + browser uploader instead.' ), + $browser_uploader, + 'target="_blank"' + ); + ?>

    - link_id", 'delete-bookmark_' . $link->link_id ); ?>" onclick="if ( confirm('link_name ) ); ?>') ) {return true;}return false;"> - + printf( + '%s', + wp_nonce_url( "link.php?action=delete&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' ) + ); + } + ?>
    diff --git a/src/wp-admin/includes/misc.php b/src/wp-admin/includes/misc.php index b4d8ec3a65..97b999010b 100644 --- a/src/wp-admin/includes/misc.php +++ b/src/wp-admin/includes/misc.php @@ -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(); diff --git a/src/wp-admin/includes/ms.php b/src/wp-admin/includes/ms.php index 83b74630cb..283f6aa078 100644 --- a/src/wp-admin/includes/ms.php +++ b/src/wp-admin/includes/ms.php @@ -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 = '

    ' . 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 ) . '

    '; + $output = '

    ' . 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 + ) . '

    '; $output .= '

    ' . __( '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.' ) . '

    '; $output .= '

    ' . __( 'Your Sites' ) . '

    '; @@ -690,7 +701,11 @@ function site_admin_notice() { } if ( get_site_option( 'wpmu_upgrade_site' ) != $wp_db_version ) { - echo "
    " . sprintf( __( 'Thank you for Updating! Please visit the Upgrade Network page to update all your sites.' ), esc_url( network_admin_url( 'upgrade.php' ) ) ) . '
    '; + echo "
    " . sprintf( + /* translators: %s: URL to Upgrade Network screen */ + __( 'Thank you for Updating! Please visit the Upgrade Network page to update all your sites.' ), + esc_url( network_admin_url( 'upgrade.php' ) ) + ) . '
    '; } } @@ -744,7 +759,7 @@ function choose_primary_blog() { ?> - + @@ -912,7 +939,12 @@ function confirm_delete_users( $users ) { $user_dropdown .= "\n"; ?>
      -
    • +
    • + +
    • last_updated ) ) ); ?>
    • @@ -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() { ) ); ?> - + 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() { ?>
      - + %s', + "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 ) + ); + ?> diff --git a/src/wp-admin/includes/plugin.php b/src/wp-admin/includes/plugin.php index caf4e80f47..0a29e0140a 100644 --- a/src/wp-admin/includes/plugin.php +++ b/src/wp-admin/includes/plugin.php @@ -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'] .= ' ' . sprintf( __( 'By %s.' ), $plugin_data['Author'] ) . ''; + $plugin_data['Description'] .= sprintf( + /* translators: %s: plugin author */ + ' ' . __( 'By %s.' ) . '', + $plugin_data['Author'] + ); } } diff --git a/src/wp-admin/includes/revision.php b/src/wp-admin/includes/revision.php index 530fa60e45..ead84a7fee 100644 --- a/src/wp-admin/includes/revision.php +++ b/src/wp-admin/includes/revision.php @@ -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() { ' ); @@ -406,6 +409,7 @@ function wp_print_revision_templates() { ' ); @@ -415,6 +419,7 @@ function wp_print_revision_templates() { ' ); diff --git a/src/wp-admin/includes/template.php b/src/wp-admin/includes/template.php index 8740c5959c..eeb7a1b10b 100644 --- a/src/wp-admin/includes/template.php +++ b/src/wp-admin/includes/template.php @@ -531,10 +531,22 @@ function wp_comment_reply( $position = 1, $checkbox = false, $mode = 'single', $ function wp_comment_trashnotice() { ?>

      - () + %s (%s)', + __( 'Choose a file from your computer:' ), + /* translators: %s: maximum allowed file size */ + sprintf( __( 'Maximum size: %s' ), $size ) + ); + ?> @@ -1289,7 +1308,11 @@ function do_meta_boxes( $screen, $context, $object ) { } echo ''; } @@ -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' ) diff --git a/src/wp-admin/includes/theme.php b/src/wp-admin/includes/theme.php index 97a02fd25e..053bf696d8 100644 --- a/src/wp-admin/includes/theme.php +++ b/src/wp-admin/includes/theme.php @@ -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 */ '

      ' . __( 'There is a new version of %1$s available. View version %4$s details.' ) . '

      ', $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 */ '

      ' . __( 'There is a new version of %1$s available. View version %4$s details. Automatic update is unavailable for this theme.' ) . '

      ', $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 */ '

      ' . __( 'There is a new version of %1$s available. View version %4$s details or update now.' ) . '

      ', $theme_name, esc_url( $details_url ), @@ -717,8 +721,18 @@ function customize_themes_print_templates() { <# if ( data.active ) { #> <# } #> -

      {{{ data.name }}}

      -

      +

      {{{ data.name }}} + +

      +

      + +

      <# if ( data.stars && 0 != data.num_ratings ) { #>
      @@ -745,7 +759,15 @@ function customize_themes_print_templates() { <# } #> <# if ( data.parent ) { #> -

      {{{ data.parent }}}' ); ?>

      +

      + {{{ data.parent }}}' + ); + ?> +

      <# } #>

      {{{ data.description }}}

      diff --git a/src/wp-admin/includes/update-core.php b/src/wp-admin/includes/update-core.php index 491ca7e783..caa65f1018 100644 --- a/src/wp-admin/includes/update-core.php +++ b/src/wp-admin/includes/update-core.php @@ -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( '' . sprintf( __( 'Welcome to WordPress %1$s. You will be redirected to the About WordPress screen. If not, click here.' ), $new_version, 'about.php?updated' ) . '' ); - show_message( '' . sprintf( __( 'Welcome to WordPress %1$s. Learn more.' ), $new_version, 'about.php?updated' ) . '' ); + show_message( + '' . 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 here.' ), + $new_version, + 'about.php?updated' + ) . '' + ); + show_message( + '' . sprintf( + /* translators: 1: WordPress version, 2: URL to About screen */ + __( 'Welcome to WordPress %1$s. Learn more.' ), + $new_version, + 'about.php?updated' + ) . '' + ); echo '
      '; ?>