From 16bee559d40ddbbf32f71154228d4c155045036a Mon Sep 17 00:00:00 2001
From: Sergey Biryukov
Date: Wed, 18 Oct 2017 15:27:53 +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.
Built from https://develop.svn.wordpress.org/trunk@41904
git-svn-id: http://core.svn.wordpress.org/trunk@41738 1a063a9b-81f0-0310-95a4-ce76da25c4cd
---
wp-admin/setup-config.php | 28 ++++++++++++++++++----------
wp-includes/version.php | 2 +-
2 files changed, 19 insertions(+), 11 deletions(-)
diff --git a/wp-admin/setup-config.php b/wp-admin/setup-config.php
index e416931d00..47c2b1f7db 100644
--- a/wp-admin/setup-config.php
+++ b/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
' );
?>