Make WordPress Core


Ignore:
Timestamp:
09/01/2019 05:12:43 PM (5 years 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/includes/ms.php

    r45734 r45926  
    580580
    581581    if ( empty( $blogs ) ) {
    582         wp_die( sprintf( __( 'You attempted to access the "%1$s" dashboard, but you do not currently have privileges on this site. If you believe you should be able to access the "%1$s" dashboard, please contact your network administrator.' ), $blog_name ), 403 );
    583     }
    584 
    585     $output  = '<p>' . sprintf( __( 'You attempted to access the "%1$s" dashboard, but you do not currently have privileges on this site. If you believe you should be able to access the "%1$s" dashboard, please contact your network administrator.' ), $blog_name ) . '</p>';
     582        wp_die(
     583            sprintf(
     584                /* translators: 1: Site title */
     585                __( 'You attempted to access the "%1$s" dashboard, but you do not currently have privileges on this site. If you believe you should be able to access the "%1$s" dashboard, please contact your network administrator.' ),
     586                $blog_name
     587            ),
     588            403
     589        );
     590    }
     591
     592    $output = '<p>' . sprintf(
     593        /* translators: 1: Site title */
     594        __( 'You attempted to access the "%1$s" dashboard, but you do not currently have privileges on this site. If you believe you should be able to access the "%1$s" dashboard, please contact your network administrator.' ),
     595        $blog_name
     596    ) . '</p>';
    586597    $output .= '<p>' . __( 'If you reached this screen by accident and meant to visit one of your own sites, here are some shortcuts to help you find your way.' ) . '</p>';
    587598
     
    691702
    692703    if ( get_site_option( 'wpmu_upgrade_site' ) != $wp_db_version ) {
    693         echo "<div class='update-nag'>" . sprintf( __( 'Thank you for Updating! Please visit the <a href="%s">Upgrade Network</a> page to update all your sites.' ), esc_url( network_admin_url( 'upgrade.php' ) ) ) . '</div>';
     704        echo "<div class='update-nag'>" . sprintf(
     705            /* translators: %s: URL to Upgrade Network screen */
     706            __( 'Thank you for Updating! Please visit the <a href="%s">Upgrade Network</a> page to update all your sites.' ),
     707            esc_url( network_admin_url( 'upgrade.php' ) )
     708        ) . '</div>';
    694709    }
    695710}
     
    745760    <table class="form-table" role="presentation">
    746761    <tr>
    747     <?php /* translators: My sites label */ ?>
     762    <?php /* translators: My Sites label */ ?>
    748763        <th scope="row"><label for="primary_blog"><?php _e( 'Primary Site' ); ?></label></th>
    749764        <td>
     
    863878
    864879            if ( ! current_user_can( 'delete_user', $delete_user->ID ) ) {
    865                 wp_die( sprintf( __( 'Warning! User %s cannot be deleted.' ), $delete_user->user_login ) );
     880                wp_die(
     881                    sprintf(
     882                        /* translators: %s: user login */
     883                        __( 'Warning! User %s cannot be deleted.' ),
     884                        $delete_user->user_login
     885                    )
     886                );
    866887            }
    867888
    868889            if ( in_array( $delete_user->user_login, $site_admins ) ) {
    869                 wp_die( sprintf( __( 'Warning! User cannot be deleted. The user %s is a network administrator.' ), '<em>' . $delete_user->user_login . '</em>' ) );
     890                wp_die(
     891                    sprintf(
     892                        /* translators: %s: user login */
     893                        __( 'Warning! User cannot be deleted. The user %s is a network administrator.' ),
     894                        '<em>' . $delete_user->user_login . '</em>'
     895                    )
     896                );
    870897            }
    871898            ?>
     
    913940                        ?>
    914941                        <ul style="list-style:none;">
    915                             <li><?php printf( __( 'Site: %s' ), $user_site ); ?></li>
     942                            <li>
     943                                <?php
     944                                /* translators: %s: link to user's site */
     945                                printf( __( 'Site: %s' ), $user_site );
     946                                ?>
     947                            </li>
    916948                            <li><label><input type="radio" id="delete_option0" name="delete[<?php echo $details->userblog_id . '][' . $delete_user->ID; ?>]" value="delete" checked="checked" />
    917949                            <?php _e( 'Delete all content.' ); ?></label></li>
     
    11001132            '<p>' . __( '<strong>Info</strong> &mdash; The site URL is rarely edited as this can cause the site to not work properly. The Registered date and Last Updated date are displayed. Network admins can mark a site as archived, spam, deleted and mature, to remove from public listings or disable.' ) . '</p>' .
    11011133            '<p>' . __( '<strong>Users</strong> &mdash; This displays the users associated with this site. You can also change their role, reset their password, or remove them from the site. Removing the user from the site does not remove the user from the network.' ) . '</p>' .
    1102             '<p>' . sprintf( __( '<strong>Themes</strong> &mdash; This area shows themes that are not already enabled across the network. Enabling a theme in this menu makes it accessible to this site. It does not activate the theme, but allows it to show in the site&#8217;s Appearance menu. To enable a theme for the entire network, see the <a href="%s">Network Themes</a> screen.' ), network_admin_url( 'themes.php' ) ) . '</p>' .
     1134            '<p>' . sprintf(
     1135                /* translators: %s: URL to Network Themes screen */
     1136                __( '<strong>Themes</strong> &mdash; This area shows themes that are not already enabled across the network. Enabling a theme in this menu makes it accessible to this site. It does not activate the theme, but allows it to show in the site&#8217;s Appearance menu. To enable a theme for the entire network, see the <a href="%s">Network Themes</a> screen.' ),
     1137                network_admin_url( 'themes.php' )
     1138            ) . '</p>' .
    11031139            '<p>' . __( '<strong>Settings</strong> &mdash; This page shows a list of all settings associated with this site. Some are created by WordPress and others are created by plugins you activate. Note that some fields are grayed out and say Serialized Data. You cannot modify these values due to the way the setting is stored in the database.' ) . '</p>',
    11041140    );
Note: See TracChangeset for help on using the changeset viewer.