WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/01/2019 05:12:43 PM (6 weeks ago)
Author:
SergeyBiryukov
Message:

I18N: Improve translator comments.

  • Add missing translator comments.
  • Fix placement of some translator comments. Translator comments should be on the line directly above the line containing the translation function call for optimal compatibility with various .pot file generation tools. The CS auto-fixing, which changed some inconsistent function calls to multi-line function calls, is part of the reason why this was no longer the case for a select group of translator comments.

Includes minor code layout fixes.

Polyglots, rejoice! All WordPress core files now have translator comments for all strings with placeholders!

Props jrf, subrataemfluence, GaryJ, webdados, Dency, swissspidy, alvarogois, marcomartins, mihaiiceyro, vladwtz, niq1982, flipkeijzer, michielatyoast, chandrapatel, thrijith, joshuanoyce, FesoVik, tessak22, bhaktirajdev, cleancoded, dhavalkasvala, garrett-eclipse, bibliofille, socalchristina, priyankkpatel, 5hel2l2y, adamsilverstein, JeffPaul, pierlo, SergeyBiryukov.
Fixes #44360.

File:
1 edited

Legend:

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

    r45698 r45926  
    260260    <tr class="user-rich-editing-wrap">
    261261        <th scope="row"><?php _e( 'Visual Editor' ); ?></th>
    262         <td><label for="rich_editing"><input name="rich_editing" type="checkbox" id="rich_editing" value="false" <?php checked( 'false', $profileuser->rich_editing ); ?> /> <?php _e( 'Disable the visual editor when writing' ); ?></label></td>
     262        <td>
     263            <label for="rich_editing"><input name="rich_editing" type="checkbox" id="rich_editing" value="false" <?php checked( 'false', $profileuser->rich_editing ); ?> />
     264                <?php _e( 'Disable the visual editor when writing' ); ?>
     265            </label>
     266        </td>
    263267    </tr>
    264268        <?php endif; ?>
     
    275279        );
    276280        ?>
     281
    277282        <?php if ( $show_syntax_highlighting_preference ) : ?>
    278283    <tr class="user-syntax-highlighting-wrap">
    279284        <th scope="row"><?php _e( 'Syntax Highlighting' ); ?></th>
    280285        <td>
    281             <label for="syntax_highlighting"><input name="syntax_highlighting" type="checkbox" id="syntax_highlighting" value="false" <?php checked( 'false', $profileuser->syntax_highlighting ); ?> /> <?php _e( 'Disable syntax highlighting when editing code' ); ?></label>
    282         </td>
    283     </tr>
    284 <?php endif; ?>
     286            <label for="syntax_highlighting"><input name="syntax_highlighting" type="checkbox" id="syntax_highlighting" value="false" <?php checked( 'false', $profileuser->syntax_highlighting ); ?> />
     287                <?php _e( 'Disable syntax highlighting when editing code' ); ?>
     288            </label>
     289        </td>
     290    </tr>
     291        <?php endif; ?>
     292
    285293        <?php if ( count( $_wp_admin_css_colors ) > 1 && has_action( 'admin_color_scheme_picker' ) ) : ?>
    286 <tr class="user-admin-color-wrap">
    287 <th scope="row"><?php _e( 'Admin Color Scheme' ); ?></th>
    288 <td>
     294    <tr class="user-admin-color-wrap">
     295        <th scope="row"><?php _e( 'Admin Color Scheme' ); ?></th>
     296        <td>
    289297            <?php
    290298            /**
     
    301309            do_action( 'admin_color_scheme_picker', $user_id );
    302310            ?>
    303 </td>
    304 </tr>
     311        </td>
     312    </tr>
    305313            <?php
    306314endif; // $_wp_admin_css_colors
    307315        if ( ! ( IS_PROFILE_PAGE && ! $user_can_edit ) ) :
    308316            ?>
    309 <tr class="user-comment-shortcuts-wrap">
    310 <th scope="row"><?php _e( 'Keyboard Shortcuts' ); ?></th>
    311 <td><label for="comment_shortcuts"><input type="checkbox" name="comment_shortcuts" id="comment_shortcuts" value="true" <?php checked( 'true', $profileuser->comment_shortcuts ); ?> /> <?php _e( 'Enable keyboard shortcuts for comment moderation.' ); ?></label> <?php _e( '<a href="https://wordpress.org/support/article/keyboard-shortcuts/" target="_blank">More information</a>' ); ?></td>
    312 </tr>
     317    <tr class="user-comment-shortcuts-wrap">
     318        <th scope="row"><?php _e( 'Keyboard Shortcuts' ); ?></th>
     319        <td>
     320            <label for="comment_shortcuts">
     321                <input type="checkbox" name="comment_shortcuts" id="comment_shortcuts" value="true" <?php checked( 'true', $profileuser->comment_shortcuts ); ?> />
     322                <?php _e( 'Enable keyboard shortcuts for comment moderation.' ); ?>
     323            </label>
     324            <?php _e( '<a href="https://wordpress.org/support/article/keyboard-shortcuts/" target="_blank">More information</a>' ); ?>
     325        </td>
     326    </tr>
    313327        <?php endif; ?>
    314 <tr class="show-admin-bar user-admin-bar-front-wrap">
    315 <th scope="row"><?php _e( 'Toolbar' ); ?></th>
    316 <td>
    317 <label for="admin_bar_front">
    318 <input name="admin_bar_front" type="checkbox" id="admin_bar_front" value="1"<?php checked( _get_admin_bar_pref( 'front', $profileuser->ID ) ); ?> />
    319         <?php _e( 'Show Toolbar when viewing site' ); ?></label><br />
    320 </td>
    321 </tr>
     328
     329    <tr class="show-admin-bar user-admin-bar-front-wrap">
     330        <th scope="row"><?php _e( 'Toolbar' ); ?></th>
     331        <td>
     332            <label for="admin_bar_front">
     333                <input name="admin_bar_front" type="checkbox" id="admin_bar_front" value="1"<?php checked( _get_admin_bar_pref( 'front', $profileuser->ID ) ); ?> />
     334                <?php _e( 'Show Toolbar when viewing site' ); ?>
     335            </label><br />
     336        </td>
     337    </tr>
    322338
    323339        <?php
     
    325341        if ( $languages ) :
    326342            ?>
    327 <tr class="user-language-wrap">
    328     <th scope="row">
     343    <tr class="user-language-wrap">
     344        <th scope="row">
    329345            <?php /* translators: The user language selection field label */ ?>
    330         <label for="locale"><?php _e( 'Language' ); ?><span class="dashicons dashicons-translation" aria-hidden="true"></span></label>
    331     </th>
    332     <td>
     346            <label for="locale"><?php _e( 'Language' ); ?><span class="dashicons dashicons-translation" aria-hidden="true"></span></label>
     347        </th>
     348        <td>
    333349            <?php
    334350                $user_locale = $profileuser->locale;
     
    351367            );
    352368            ?>
    353     </td>
    354 </tr>
     369        </td>
     370    </tr>
    355371            <?php
    356372endif;
     
    567583            <?php
    568584            if ( IS_PROFILE_PAGE ) {
    569                 /* translators: %s: Gravatar URL */
    570585                $description = sprintf(
     586                    /* translators: %s: Gravatar URL */
    571587                    __( '<a href="%s">You can change your profile picture on Gravatar</a>.' ),
    572588                    __( 'https://en.gravatar.com/' )
     
    741757                        $output .= ', ';
    742758                    }
    743                     $output .= $value ? $cap : sprintf( __( 'Denied: %s' ), $cap );
     759
     760                    if ( $value ) {
     761                        $output .= $value;
     762                    } else {
     763                        /* translators: %s: capability name */
     764                        $output .= sprintf( __( 'Denied: %s' ), $cap );
     765                    }
    744766                }
    745767            }
Note: See TracChangeset for help on using the changeset viewer.