From 4848a09b3593b639bd9c3ccfcd6038e90adf5866 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 11 Mar 2018 16:44:34 +0000 Subject: [PATCH] I18N: Use the actual placeholder instead of a number in translator comments if the corresponding string does not use numbered placeholders. Add missing translator comments in `WP_Theme_Install_List_Table` and `wp_notify_postauthor()`. Add missing commas in some translator comments. Fixes #43523. Built from https://develop.svn.wordpress.org/trunk@42827 git-svn-id: http://core.svn.wordpress.org/trunk@42657 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/admin-header.php | 8 +-- wp-admin/edit-comments.php | 2 +- .../includes/class-bulk-upgrader-skin.php | 8 +-- .../includes/class-language-pack-upgrader.php | 2 +- .../class-wp-plugin-install-list-table.php | 47 +++++++++++--- .../class-wp-theme-install-list-table.php | 61 ++++++++++++++++--- wp-admin/includes/media.php | 8 +-- wp-admin/includes/meta-boxes.php | 18 +++--- wp-admin/includes/ms.php | 8 +-- wp-admin/includes/network.php | 20 +++--- wp-admin/includes/template.php | 6 +- wp-admin/includes/user.php | 2 +- wp-admin/maint/repair.php | 2 +- wp-admin/network/settings.php | 2 +- wp-admin/plugins.php | 2 +- wp-admin/revision.php | 4 +- wp-admin/setup-config.php | 4 +- wp-admin/user-edit.php | 2 +- wp-includes/class-wp-customize-nav-menus.php | 4 +- wp-includes/class-wp-http-curl.php | 2 +- wp-includes/class-wp-http-streams.php | 2 +- wp-includes/comment-template.php | 4 +- ...ass-wp-customize-nav-menu-item-control.php | 2 +- wp-includes/feed-atom-comments.php | 6 +- wp-includes/feed-rss2-comments.php | 6 +- wp-includes/formatting.php | 12 ++-- wp-includes/general-template.php | 16 ++--- wp-includes/load.php | 2 +- wp-includes/ms-functions.php | 3 +- wp-includes/pluggable.php | 51 ++++++++++------ wp-includes/taxonomy.php | 2 +- wp-includes/theme.php | 2 +- wp-includes/update.php | 6 +- wp-includes/user.php | 4 +- wp-includes/version.php | 2 +- .../widgets/class-wp-widget-media-image.php | 2 +- wp-includes/wp-db.php | 2 +- wp-links-opml.php | 2 +- wp-login.php | 2 +- 39 files changed, 211 insertions(+), 129 deletions(-) diff --git a/wp-admin/admin-header.php b/wp-admin/admin-header.php index ed9c0399f9..cbce31b59f 100644 --- a/wp-admin/admin-header.php +++ b/wp-admin/admin-header.php @@ -35,18 +35,18 @@ get_admin_page_title(); $title = esc_html( strip_tags( $title ) ); if ( is_network_admin() ) { - /* translators: Network admin screen title. 1: Network name */ + /* translators: Network admin screen title. %s: Network name */ $admin_title = sprintf( __( 'Network Admin: %s' ), esc_html( get_network()->site_name ) ); } elseif ( is_user_admin() ) { - /* translators: User dashboard screen title. 1: Network name */ + /* translators: User dashboard screen title. %s: Network name */ $admin_title = sprintf( __( 'User Dashboard: %s' ), esc_html( get_network()->site_name ) ); } else { $admin_title = get_bloginfo( 'name' ); } if ( $admin_title == $title ) { - /* translators: Admin screen title. 1: Admin screen name */ - $admin_title = sprintf( __( '%1$s — WordPress' ), $title ); + /* translators: Admin screen title. %s: Admin screen name */ + $admin_title = sprintf( __( '%s — WordPress' ), $title ); } else { /* translators: Admin screen title. 1: Admin screen name, 2: Network or site name */ $admin_title = sprintf( __( '%1$s ‹ %2$s — WordPress' ), $title, $admin_title ); diff --git a/wp-admin/edit-comments.php b/wp-admin/edit-comments.php index 6e91e1754a..6b82c15fe5 100644 --- a/wp-admin/edit-comments.php +++ b/wp-admin/edit-comments.php @@ -146,7 +146,7 @@ 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 */ + /* translators: 1: comments count, 2: post title */ $title = sprintf( __( 'Comments (%1$s) on “%2$s”' ), number_format_i18n( $comments_count->moderated ), diff --git a/wp-admin/includes/class-bulk-upgrader-skin.php b/wp-admin/includes/class-bulk-upgrader-skin.php index 2b2ebd00d5..c1454e62f1 100644 --- a/wp-admin/includes/class-bulk-upgrader-skin.php +++ b/wp-admin/includes/class-bulk-upgrader-skin.php @@ -41,10 +41,10 @@ class Bulk_Upgrader_Skin extends WP_Upgrader_Skin { $this->upgrader->strings['skin_upgrade_start'] = __( 'The update process is starting. This process may take a while on some hosts, so please be patient.' ); /* translators: 1: Title of an update, 2: Error message */ $this->upgrader->strings['skin_update_failed_error'] = __( 'An error occurred while updating %1$s: %2$s' ); - /* translators: 1: Title of an update */ - $this->upgrader->strings['skin_update_failed'] = __( 'The update of %1$s failed.' ); - /* translators: 1: Title of an update */ - $this->upgrader->strings['skin_update_successful'] = __( '%1$s updated successfully.' ); + /* translators: %s: Title of an update */ + $this->upgrader->strings['skin_update_failed'] = __( 'The update of %s failed.' ); + /* translators: %s: Title of an update */ + $this->upgrader->strings['skin_update_successful'] = __( '%s updated successfully.' ); $this->upgrader->strings['skin_upgrade_end'] = __( 'All updates have been completed.' ); } diff --git a/wp-admin/includes/class-language-pack-upgrader.php b/wp-admin/includes/class-language-pack-upgrader.php index a750d8aa3c..118d339d02 100644 --- a/wp-admin/includes/class-language-pack-upgrader.php +++ b/wp-admin/includes/class-language-pack-upgrader.php @@ -337,7 +337,7 @@ class Language_Pack_Upgrader extends WP_Upgrader { if ( ! $mo || ! $po ) { return new WP_Error( 'incompatible_archive_pomo', $this->strings['incompatible_archive'], - /* translators: 1: .po 2: .mo */ + /* translators: 1: .po, 2: .mo */ sprintf( __( 'The language pack is missing either the %1$s or %2$s files.' ), '.po', diff --git a/wp-admin/includes/class-wp-plugin-install-list-table.php b/wp-admin/includes/class-wp-plugin-install-list-table.php index f82180109e..ceb0558c05 100644 --- a/wp-admin/includes/class-wp-plugin-install-list-table.php +++ b/wp-admin/includes/class-wp-plugin-install-list-table.php @@ -504,25 +504,43 @@ class WP_Plugin_Install_List_Table extends WP_List_Table { switch ( $status['status'] ) { case 'install': if ( $status['url'] ) { - /* translators: 1: Plugin name and version. */ - $action_links[] = '' . __( 'Install Now' ) . ''; + $action_links[] = sprintf( + '%s', + esc_attr( $plugin['slug'] ), + esc_url( $status['url'] ), + /* translators: %s: plugin name and version */ + esc_attr( sprintf( __( 'Install %s now' ), $name ) ), + esc_attr( $name ), + __( 'Install Now' ) + ); } break; case 'update_available': if ( $status['url'] ) { - /* translators: 1: Plugin name and version */ - $action_links[] = '' . __( 'Update Now' ) . ''; + $action_links[] = sprintf( + '%s', + esc_attr( $status['file'] ), + esc_attr( $plugin['slug'] ), + esc_url( $status['url'] ), + /* translators: %s: plugin name and version */ + esc_attr( sprintf( __( 'Update %s now' ), $name ) ), + esc_attr( $name ), + __( 'Update Now' ) + ); } break; case 'latest_installed': case 'newer_installed': if ( is_plugin_active( $status['file'] ) ) { - $action_links[] = ''; + $action_links[] = sprintf( + '', + _x( 'Active', 'plugin' ) + ); } elseif ( current_user_can( 'activate_plugin', $status['file'] ) ) { $button_text = __( 'Activate' ); - /* translators: %s: Plugin name */ + /* translators: %s: plugin name */ $button_label = _x( 'Activate %s', 'plugin' ); $activate_url = add_query_arg( array( @@ -534,7 +552,7 @@ class WP_Plugin_Install_List_Table extends WP_List_Table { if ( is_network_admin() ) { $button_text = __( 'Network Activate' ); - /* translators: %s: Plugin name */ + /* translators: %s: plugin name */ $button_label = _x( 'Network Activate %s', 'plugin' ); $activate_url = add_query_arg( array( 'networkwide' => 1 ), $activate_url ); } @@ -546,7 +564,10 @@ class WP_Plugin_Install_List_Table extends WP_List_Table { $button_text ); } else { - $action_links[] = ''; + $action_links[] = sprintf( + '', + _x( 'Installed', 'plugin' ) + ); } break; } @@ -557,8 +578,14 @@ class WP_Plugin_Install_List_Table extends WP_List_Table { '&TB_iframe=true&width=600&height=550' ); - /* translators: 1: Plugin name and version. */ - $action_links[] = '' . __( 'More Details' ) . ''; + $action_links[] = sprintf( + '%s', + esc_url( $details_link ), + /* translators: %s: plugin name and version */ + esc_attr( sprintf( __( 'More information about %s' ), $name ) ), + esc_attr( $name ), + __( 'More Details' ) + ); if ( ! empty( $plugin['icons']['svg'] ) ) { $plugin_icon_url = $plugin['icons']['svg']; diff --git a/wp-admin/includes/class-wp-theme-install-list-table.php b/wp-admin/includes/class-wp-theme-install-list-table.php index 6d107d8d8a..a1ac60b628 100644 --- a/wp-admin/includes/class-wp-theme-install-list-table.php +++ b/wp-admin/includes/class-wp-theme-install-list-table.php @@ -264,6 +264,7 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table { $name = wp_kses( $theme->name, $themes_allowedtags ); $author = wp_kses( $theme->author, $themes_allowedtags ); + /* translators: %s: theme name */ $preview_title = sprintf( __( 'Preview “%s”' ), $name ); $preview_url = add_query_arg( array( @@ -292,19 +293,41 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table { switch ( $status ) { case 'update_available': - $actions[] = '' . __( 'Update' ) . ''; + $actions[] = sprintf( + '%s', + esc_url( wp_nonce_url( $update_url, 'upgrade-theme_' . $theme->slug ) ), + /* translators: %s: theme version */ + esc_attr( sprintf( __( 'Update to version %s' ), $theme->version ) ), + __( 'Update' ) + ); break; case 'newer_installed': case 'latest_installed': - $actions[] = '' . _x( 'Installed', 'theme' ) . ''; + $actions[] = sprintf( + '%s', + esc_attr__( 'This theme is already installed and is up to date' ), + _x( 'Installed', 'theme' ) + ); break; case 'install': default: - $actions[] = '' . __( 'Install Now' ) . ''; + $actions[] = sprintf( + '%s', + esc_url( wp_nonce_url( $install_url, 'install-theme_' . $theme->slug ) ), + /* translators: %s: theme name */ + esc_attr( sprintf( __( 'Install %s' ), $name ) ), + __( 'Install Now' ) + ); break; } - $actions[] = '' . __( 'Preview' ) . ''; + $actions[] = sprintf( + '%s', + esc_url( $preview_url ), + /* translators: %s: theme name */ + esc_attr( sprintf( __( 'Preview %s' ), $name ) ), + __( 'Preview' ) + ); /** * Filters the install action links for a theme in the Install Themes list table. @@ -323,7 +346,10 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table {

-
+