Make WordPress Core

Changeset 41904


Ignore:
Timestamp:
10/18/2017 03:26:10 PM (7 years ago)
Author:
SergeyBiryukov
Message:

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

Props ramiy, danieltj.
Fixes #42161.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/setup-config.php

    r41631 r41904  
    4242
    4343// Support wp-config-sample.php one level up, for the develop repo.
    44 if ( file_exists( ABSPATH . 'wp-config-sample.php' ) )
     44if ( file_exists( ABSPATH . 'wp-config-sample.php' ) ) {
    4545    $config_file = file( ABSPATH . 'wp-config-sample.php' );
    46 elseif ( file_exists( dirname( ABSPATH ) . '/wp-config-sample.php' ) )
     46} elseif ( file_exists( dirname( ABSPATH ) . '/wp-config-sample.php' ) ) {
    4747    $config_file = file( dirname( ABSPATH ) . '/wp-config-sample.php' );
    48 else
    49     wp_die( __( 'Sorry, I need a wp-config-sample.php file to work from. Please re-upload this file to your WordPress installation.' ) );
     48} else {
     49    wp_die( sprintf(
     50        /* translators: %s: wp-config-sample.php */
     51        __( 'Sorry, I need a %s file to work from. Please re-upload this file to your WordPress installation.' ),
     52        '<code>wp-config-sample.php</code>'
     53    ) );
     54}
    5055
    5156// Check if wp-config.php has been created
    52 if ( file_exists( ABSPATH . 'wp-config.php' ) )
     57if ( file_exists( ABSPATH . 'wp-config.php' ) ) {
    5358    wp_die( '<p>' . sprintf(
    54             /* translators: %s: install.php */
    55             __( "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>." ),
     59            /* translators: 1: wp-config.php 2: install.php */
     60            __( '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>.' ),
     61            '<code>wp-config.php</code>',
    5662            'install.php'
    5763        ) . '</p>'
    5864    );
     65}
    5966
    6067// Check if wp-config.php exists above the root directory but is not part of another installation
    6168if ( @file_exists( ABSPATH . '../wp-config.php' ) && ! @file_exists( ABSPATH . '../wp-settings.php' ) ) {
    6269    wp_die( '<p>' . sprintf(
    63             /* translators: %s: install.php */
    64             __( "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>." ),
     70            /* translators: 1: wp-config.php 2: install.php */
     71            __( '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>.' ),
     72            '<code>wp-config.php</code>',
    6573            'install.php'
    6674        ) . '</p>'
     
    364372<p><?php
    365373    /* translators: %s: wp-config.php */
    366     printf( __( 'You can create the %s manually and paste the following text into it.' ), '<code>wp-config.php</code>' );
     374    printf( __( 'You can create the %s file manually and paste the following text into it.' ), '<code>wp-config.php</code>' );
    367375?></p>
    368376<textarea id="wp-config" cols="98" rows="15" class="code" readonly="readonly"><?php
Note: See TracChangeset for help on using the changeset viewer.