I18n: Begin introducing translator comments for strings which include placeholders but no accompanying translator comment.

Adds context to one string used in two different contexts for the new user and new site signup email notification.

More to come.

See #38882

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


git-svn-id: http://core.svn.wordpress.org/trunk@39263 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
John Blackbourn 2016-11-21 01:22:32 +00:00
parent 5b97952cab
commit 4cf5550d8d
17 changed files with 65 additions and 17 deletions

View File

@ -200,6 +200,7 @@ function core_update_footer( $msg = '' ) {
switch ( $cur->response ) {
case 'development' :
/* translators: 1: WordPress version number, 2: WordPress updates admin screen URL */
return sprintf( __( 'You are using a development version (%1$s). Cool! Please <a href="%2$s">stay updated</a>.' ), get_bloginfo( 'version', 'display' ), network_admin_url( 'update-core.php' ) );
case 'upgrade' :

View File

@ -375,6 +375,7 @@ function wp_new_blog_notification($blog_title, $blog_url, $user_id, $password) {
$email = $user->user_email;
$name = $user->user_login;
$login_url = wp_login_url();
/* translators: New site notification email. 1: New site URL, 2: User login, 3: User password or password reset link, 4: Login URL */
$message = sprintf( __( "Your new WordPress site has been successfully set up at:
%1\$s

View File

@ -232,12 +232,16 @@ $mysql_version = $wpdb->db_version();
$php_compat = version_compare( $php_version, $required_php_version, '>=' );
$mysql_compat = version_compare( $mysql_version, $required_mysql_version, '>=' ) || file_exists( WP_CONTENT_DIR . '/db.php' );
if ( !$mysql_compat && !$php_compat )
if ( !$mysql_compat && !$php_compat ) {
/* 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 */
$compat = sprintf( __( 'You cannot install because <a href="https://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> 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 );
elseif ( !$php_compat )
} elseif ( !$php_compat ) {
/* translators: 1: WordPress version number, 2: Minimum required PHP version number, 3: Current PHP version number */
$compat = sprintf( __( 'You cannot install because <a href="https://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires PHP version %2$s or higher. You are running version %3$s.' ), $wp_version, $required_php_version, $php_version );
elseif ( !$mysql_compat )
} elseif ( !$mysql_compat ) {
/* translators: 1: WordPress version number, 2: Minimum required MySQL version number, 3: Current MySQL version number */
$compat = sprintf( __( 'You cannot install because <a href="https://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires MySQL version %2$s or higher. You are running version %3$s.' ), $wp_version, $required_mysql_version, $mysql_version );
}
if ( !$mysql_compat || !$php_compat ) {
display_header();

View File

@ -518,6 +518,7 @@ if ( ! current_theme_supports( 'menus' ) && ! $num_locations )
if ( ! $locations_screen ) : // Main tab
$overview = '<p>' . __( 'This screen is used for managing your custom navigation menus.' ) . '</p>';
/* translators: 1: Widgets admin screen URL, 2 and 3: The name of the default themes */
$overview .= '<p>' . sprintf( __( 'Menus can be displayed in locations defined by your theme, even used in sidebars by adding a &#8220;Custom Menu&#8221; widget on the <a href="%1$s">Widgets</a> screen. If your theme does not support the custom menus feature (the default themes, %2$s and %3$s, do), you can learn about adding this support by following the Documentation link to the side.' ), admin_url( 'widgets.php' ), 'Twenty Sixteen', 'Twenty Seventeen' ) . '</p>';
$overview .= '<p>' . __( 'From this screen you can:' ) . '</p>';
$overview .= '<ul><li>' . __( 'Create, edit, and delete menus' ) . '</li>';

View File

@ -107,6 +107,7 @@ $default_comments_page .= '>' . __('last') . '</option><option value="oldest"';
if ( 'oldest' == get_option('default_comments_page') ) $default_comments_page .= ' selected="selected"';
$default_comments_page .= '>' . __('first') . '</option></select>';
/* translators: 1: Form field control for number of top level comments per page, 2: Form field control for the 'first' or 'last' page */
printf( __('Break comments into pages with %1$s top level comments per page and the %2$s page displayed by default'), '</label><label for="comments_per_page"><input name="comments_per_page" type="number" step="1" min="0" id="comments_per_page" value="' . esc_attr(get_option('comments_per_page')) . '" class="small-text" />', $default_comments_page );
?></label>

View File

@ -74,6 +74,7 @@ default :
$post_edit_link = get_edit_post_link();
$post_title = '<a href="' . $post_edit_link . '">' . _draft_or_post_title() . '</a>';
/* translators: 1: Post title */
$h1 = sprintf( __( 'Compare Revisions of &#8220;%1$s&#8221;' ), $post_title );
$return_to_post = '<a href="' . $post_edit_link . '">' . __( '&larr; Return to editor' ) . '</a>';
$title = __( 'Revisions' );

View File

@ -68,12 +68,16 @@ function list_core_update( $update ) {
$mysql_compat = version_compare( $mysql_version, $update->mysql_version, '>=' );
if ( !$mysql_compat && !$php_compat )
/* 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 */
$message = sprintf( __('You cannot update because <a href="https://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> 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.'), $update->current, $update->php_version, $update->mysql_version, $php_version, $mysql_version );
elseif ( !$php_compat )
/* translators: 1: WordPress version number, 2: Minimum required PHP version number, 3: Current PHP version number */
$message = sprintf( __('You cannot update because <a href="https://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires PHP version %2$s or higher. You are running version %3$s.'), $update->current, $update->php_version, $php_version );
elseif ( !$mysql_compat )
/* translators: 1: WordPress version number, 2: Minimum required MySQL version number, 3: Current MySQL version number */
$message = sprintf( __('You cannot update because <a href="https://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires MySQL version %2$s or higher. You are running version %3$s.'), $update->current, $update->mysql_version, $mysql_version );
else
/* translators: 1: WordPress version number, 2: WordPress version number including locale if necessary */
$message = sprintf(__('You can update to <a href="https://codex.wordpress.org/Version_%1$s">WordPress %2$s</a> automatically:'), $update->current, $version_string);
if ( !$mysql_compat || !$php_compat )
$show_buttons = false;
@ -658,6 +662,8 @@ if ( 'upgrade-core' == $action ) {
if ( ! current_user_can( 'update_plugins' ) )
wp_die( __( 'Sorry, you are not allowed to update this site.' ) );
// @TODO
check_admin_referer('upgrade-core');
if ( isset( $_GET['plugins'] ) ) {

View File

@ -28,12 +28,16 @@ do_action( 'rss_tag_pre', 'atom-comments' );
?>
>
<title type="text"><?php
if ( is_singular() )
if ( is_singular() ) {
/* translators: Comments feed title. 1: Post title */
printf( ent2ncr( __( 'Comments on %s' ) ), get_the_title_rss() );
elseif ( is_search() )
} elseif ( is_search() ) {
/* translators: Comments feed title. 1: Site name, 2: Search query */
printf( ent2ncr( __( 'Comments for %1$s searching on %2$s' ) ), get_bloginfo_rss( 'name' ), get_search_query() );
else
} else {
/* translators: Comments feed title. 1: Site name */
printf( ent2ncr( __( 'Comments for %s' ) ), get_wp_title_rss() );
}
?></title>
<subtitle type="text"><?php bloginfo_rss('description'); ?></subtitle>
@ -73,8 +77,10 @@ if ( have_comments() ) : while ( have_comments() ) : the_comment();
$title = get_the_title($comment_post->ID);
/** This filter is documented in wp-includes/feed.php */
$title = apply_filters( 'the_title_rss', $title );
/* translators: Individual comment title. 1: Post title, 2: Comment author name */
printf(ent2ncr(__('Comment on %1$s by %2$s')), $title, get_comment_author_rss());
} else {
/* translators: Comment author title. 1: Comment author name */
printf(ent2ncr(__('By: %s')), get_comment_author_rss());
}
?></title>

View File

@ -33,12 +33,16 @@ do_action( 'rss_tag_pre', 'rss2-comments' );
>
<channel>
<title><?php
if ( is_singular() )
if ( is_singular() ) {
/* translators: Comments feed title. 1: Post title */
printf( ent2ncr( __( 'Comments on: %s' ) ), get_the_title_rss() );
elseif ( is_search() )
} elseif ( is_search() ) {
/* translators: Comments feed title. 1: Site name, 2: Search query */
printf( ent2ncr( __( 'Comments for %1$s searching on %2$s' ) ), get_bloginfo_rss( 'name' ), get_search_query() );
else
} else {
/* translators: Comments feed title. 1: Site name */
printf( ent2ncr( __( 'Comments for %s' ) ), get_wp_title_rss() );
}
?></title>
<atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
<link><?php (is_single()) ? the_permalink_rss() : bloginfo_rss("url") ?></link>
@ -72,8 +76,10 @@ do_action( 'rss_tag_pre', 'rss2-comments' );
$title = get_the_title($comment_post->ID);
/** This filter is documented in wp-includes/feed.php */
$title = apply_filters( 'the_title_rss', $title );
/* translators: Individual comment title. 1: Post title, 2: Comment author name */
printf(ent2ncr(__('Comment on %1$s by %2$s')), $title, get_comment_author_rss());
} else {
/* translators: Comment author title. 1: Comment author name */
printf(ent2ncr(__('By: %s')), get_comment_author_rss());
}
?></title>

View File

@ -4087,6 +4087,7 @@ function _doing_it_wrong( $function, $message, $version ) {
$message .= ' ' . sprintf( __( 'Please see <a href="%s">Debugging in WordPress</a> for more information.' ),
__( 'https://codex.wordpress.org/Debugging_in_WordPress' )
);
/* translators: Developer debugging message. 1: PHP function name, 2: Explanatory message, 3: Version information message */
trigger_error( sprintf( __( '%1$s was called <strong>incorrectly</strong>. %2$s %3$s' ), $function, $message, $version ) );
} else {
if ( is_null( $version ) ) {

View File

@ -128,6 +128,7 @@ function wp_check_php_mysql_versions() {
$protocol = wp_get_server_protocol();
header( sprintf( '%s 500 Internal Server Error', $protocol ), true, 500 );
header( 'Content-Type: text/html; charset=utf-8' );
/* translators: 1: Current PHP version number, 2: WordPress version number, 3: Minimum required PHP version number */
die( sprintf( __( 'Your server is running PHP version %1$s but WordPress %2$s requires at least %3$s.' ), $php_version, $wp_version, $required_php_version ) );
}

View File

@ -846,7 +846,8 @@ function wpmu_signup_blog_notification( $domain, $path, $title, $user_login, $us
* @param array $meta By default, contains the requested privacy setting and lang_id.
*/
apply_filters( 'wpmu_signup_blog_notification_subject',
__( '[%1$s] Activate %2$s' ),
/* translators: New site notification email subject. 1: Network name, 2: New site URL */
_x( '[%1$s] Activate %2$s', 'New site notification email subject' ),
$domain, $path, $title, $user_login, $user_email, $key, $meta
),
$from_name,
@ -939,7 +940,8 @@ function wpmu_signup_user_notification( $user_login, $user_email, $key, $meta =
* @param array $meta Signup meta data.
*/
apply_filters( 'wpmu_signup_user_notification_subject',
__( '[%1$s] Activate %2$s' ),
/* translators: New user notification email subject. 1: Network name, 2: New user login */
_x( '[%1$s] Activate %2$s', 'New user notification email subject' ),
$user_login, $user_email, $key, $meta
),
$from_name,
@ -1202,6 +1204,7 @@ function newblog_notify_siteadmin( $blog_id, $deprecated = '' ) {
$siteurl = site_url();
restore_current_blog();
/* translators: New site notification email. 1: Site URL, 2: User IP address, 3: Settings screen URL */
$msg = sprintf( __( 'New Site: %1$s
URL: %2$s
Remote IP: %3$s
@ -1244,6 +1247,7 @@ function newuser_notify_siteadmin( $user_id ) {
$user = get_userdata( $user_id );
$options_site_url = esc_url(network_admin_url('settings.php'));
/* translators: New user notification email. 1: User login, 2: User IP address, 3: Settings screen URL */
$msg = sprintf(__('New User: %1$s
Remote IP: %2$s
@ -1523,6 +1527,9 @@ We hope you enjoy your new site. Thanks!
if ( empty( $current_network->site_name ) )
$current_network->site_name = 'WordPress';
/* translators: New site notification email subject. 1: Network name, 2: New site name */
$subject = __( 'New %1$s Site: %2$s' );
/**
* Filters the subject of the welcome email after site activation.
*
@ -1530,7 +1537,7 @@ We hope you enjoy your new site. Thanks!
*
* @param string $subject Subject of the email.
*/
$subject = apply_filters( 'update_welcome_subject', sprintf( __( 'New %1$s Site: %2$s' ), $current_network->site_name, wp_unslash( $title ) ) );
$subject = apply_filters( 'update_welcome_subject', sprintf( $subject, $current_network->site_name, wp_unslash( $title ) ) );
wp_mail( $user->user_email, wp_specialchars_decode( $subject ), $message, $message_headers );
if ( $switched_locale ) {
@ -1608,6 +1615,9 @@ function wpmu_welcome_user_notification( $user_id, $password, $meta = array() )
if ( empty( $current_network->site_name ) )
$current_network->site_name = 'WordPress';
/* translators: New user notification email subject. 1: Network name, 2: New user login */
$subject = __( 'New %1$s User: %2$s' );
/**
* Filters the subject of the welcome email after user activation.
*
@ -1615,7 +1625,7 @@ function wpmu_welcome_user_notification( $user_id, $password, $meta = array() )
*
* @param string $subject Subject of the email.
*/
$subject = apply_filters( 'update_welcome_user_subject', sprintf( __( 'New %1$s User: %2$s' ), $current_network->site_name, $user->user_login) );
$subject = apply_filters( 'update_welcome_user_subject', sprintf( $subject, $current_network->site_name, $user->user_login) );
wp_mail( $user->user_email, wp_specialchars_decode( $subject ), $message, $message_headers );
if ( $switched_locale ) {

View File

@ -1626,6 +1626,7 @@ function wp_notify_moderator($comment_id) {
'Currently %s comments are waiting for approval. Please visit the moderation panel:', $comments_waiting), number_format_i18n($comments_waiting) ) . "\r\n";
$notify_message .= admin_url( "edit-comments.php?comment_status=moderated#wpbody-content" ) . "\r\n";
/* translators: Comment moderation notification email subject. 1: Site name, 2: Post title */
$subject = sprintf( __('[%1$s] Please moderate: "%2$s"'), $blogname, $post->post_title );
$message_headers = '';

View File

@ -289,6 +289,7 @@ function wp_default_scripts( &$scripts ) {
'upload_limit_exceeded' => __('You may only upload 1 file.'),
'http_error' => __('HTTP error.'),
'upload_failed' => __('Upload failed.'),
/* translators: 1: Opening link tag, 2: Closing link tag */
'big_upload_failed' => __('Please try uploading this file with the %1$sbrowser uploader%2$s.'),
'big_upload_queued' => __('%s exceeds the maximum upload size for the multi-file uploader when used in your browser.'),
'io_error' => __('IO error.'),

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.7-beta4-39322';
$wp_version = '4.7-beta4-39323';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

View File

@ -1364,10 +1364,13 @@ class wpdb {
wp_load_translations_early();
if ( $caller = $this->get_caller() )
if ( $caller = $this->get_caller() ) {
/* translators: 1: Database error message, 2: SQL query, 3: Name of the calling function */
$error_str = sprintf( __( 'WordPress database error %1$s for query %2$s made by %3$s' ), $str, $this->last_query, $caller );
else
} else {
/* translators: 1: Database error message, 2: SQL query */
$error_str = sprintf( __( 'WordPress database error %1$s for query %2$s' ), $str, $this->last_query );
}
error_log( $error_str );
@ -3213,8 +3216,10 @@ class wpdb {
public function check_database_version() {
global $wp_version, $required_mysql_version;
// Make sure the server has the required MySQL version
if ( version_compare($this->db_version(), $required_mysql_version, '<') )
if ( version_compare($this->db_version(), $required_mysql_version, '<') ) {
/* translators: 1: WordPress version number, 2: Minimum required MySQL version number */
return new WP_Error('database_version', sprintf( __( '<strong>ERROR</strong>: WordPress %1$s requires MySQL %2$s or higher' ), $wp_version, $required_mysql_version ));
}
}
/**

View File

@ -787,10 +787,12 @@ default:
if ( empty( $_COOKIE[ LOGGED_IN_COOKIE ] ) ) {
if ( headers_sent() ) {
/* translators: 1: Browser cookie documentation URL, 2: Support forums URL */
$user = new WP_Error( 'test_cookie', sprintf( __( '<strong>ERROR</strong>: Cookies are blocked due to unexpected output. For help, please see <a href="%1$s">this documentation</a> or try the <a href="%2$s">support forums</a>.' ),
__( 'https://codex.wordpress.org/Cookies' ), __( 'https://wordpress.org/support/' ) ) );
} elseif ( isset( $_POST['testcookie'] ) && empty( $_COOKIE[ TEST_COOKIE ] ) ) {
// If cookies are disabled we can't log in even with a valid user+pass
/* translators: 1: Browser cookie documentation URL */
$user = new WP_Error( 'test_cookie', sprintf( __( '<strong>ERROR</strong>: Cookies are blocked or not supported by your browser. You must <a href="%s">enable cookies</a> to use WordPress.' ),
__( 'https://codex.wordpress.org/Cookies' ) ) );
}