From facb2fe0ea95e0686584a47946940d0f20742094 Mon Sep 17 00:00:00 2001
From: Sergey Biryukov
Date: Wed, 18 Oct 2017 15:26:10 +0000
Subject: [PATCH] I18N: Replace hardcoded file name in translatable strings in
`wp-admin/setup-config.php` with a placeholder.
Props ramiy, danieltj.
Fixes #42161.
git-svn-id: https://develop.svn.wordpress.org/trunk@41904 602fd350-edb4-49c9-b593-d223f7449a82
---
src/wp-admin/setup-config.php | 28 ++++++++++++++++++----------
1 file changed, 18 insertions(+), 10 deletions(-)
diff --git a/src/wp-admin/setup-config.php b/src/wp-admin/setup-config.php
index e416931d00..47c2b1f7db 100644
--- a/src/wp-admin/setup-config.php
+++ b/src/wp-admin/setup-config.php
@@ -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.' ),
+ 'wp-config-sample.php'
+ ) );
+}
// Check if wp-config.php has been created
-if ( file_exists( ABSPATH . 'wp-config.php' ) )
+if ( file_exists( ABSPATH . 'wp-config.php' ) ) {
wp_die( '' . 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 installing now." ),
+ /* 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 installing now.' ),
+ 'wp-config.php',
'install.php'
) . '
'
);
+}
// 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( '' . 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 installing now." ),
+ /* 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 installing now.' ),
+ 'wp-config.php',
'install.php'
) . '
'
);
@@ -363,7 +371,7 @@ switch($step) {
?>
wp-config.php' );
+ printf( __( 'You can create the %s file manually and paste the following text into it.' ), 'wp-config.php' );
?>