Make WordPress Core


Ignore:
Timestamp:
12/13/2014 08:11:49 PM (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.

see #30435.

File:
1 edited

Legend:

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

    r30821 r30840  
    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" />
     
    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><?php _e( 'Your content always takes center stage, whether viewed on a phone, tablet, laptop, or desktop computer.' ); ?></p>
    5656        </div>
    5757        <div class="col-3 last-feature">
     
    6565
    6666<div class="changelog">
    67     <h2 class="about-headline-callout"><?php echo ( 'Distraction-free writing' ); ?></h2>
     67    <h2 class="about-headline-callout"><?php _e( 'Distraction-free writing' ); ?></h2>
    6868    <div class="feature-section">
    6969        <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>
     
    7474
    7575<div class="changelog under-the-hood">
    76     <h3><?php echo ( 'The Finer Points' ); ?></h3>
     76    <h3><?php _e( 'The Finer Points' ); ?></h3>
    7777
    7878    <div class="feature-section col two-col">
    7979        <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>
     80            <h4><?php _e( 'Choose a language' ); ?></h4>
     81            <p><?php
     82                $count = '<span id="translations-count">' . 40 . '</span>';
     83                $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.' );
     84                if ( ! current_user_can( 'manage_options' ) ) {
     85                    $string = strip_tags( $string );
     86                }
     87                echo sprintf( $string, $display_version, $count, admin_url( 'options-general.php' ) );
     88            ?></p>
    8289
    83             <h4><?php echo ( 'Log out everywhere' ); ?></h4>
     90            <h4><?php _e( 'Log out everywhere' ); ?></h4>
    8491            <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>
    8592        </div>
     93
    8694        <div class="last-feature">
    87             <h4><?php echo ( 'Vine embeds' ); ?></h4>
     95            <h4><?php _e( 'Vine embeds' ); ?></h4>
    8896            <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>
    8997
    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>
     98            <h4><?php _e( 'Plugin recommendations' ); ?></h4>
     99            <p><?php
     100                $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.' );
     101                if ( ! current_user_can( 'install_plugins' ) ) {
     102                    $string = strip_tags( $string );
     103                }
     104                echo sprintf( $string, network_admin_url( 'plugin-install.php?tab=recommended' ) );
     105            ?></p>
    92106        </div>
    93107    </div>
     
    101115    <div class="feature-section col two-col">
    102116        <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>
     117            <h4><?php _e( 'Complex Queries' ); ?></h4>
     118            <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>
    105119
    106             <h4><?php echo ( 'Customizer API' ); ?></h4>
     120            <h4><?php _e( 'Customizer API' ); ?></h4>
    107121            <p><?php echo ( 'The customizer now supports conditionally showing panels and sections based on the page being previewed.' ); ?></p>
    108122        </div>
    109123        <div class="last-feature">
    110             <h4><?php printf( ( '%s tags in themes' ), '<code>&lt;title&gt;</code>' ); ?></h4>
     124            <h4><?php
     125                /* translators: %s: "<title>" tag */
     126                printf( __( '%s tags in themes' ), '<code>&lt;title&gt;</code>' );
     127            ?></h4>
    111128            <p><?php
    112                 printf( ( '%s tells WordPress to handle the complexities of document titles.' ), "<code>add_theme_support( 'title-tag' )</code>" );
     129                printf( __( '%s tells WordPress to handle the complexities of document titles.' ), "<code>add_theme_support( 'title-tag' )</code>" );
    113130            ?></p>
    114131
    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>
     132            <h4><?php _e( 'Developer Reference' ); ?></h4>
     133            <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>
    117134        </div>
    118135    </div>
     
    133150
    134151</div>
     152
     153<script>
     154jQuery(document).ready( function($) {
     155    $.ajax( 'https://api.wordpress.org/translations/core/1.0/?version=4.1',
     156        { 'type' : 'HEAD' } ).done( function( data, textStatus, jqXHR ) {
     157            var count = jqXHR.getResponseHeader( 'X-Translations-Count' );
     158            if ( count ) {
     159                $( '#translations-count' ).text( count );
     160            }
     161    });
     162});
     163</script>
    135164<?php
    136165
Note: See TracChangeset for help on using the changeset viewer.