Skip to content

Commit f6d2c30

Browse files
committed
Network Setup: don't use <code> in translation strings in wp-admin/network files.
Props ramiy. Fixes #31840. git-svn-id: https://develop.svn.wordpress.org/trunk@34292 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 308179c commit f6d2c30

2 files changed

Lines changed: 75 additions & 20 deletions

File tree

src/wp-admin/includes/network.php

Lines changed: 67 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ function network_step1( $errors = false ) {
120120
$has_ports = strstr( $hostname, ':' );
121121
if ( ( false !== $has_ports && ! in_array( $has_ports, array( ':80', ':443' ) ) ) ) {
122122
echo '<div class="error"><p><strong>' . __( 'ERROR:') . '</strong> ' . __( 'You cannot install a network of sites with your server address.' ) . '</p></div>';
123-
echo '<p>' . sprintf( __( 'You cannot use port numbers such as <code>%s</code>.' ), $has_ports ) . '</p>';
123+
echo '<p>' . sprintf( __( 'You cannot use port numbers such as %s.' ), '<code>' . $has_ports . '</code>' ) . '</p>';
124124
echo '<a href="' . esc_url( admin_url() ) . '">' . __( 'Return to Dashboard' ) . '</a>';
125125
echo '</div>';
126126
include( ABSPATH . 'wp-admin/admin-footer.php' );
@@ -197,12 +197,22 @@ function network_step1( $errors = false ) {
197197
if ( $is_www ) :
198198
?>
199199
<h3><?php esc_html_e( 'Server Address' ); ?></h3>
200-
<p><?php printf( __( 'We recommend you change your siteurl to <code>%1$s</code> before enabling the network feature. It will still be possible to visit your site using the <code>www</code> prefix with an address like <code>%2$s</code> but any links will not have the <code>www</code> prefix.' ), substr( $hostname, 4 ), $hostname ); ?></p>
200+
<p><?php printf(
201+
/* translators: 1: site url 2: host name 3. www */
202+
__( 'We recommend you change your siteurl to %1$s before enabling the network feature. It will still be possible to visit your site using the %3$s prefix with an address like %2$s but any links will not have the %3$s prefix.' ),
203+
'<code>' . substr( $hostname, 4 ) . '</code>',
204+
'<code>' . $hostname . '</code>',
205+
'<code>www</code>'
206+
); ?></p>
201207
<table class="form-table">
202208
<tr>
203209
<th scope='row'><?php esc_html_e( 'Server Address' ); ?></th>
204210
<td>
205-
<?php printf( __( 'The internet address of your network will be <code>%s</code>.' ), $hostname ); ?>
211+
<?php printf(
212+
/* translators: host name */
213+
__( 'The internet address of your network will be %s.' ),
214+
'<code>' . $hostname . '</code>'
215+
); ?>
206216
</td>
207217
</tr>
208218
</table>
@@ -242,7 +252,11 @@ function network_step1( $errors = false ) {
242252
<tr>
243253
<th scope='row'><?php esc_html_e( 'Server Address' ); ?></th>
244254
<td>
245-
<?php printf( __( 'The internet address of your network will be <code>%s</code>.' ), $hostname ); ?>
255+
<?php printf(
256+
/* translators: host name */
257+
__( 'The internet address of your network will be %s.' ),
258+
'<code>' . $hostname . '</code>'
259+
); ?>
246260
</td>
247261
</tr>
248262
<?php endif; ?>
@@ -331,18 +345,38 @@ function network_step2( $errors = false ) {
331345
<h3><?php esc_html_e( 'Enabling the Network' ); ?></h3>
332346
<p><?php _e( 'Complete the following steps to enable the features for creating a network of sites.' ); ?></p>
333347
<div class="updated inline"><p><?php
334-
if ( file_exists( $home_path . '.htaccess' ) )
335-
printf( __( '<strong>Caution:</strong> We recommend you back up your existing <code>wp-config.php</code> and <code>%s</code> files.' ), '.htaccess' );
336-
elseif ( file_exists( $home_path . 'web.config' ) )
337-
printf( __( '<strong>Caution:</strong> We recommend you back up your existing <code>wp-config.php</code> and <code>%s</code> files.' ), 'web.config' );
338-
else
339-
_e( '<strong>Caution:</strong> We recommend you back up your existing <code>wp-config.php</code> file.' );
348+
if ( file_exists( $home_path . '.htaccess' ) ) {
349+
printf(
350+
/* translators: 1: wp-config.php 2: .htaccess */
351+
__( '<strong>Caution:</strong> We recommend you back up your existing %1$s and %2$s files.' ),
352+
'<code>wp-config.php</code>',
353+
'<code>.htaccess</code>'
354+
);
355+
} elseif ( file_exists( $home_path . 'web.config' ) ) {
356+
printf(
357+
/* translators: 1: wp-config.php 2: web.config */
358+
__( '<strong>Caution:</strong> We recommend you back up your existing %1$s and %2$s files.' ),
359+
'<code>wp-config.php</code>',
360+
'<code>web.config</code>'
361+
);
362+
} else {
363+
printf(
364+
/* translators: 1: wp-config.php */
365+
__( '<strong>Caution:</strong> We recommend you back up your existing %s file.' ),
366+
'<code>wp-config.php</code>'
367+
);
368+
}
340369
?></p></div>
341370
<?php
342371
}
343372
?>
344373
<ol>
345-
<li><p><?php printf( __( 'Add the following to your <code>wp-config.php</code> file in <code>%s</code> <strong>above</strong> the line reading <code>/* That&#8217;s all, stop editing! Happy blogging. */</code>:' ), $location_of_wp_config ); ?></p>
374+
<li><p><?php printf(
375+
/* translators: 1: wp-config.php 2: location of wp-config file */
376+
__( 'Add the following to your %1$s file in %2$s <strong>above</strong> the line reading <code>/* That&#8217;s all, stop editing! Happy blogging. */</code>:' ),
377+
'<code>wp-config.php</code>',
378+
'<code>' . $location_of_wp_config . '</code>'
379+
); ?></p>
346380
<textarea class="code" readonly="readonly" cols="100" rows="7">
347381
define('MULTISITE', true);
348382
define('SUBDOMAIN_INSTALL', <?php echo $subdomain_install ? 'true' : 'false'; ?>);
@@ -376,9 +410,17 @@ function network_step2( $errors = false ) {
376410
<p>
377411
<?php
378412
if ( 1 == $num_keys_salts ) {
379-
_e( 'This unique authentication key is also missing from your <code>wp-config.php</code> file.' );
413+
printf(
414+
/* translators: 1: wp-config.php */
415+
__( 'This unique authentication key is also missing from your %s file.' ),
416+
'<code>wp-config.php</code>'
417+
);
380418
} else {
381-
_e( 'These unique authentication keys are also missing from your <code>wp-config.php</code> file.' );
419+
printf(
420+
/* translators: 1: wp-config.php */
421+
__( 'These unique authentication keys are also missing from your %s file.' ),
422+
'<code>wp-config.php</code>'
423+
);
382424
}
383425
?>
384426
<?php _e( 'To make your installation more secure, you should also add:' ); ?>
@@ -443,9 +485,12 @@ function network_step2( $errors = false ) {
443485
';
444486

445487
echo '<li><p>';
446-
/* translators: 1: a filename like .htaccess. 2: a file path. */
447-
printf( __( 'Add the following to your %1$s file in %2$s, <strong>replacing</strong> other WordPress rules:' ),
448-
'<code>web.config</code>', '<code>' . $home_path . '</code>' );
488+
printf(
489+
/* translators: 1: a filename like .htaccess. 2: a file path. */
490+
__( 'Add the following to your %1$s file in %2$s, <strong>replacing</strong> other WordPress rules:' ),
491+
'<code>web.config</code>',
492+
'<code>' . $home_path . '</code>'
493+
);
449494
echo '</p>';
450495
if ( ! $subdomain_install && WP_CONTENT_DIR != ABSPATH . 'wp-content' )
451496
echo '<p><strong>' . __('Warning:') . ' ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '</strong></p>';
@@ -480,9 +525,12 @@ function network_step2( $errors = false ) {
480525
EOF;
481526

482527
echo '<li><p>';
483-
/* translators: 1: a filename like .htaccess. 2: a file path. */
484-
printf( __( 'Add the following to your %1$s file in %2$s, <strong>replacing</strong> other WordPress rules:' ),
485-
'<code>.htaccess</code>', '<code>' . $home_path . '</code>' );
528+
printf(
529+
/* translators: 1: a filename like .htaccess. 2: a file path. */
530+
__( 'Add the following to your %1$s file in %2$s, <strong>replacing</strong> other WordPress rules:' ),
531+
'<code>.htaccess</code>',
532+
'<code>' . $home_path . '</code>'
533+
);
486534
echo '</p>';
487535
if ( ! $subdomain_install && WP_CONTENT_DIR != ABSPATH . 'wp-content' )
488536
echo '<p><strong>' . __('Warning:') . ' ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '</strong></p>';

src/wp-admin/network.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,14 @@
3838
}
3939

4040
if ( ! network_domain_check() && ( ! defined( 'WP_ALLOW_MULTISITE' ) || ! WP_ALLOW_MULTISITE ) ) {
41-
wp_die( __( 'You must define the <code>WP_ALLOW_MULTISITE</code> constant as true in your wp-config.php file to allow creation of a Network.' ) );
41+
wp_die(
42+
printf(
43+
/* translators: 1: WP_ALLOW_MULTISITE 2: wp-config.php */
44+
__( 'You must define the %1$s constant as true in your %2$s file to allow creation of a Network.' ),
45+
'<code>WP_ALLOW_MULTISITE</code>',
46+
'<code>wp-config.php</code>'
47+
)
48+
);
4249
}
4350

4451
if ( is_network_admin() ) {

0 commit comments

Comments
 (0)