Make WordPress Core

Changeset 30858


Ignore:
Timestamp:
12/15/2014 10:49:28 AM (10 years ago)
Author:
nacin
Message:

About page updates.

  • Live-update the number of active translations.
  • Finalize most strings.
  • Lazily remove links to admin-only screens based on cap checks.

Merges [30840] and [30841] to the 4.1 branch.

see #30435.

Location:
branches/4.1
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.1

  • branches/4.1/src/wp-admin/about.php

    r30822 r30858  
    4343
    4444<div class="changelog">
    45     <h2 class="about-headline-callout"><?php echo ( 'Introducing Twenty Fifteen' ); ?></h2>
     45    <h2 class="about-headline-callout"><?php _e( 'Introducing Twenty Fifteen' ); ?></h2>
    4646    <div class="about-overview">
    4747        <img class="about-overview-img" src="//s.w.org/images/core/3.8/twentyfourteen.jpg?1" />
     
    5050    <div class="feature-section col three-col">
    5151        <div class="col-1">
    52             <p><?php echo ( 'Our 2015 default theme is blog-focused and designed for clarity. Twenty Fifteen&#8127;s straightforward typography is readable on any screen size.' ); ?></p>
     52            <p><?php _e( 'Our newest default theme, Twenty Fifteen, is a blog-focused theme designed for clarity.' ); ?></p>
    5353        </div>
    5454        <div class="col-2">
    55             <p><?php echo ( 'Your content always takes center stage, whether viewed on a phone, tablet, laptop, or desktop computer.' ); ?></p>
     55            <p>
     56                <?php printf( __( 'Twenty Fifteen has flawless language support, with help from <a href="%s">Google&#8217;s Noto font family</a>.' ), 'https://www.google.com/get/noto/' ); ?>
     57                <?php _e( 'The straightforward typography is readable on any screen size.' ); ?>
     58            </p>
    5659        </div>
    5760        <div class="col-3 last-feature">
    58             <p><?php printf( ( 'Twenty Fifteen has great language support, with help from <a href="%s">Google&#8217;s Noto font family</a>.' ), 'https://www.google.com/get/noto/' ); ?></p>
     61            <p><?php _e( 'Your content always takes center stage, whether viewed on a phone, tablet, laptop, or desktop computer.' ); ?></p>
    5962        </div>
    6063    </div>
     
    6568
    6669<div class="changelog">
    67     <h2 class="about-headline-callout"><?php echo ( 'Distraction-free writing' ); ?></h2>
     70    <h2 class="about-headline-callout"><?php _e( 'Distraction-free writing' ); ?></h2>
    6871    <div class="feature-section">
    69         <p><?php echo ( '<em>Just write.</em> Sometimes, you just need to concentrate on putting your thoughts into words. Try turning on <strong>writing mode</strong>. When you start typing, all the distractions will fade away, letting you focus solely on your writing. All your editing tools instantly return when you need them.' ); ?></p>
     72        <p><em><?php _e( 'Just write.' ); ?></em> <?php _e( 'Sometimes, you just need to concentrate on putting your thoughts into words. Try turning on <strong>distraction-free writing mode</strong>. When you start typing, all the distractions will fade away, letting you focus solely on your writing. All your editing tools instantly return when you need them.' ); ?></p>
    7073    </div>
    7174</div>
     
    7477
    7578<div class="changelog under-the-hood">
    76     <h3><?php echo ( 'The Finer Points' ); ?></h3>
     79    <h3><?php _e( 'The Finer Points' ); ?></h3>
    7780
    7881    <div class="feature-section col two-col">
    7982        <div>
    80             <h4><?php echo ( 'Choose a language' ); ?></h4>
    81             <p><?php printf( ( 'Right now, WordPress %1$s is already translated into %2$d languages, with more always in progress. You can switch to any translation on the <a href="%3$s">General Settings</a> screen.' ), $display_version, 40, admin_url( 'options-general.php' ) ); ?></p>
     83            <h4><?php _e( 'Choose a language' ); ?></h4>
     84            <p><?php
     85                $count = '<span id="translations-count">' . 40 . '</span>';
     86                $string = __( 'Right now, WordPress %1$s is already translated into %2$s languages, with more always in progress. You can switch to any translation on the <a href="%3$s">General Settings</a> screen.' );
     87                if ( ! current_user_can( 'manage_options' ) ) {
     88                    $string = strip_tags( $string );
     89                }
     90                echo sprintf( $string, $display_version, $count, admin_url( 'options-general.php' ) );
     91            ?></p>
    8292
    83             <h4><?php echo ( 'Log out everywhere' ); ?></h4>
     93            <h4><?php _e( 'Log out everywhere' ); ?></h4>
    8494            <p><?php printf( ( 'There&#8217;s a new tool on <a href="%s">your profile</a> that logs you out everywhere, for those times you forget to log off a shared computer.' ), get_edit_profile_url() ); ?></p>
    8595        </div>
     96
    8697        <div class="last-feature">
    87             <h4><?php echo ( 'Vine embeds' ); ?></h4>
     98            <h4><?php _e( 'Vine embeds' ); ?></h4>
    8899            <p><?php printf( ( 'Embedding videos from Vine is as simple as pasting a URL onto its own line in a post. For more, see the Codex article on <a href="%s">Embeds</a>.' ), 'http://codex.wordpress.org/Embeds' ); ?></p>
    89100
    90             <h4><?php echo ( 'Plugin recommendations' ); ?></h4>
    91             <p><?php printf( ( 'The <a href="%s">plugin installer</a> now offers a list of plugins you may want to try, based on others who have similar plugins installed as you.' ), network_admin_url( 'plugin-install.php?tab=recommended' ) ); ?></p>
     101            <h4><?php _e( 'Plugin recommendations' ); ?></h4>
     102            <p><?php
     103                $string = ( 'The <a href="%s">plugin installer</a> now offers a list of plugins you may want to try, based on others who have similar plugins installed as you.' );
     104                if ( ! current_user_can( 'install_plugins' ) ) {
     105                    $string = strip_tags( $string );
     106                }
     107                echo sprintf( $string, network_admin_url( 'plugin-install.php?tab=recommended' ) );
     108            ?></p>
    92109        </div>
    93110    </div>
     
    101118    <div class="feature-section col two-col">
    102119        <div>
    103             <h4><?php echo ( 'Complex Queries' ); ?></h4>
    104             <p><?php printf( ( 'Metadata, date, and term queries now support advanced conditional logic, like nested clauses and multiple operators &mdash; <code>%s</code>.' ), 'A&nbsp;AND&nbsp;(&nbsp;B&nbsp;OR&nbsp;C&nbsp;)' ); ?></p>
     120            <h4><?php _e( 'Complex Queries' ); ?></h4>
     121            <p><?php printf( __( 'Metadata, date, and term queries now support advanced conditional logic, like nested clauses and multiple operators &mdash; <code>%s</code>.' ), 'A&nbsp;AND&nbsp;(&nbsp;B&nbsp;OR&nbsp;C&nbsp;)' ); ?></p>
    105122
    106             <h4><?php echo ( 'Customizer API' ); ?></h4>
     123            <h4><?php _e( 'Customizer API' ); ?></h4>
    107124            <p><?php echo ( 'The customizer now supports conditionally showing panels and sections based on the page being previewed.' ); ?></p>
    108125        </div>
    109126        <div class="last-feature">
    110             <h4><?php printf( ( '%s tags in themes' ), '<code>&lt;title&gt;</code>' ); ?></h4>
     127            <h4><?php
     128                /* translators: %s: "<title>" tag */
     129                printf( __( '%s tags in themes' ), '<code>&lt;title&gt;</code>' );
     130            ?></h4>
    111131            <p><?php
    112                 printf( ( '%s tells WordPress to handle the complexities of document titles.' ), "<code>add_theme_support( 'title-tag' )</code>" );
     132                printf( __( '%s tells WordPress to handle the complexities of document titles.' ), "<code>add_theme_support( 'title-tag' )</code>" );
    113133            ?></p>
    114134
    115             <h4><?php echo ( 'Developer Reference' ); ?></h4>
    116             <p><?php printf( ( 'Continued improvements to inline code documentation have made the <a href="%s">developer reference</a> more complete than ever.' ), 'https://developer.wordpress.org/reference/' ); ?></p>
     135            <h4><?php _e( 'Developer Reference' ); ?></h4>
     136            <p><?php printf( __( 'Continued improvements to inline code documentation have made the <a href="%s">developer reference</a> more complete than ever.' ), 'https://developer.wordpress.org/reference/' ); ?></p>
    117137        </div>
    118138    </div>
     
    133153
    134154</div>
     155
     156<script>
     157jQuery(document).ready( function($) {
     158    $.ajax( 'https://api.wordpress.org/translations/core/1.0/?version=4.1',
     159        { 'type' : 'HEAD' } ).done( function( data, textStatus, jqXHR ) {
     160            var count = jqXHR.getResponseHeader( 'X-Translations-Count' );
     161            if ( count ) {
     162                $( '#translations-count' ).text( count );
     163            }
     164    });
     165});
     166</script>
    135167<?php
    136168
Note: See TracChangeset for help on using the changeset viewer.