Skip to content

Commit 7839cf6

Browse files
committed
I18n: Improve translators comments [1].
* Add missing translators comments. * Fix placement of some translators comments. Translators comments should be on the line directly above the line containing the translation function call for optimal compatibility with various `.pot` file generation tools. The CS auto-fixing, which changed some inconsistent function calls to multi-line function calls, is part of the reason why this was no longer the case for a select group of translators comments. Patch `44360-src.2.diff` of the series. Props garyj, alvarogois, michielatyoast See #44360 git-svn-id: https://develop.svn.wordpress.org/trunk@43595 602fd350-edb4-49c9-b593-d223f7449a82
1 parent f1862cd commit 7839cf6

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

src/wp-login.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -941,21 +941,21 @@ function retrieve_password() {
941941

942942
if ( empty( $_COOKIE[ LOGGED_IN_COOKIE ] ) ) {
943943
if ( headers_sent() ) {
944-
/* translators: 1: Browser cookie documentation URL, 2: Support forums URL */
945944
$user = new WP_Error(
946945
'test_cookie',
947946
sprintf(
947+
/* translators: 1: Browser cookie documentation URL, 2: Support forums URL */
948948
__( '<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>.' ),
949949
__( 'https://codex.wordpress.org/Cookies' ),
950950
__( 'https://wordpress.org/support/' )
951951
)
952952
);
953953
} elseif ( isset( $_POST['testcookie'] ) && empty( $_COOKIE[ TEST_COOKIE ] ) ) {
954954
// If cookies are disabled we can't log in even with a valid user+pass
955-
/* translators: %s: Browser cookie documentation URL */
956955
$user = new WP_Error(
957956
'test_cookie',
958957
sprintf(
958+
/* translators: %s: Browser cookie documentation URL */
959959
__( '<strong>ERROR</strong>: Cookies are blocked or not supported by your browser. You must <a href="%s">enable cookies</a> to use WordPress.' ),
960960
__( 'https://codex.wordpress.org/Cookies' )
961961
)

src/wp-signup.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,13 +323,19 @@ function signup_another_blog( $blogname = '', $blog_title = '', $errors = '' ) {
323323
$blog_title = $filtered_results['blog_title'];
324324
$errors = $filtered_results['errors'];
325325

326+
/* translators: %s: Network's site name. */
326327
echo '<h2>' . sprintf( __( 'Get <em>another</em> %s site in seconds' ), get_network()->site_name ) . '</h2>';
327328

328329
if ( $errors->has_errors() ) {
329330
echo '<p>' . __( 'There was a problem, please correct the form below and try again.' ) . '</p>';
330331
}
331332
?>
332-
<p><?php printf( __( 'Welcome back, %s. By filling out the form below, you can <strong>add another site to your account</strong>. There is no limit to the number of sites you can have, so create to your heart&#8217;s content, but write responsibly!' ), $current_user->display_name ); ?></p>
333+
<p>
334+
<?php
335+
/* translators: %s: Current user's display name. */
336+
printf( __( 'Welcome back, %s. By filling out the form below, you can <strong>add another site to your account</strong>. There is no limit to the number of sites you can have, so create to your heart&#8217;s content, but write responsibly!' ), $current_user->display_name );
337+
?>
338+
</p>
333339

334340
<?php
335341
$blogs = get_blogs_of_user( $current_user->ID );
@@ -955,13 +961,14 @@ function signup_get_available_languages() {
955961
$newblog = get_blogaddress_by_name( $newblogname );
956962

957963
if ( $active_signup == 'blog' || $active_signup == 'all' ) {
958-
/* translators: %s: site address */
959964
printf(
965+
/* translators: %s: site address */
960966
'<p><em>' . __( 'The site you were looking for, %s, does not exist, but you can create it now!' ) . '</em></p>',
961967
'<strong>' . $newblog . '</strong>'
962968
);
963-
} else { /* translators: %s: site address */
969+
} else {
964970
printf(
971+
/* translators: %s: site address */
965972
'<p><em>' . __( 'The site you were looking for, %s, does not exist.' ) . '</em></p>',
966973
'<strong>' . $newblog . '</strong>'
967974
);

0 commit comments

Comments
 (0)