WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/21/2018 01:47:49 AM (11 months ago)
Author:
pento
Message:

Upgrade/Install: Split Sample Page, Hello World, and Privacy Policy content.

[43820] converted the content to blocks, but included block markers in the translateable strings, which made translations difficult to do accurately.

Props desrosj, dd32, ocean90.
See #45151.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/5.0/src/wp-admin/includes/upgrade.php

    r43820 r43912  
    160160
    161161        if ( ! $first_post ) {
    162             /* translators: %s: site link */
    163             $first_post = __( '<!-- wp:paragraph -->
    164 <p>Welcome to %s. This is your first post. Edit or delete it, then start writing!</p>
    165 <!-- /wp:paragraph -->' );
     162            $first_post = "<!-- wp:paragraph -->\n<p>" .
     163                /* translators: first post content, %s: site link */
     164                __( 'Welcome to %s. This is your first post. Edit or delete it, then start writing!' ) .
     165                "</p>\n<!-- /wp:paragraph -->";
    166166        }
    167167
     
    174174        $first_post = str_replace( 'SITE_NAME', get_network()->site_name, $first_post );
    175175    } else {
    176         $first_post = __( '<!-- wp:paragraph -->
    177 <p>Welcome to WordPress. This is your first post. Edit or delete it, then start writing!</p>
    178 <!-- /wp:paragraph -->' );
     176        $first_post = "<!-- wp:paragraph -->\n<p>" .
     177            /* translators: first post content, %s: site link */
     178            __( 'Welcome to WordPress. This is your first post. Edit or delete it, then start writing!' ) .
     179            "</p>\n<!-- /wp:paragraph -->";
    179180    }
    180181
     
    226227        $first_page = get_site_option( 'first_page' );
    227228
    228     $first_page = ! empty( $first_page ) ? $first_page : sprintf( __( "<!-- wp:paragraph -->
    229 <p>This is an example page. It's different from a blog post because it will stay in one place and will show up in your site navigation (in most themes). Most people start with an About page that introduces them to potential site visitors. It might say something like this:</p>
    230 <!-- /wp:paragraph -->
    231 
    232 <!-- wp:quote -->
    233 <blockquote class=\"wp-block-quote\"><p>Hi there! I'm a bike messenger by day, aspiring actor by night, and this is my website. I live in Los Angeles, have a great dog named Jack, and I like pi&#241;a coladas. (And gettin' caught in the rain.)</p></blockquote>
    234 <!-- /wp:quote -->
    235 
    236 <!-- wp:paragraph -->
    237 <p>...or something like this:</p>
    238 <!-- /wp:paragraph -->
    239 
    240 <!-- wp:quote -->
    241 <blockquote class=\"wp-block-quote\"><p>The XYZ Doohickey Company was founded in 1971, and has been providing quality doohickeys to the public ever since. Located in Gotham City, XYZ employs over 2,000 people and does all kinds of awesome things for the Gotham community.</p></blockquote>
    242 <!-- /wp:quote -->
    243 
    244 <!-- wp:paragraph -->
    245 <p>As a new WordPress user, you should go to <a href=\"%s\">your dashboard</a> to delete this page and create new pages for your content. Have fun!</p>
    246 <!-- /wp:paragraph -->" ), admin_url() );
     229    if ( empty( $first_page ) ) {
     230        $first_page = "<!-- wp:paragraph -->\n<p>";
     231        /* translators: first page content */
     232        $first_page .= __( "This is an example page. It's different from a blog post because it will stay in one place and will show up in your site navigation (in most themes). Most people start with an About page that introduces them to potential site visitors. It might say something like this:" );
     233        $first_page .= "</p>\n<!-- /wp:paragraph -->\n\n";
     234
     235        $first_page .= "<!-- wp:quote -->\n<blockquote class=\"wp-block-quote\"><p>";
     236        /* translators: first page content */
     237        $first_page .= __( "Hi there! I'm a bike messenger by day, aspiring actor by night, and this is my website. I live in Los Angeles, have a great dog named Jack, and I like pi&#241;a coladas. (And gettin' caught in the rain.)" );
     238        $first_page .= "</p></blockquote>\n<!-- /wp:quote -->\n\n";
     239
     240        $first_page .= "<!-- wp:paragraph -->\n<p>";
     241        /* translators: first page content */
     242        $first_page .= __( '...or something like this:' );
     243        $first_page .= "</p>\n<!-- /wp:paragraph -->\n\n";
     244
     245        $first_page .= "<!-- wp:quote -->\n<blockquote class=\"wp-block-quote\"><p>";
     246        /* translators: first page content */
     247        $first_page .= __( 'The XYZ Doohickey Company was founded in 1971, and has been providing quality doohickeys to the public ever since. Located in Gotham City, XYZ employs over 2,000 people and does all kinds of awesome things for the Gotham community.' );
     248        $first_page .= "</p></blockquote>\n<!-- /wp:quote -->\n\n";
     249
     250        $first_page .= "<!-- wp:paragraph -->\n<p>";
     251        $first_page .= sprintf(
     252            /* translators: first page content, %s: site admin URL */
     253            __( 'As a new WordPress user, you should go to <a href="%s">your dashboard</a> to delete this page and create new pages for your content. Have fun!' ),
     254            admin_url()
     255        );
     256        $first_page .= "</p>\n<!-- /wp:paragraph -->";
     257    }
    247258
    248259    $first_post_guid = get_option('home') . '/?page_id=2';
Note: See TracChangeset for help on using the changeset viewer.