I18N: Replace hardcoded file name in translatable strings in `wp-admin/setup-config.php` with a placeholder.

Props ramiy, danieltj.
Fixes #42161.
Built from https://develop.svn.wordpress.org/trunk@41904


git-svn-id: http://core.svn.wordpress.org/trunk@41738 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2017-10-18 15:27:53 +00:00
parent d8f98b3649
commit 16bee559d4
2 changed files with 19 additions and 11 deletions

View File

@ -41,27 +41,35 @@ require_once( ABSPATH . 'wp-admin/includes/translation-install.php' );
nocache_headers();
// Support wp-config-sample.php one level up, for the develop repo.
if ( file_exists( ABSPATH . 'wp-config-sample.php' ) )
if ( file_exists( ABSPATH . 'wp-config-sample.php' ) ) {
$config_file = file( ABSPATH . 'wp-config-sample.php' );
elseif ( file_exists( dirname( ABSPATH ) . '/wp-config-sample.php' ) )
} elseif ( file_exists( dirname( ABSPATH ) . '/wp-config-sample.php' ) ) {
$config_file = file( dirname( ABSPATH ) . '/wp-config-sample.php' );
else
wp_die( __( 'Sorry, I need a wp-config-sample.php file to work from. Please re-upload this file to your WordPress installation.' ) );
} else {
wp_die( sprintf(
/* translators: %s: wp-config-sample.php */
__( 'Sorry, I need a %s file to work from. Please re-upload this file to your WordPress installation.' ),
'<code>wp-config-sample.php</code>'
) );
}
// Check if wp-config.php has been created
if ( file_exists( ABSPATH . 'wp-config.php' ) )
if ( file_exists( ABSPATH . 'wp-config.php' ) ) {
wp_die( '<p>' . sprintf(
/* translators: %s: install.php */
__( "The file 'wp-config.php' already exists. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href='%s'>installing now</a>." ),
/* translators: 1: wp-config.php 2: install.php */
__( 'The file %1$s already exists. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href="%2$s">installing now</a>.' ),
'<code>wp-config.php</code>',
'install.php'
) . '</p>'
);
}
// Check if wp-config.php exists above the root directory but is not part of another installation
if ( @file_exists( ABSPATH . '../wp-config.php' ) && ! @file_exists( ABSPATH . '../wp-settings.php' ) ) {
wp_die( '<p>' . sprintf(
/* translators: %s: install.php */
__( "The file 'wp-config.php' already exists one level above your WordPress installation. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href='%s'>installing now</a>." ),
/* translators: 1: wp-config.php 2: install.php */
__( 'The file %1$s already exists one level above your WordPress installation. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href="%2$s">installing now</a>.' ),
'<code>wp-config.php</code>',
'install.php'
) . '</p>'
);
@ -363,7 +371,7 @@ switch($step) {
?></p>
<p><?php
/* translators: %s: wp-config.php */
printf( __( 'You can create the %s manually and paste the following text into it.' ), '<code>wp-config.php</code>' );
printf( __( 'You can create the %s file manually and paste the following text into it.' ), '<code>wp-config.php</code>' );
?></p>
<textarea id="wp-config" cols="98" rows="15" class="code" readonly="readonly"><?php
foreach ( $config_file as $line ) {

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.9-beta2-41903';
$wp_version = '4.9-beta2-41904';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.