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/nav-menus.php

    r45674 r45926  
    530530
    531531if ( ! current_theme_supports( 'menus' ) && ! $num_locations ) {
    532     $messages[] = '<div id="message" class="updated"><p>' . sprintf( __( 'Your theme does not natively support menus, but you can use them in sidebars by adding a &#8220;Navigation Menu&#8221; widget on the <a href="%s">Widgets</a> screen.' ), admin_url( 'widgets.php' ) ) . '</p></div>';
     532    $messages[] = '<div id="message" class="updated"><p>' . sprintf(
     533        /* translators: URL to Widgets screen */
     534        __( 'Your theme does not natively support menus, but you can use them in sidebars by adding a &#8220;Navigation Menu&#8221; widget on the <a href="%s">Widgets</a> screen.' ),
     535        admin_url( 'widgets.php' )
     536    ) . '</p></div>';
    533537}
    534538
    535539if ( ! $locations_screen ) : // Main tab
    536     $overview = '<p>' . __( 'This screen is used for managing your navigation menus.' ) . '</p>';
    537     /* translators: 1: Widgets admin screen URL, 2 and 3: The name of the default themes */
    538     $overview .= '<p>' . sprintf( __( 'Menus can be displayed in locations defined by your theme, even used in sidebars by adding a &#8220;Navigation Menu&#8221; widget on the <a href="%1$s">Widgets</a> screen. If your theme does not support the navigation menus feature (the default themes, %2$s and %3$s, do), you can learn about adding this support by following the Documentation link to the side.' ), admin_url( 'widgets.php' ), 'Twenty Seventeen', 'Twenty Nineteen' ) . '</p>';
     540    $overview  = '<p>' . __( 'This screen is used for managing your navigation menus.' ) . '</p>';
     541    $overview .= '<p>' . sprintf(
     542        /* translators: 1: Widgets admin screen URL, 2 and 3: The names of the default themes */
     543            __( 'Menus can be displayed in locations defined by your theme, even used in sidebars by adding a &#8220;Navigation Menu&#8221; widget on the <a href="%1$s">Widgets</a> screen. If your theme does not support the navigation menus feature (the default themes, %2$s and %3$s, do), you can learn about adding this support by following the Documentation link to the side.' ),
     544        admin_url( 'widgets.php' ),
     545        'Twenty Seventeen',
     546        'Twenty Nineteen'
     547    ) . '</p>';
    539548    $overview .= '<p>' . __( 'From this screen you can:' ) . '</p>';
    540549    $overview .= '<ul><li>' . __( 'Create, edit, and delete menus' ) . '</li>';
     
    656665            echo '<p>' . __( 'Your theme supports one menu. Select which menu you would like to use.' ) . '</p>';
    657666        } else {
    658             echo '<p>' . sprintf( _n( 'Your theme supports %s menu. Select which menu appears in each location.', 'Your theme supports %s menus. Select which menu appears in each location.', $num_locations ), number_format_i18n( $num_locations ) ) . '</p>';
     667            echo '<p>' . sprintf(
     668                /* translators: %s: number of menus */
     669                _n(
     670                    'Your theme supports %s menu. Select which menu appears in each location.',
     671                    'Your theme supports %s menus. Select which menu appears in each location.',
     672                    $num_locations
     673                ),
     674                number_format_i18n( $num_locations )
     675            ) . '</p>';
    659676        }
    660677        ?>
     
    756773            <?php
    757774            printf(
     775                /* translators: %s: URL to create a new menu */
    758776                __( 'Edit your menu below, or <a href="%s">create a new menu</a>. Don&#8217;t forget to save your changes!' ),
    759777                esc_url(
     
    817835                <?php
    818836                printf(
     837                    /* translators: %s: URL to create a new menu */
    819838                    __( 'or <a href="%s">create a new menu</a>. Don&#8217;t forget to save your changes!' ),
    820839                    esc_url(
Note: See TracChangeset for help on using the changeset viewer.