Make WordPress Core

Changeset 41640


Ignore:
Timestamp:
09/29/2017 11:41:06 AM (9 years ago)
Author:
SergeyBiryukov
Message:

I18N: Use a consistent pattern for translator comments for placeholders in Customizer and widget strings.

Props danieltj, Rahmohn.
Fixes #41974.

Location:
trunk/src
Files:
9 edited

Legend:

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

    r41595 r41640  
    3636        '<p>' . __( 'After typing in your edits, click Update File.' ) . '</p>' .
    3737        '<p>' . __( '<strong>Advice:</strong> think very carefully about your site crashing if you are live-editing the theme currently in use.' ) . '</p>' .
    38         /* translators: placeholder is link to codex article about child themes */
     38        /* translators: %s: link to codex article about child themes */
    3939        '<p>' . sprintf( __( 'Upgrading to a newer version of the same theme will override changes made here. To avoid this, consider creating a <a href="%s">child theme</a> instead.' ), __( 'https://codex.wordpress.org/Child_Themes' ) ) . '</p>' .
    4040        ( is_network_admin() ? '<p>' . __( 'Any edits to files from this screen will be reflected on all sites in the network.' ) . '</p>' : '' ),
  • trunk/src/wp-includes/class-wp-customize-manager.php

    r41639 r41640  
    26172617                        $response = array(
    26182618                                'setting_validities' => $setting_validities,
    2619                                 /* translators: placeholder is number of invalid settings */
     2619                                /* translators: %s: number of invalid settings */
    26202620                                'message' => sprintf( _n( 'Unable to save due to %s invalid setting.', 'Unable to save due to %s invalid settings.', $invalid_setting_count ), number_format_i18n( $invalid_setting_count ) ),
    26212621                        );
  • trunk/src/wp-includes/class-wp-customize-widgets.php

    r41205 r41640  
    711711                $some_non_rendered_areas_messages = array();
    712712                $some_non_rendered_areas_messages[1] = html_entity_decode(
    713                         /* translators: placeholder is the number of other widget areas registered but not rendered */
    714713                        __( 'Your theme has 1 other widget area, but this particular page doesn&#8217;t display it.' ),
    715714                        ENT_QUOTES,
    … …  
    719718                for ( $non_rendered_count = 2; $non_rendered_count < $registered_sidebar_count; $non_rendered_count++ ) {
    720719                        $some_non_rendered_areas_messages[ $non_rendered_count ] = html_entity_decode( sprintf(
    721                                 /* translators: placeholder is the number of other widget areas registered but not rendered */
     720                                /* translators: %s: the number of other widget areas registered but not rendered */
    722721                                _n(
    723722                                        'Your theme has %s other widget area, but this particular page doesn&#8217;t display it.',
    … …  
    731730                if ( 1 === $registered_sidebar_count ) {
    732731                        $no_areas_shown_message = html_entity_decode( sprintf(
    733                                 /* translators: placeholder is the total number of widget areas registered */
    734732                                __( 'Your theme has 1 widget area, but this particular page doesn&#8217;t display it.' )
    735733                        ), ENT_QUOTES, get_bloginfo( 'charset' ) );
    736734                } else {
    737735                        $no_areas_shown_message = html_entity_decode( sprintf(
    738                                 /* translators: placeholder is the total number of widget areas registered */
     736                                /* translators: %s: the total number of widget areas registered */
    739737                                _n(
    740738                                        'Your theme has %s widget area, but this particular page doesn&#8217;t display it.',
    … …  
    764762                                'reorderModeOff'   => __( 'Reorder mode closed' ),
    765763                                'reorderLabelOn'   => esc_attr__( 'Reorder widgets' ),
    766                                 /* translators: placeholder is the count for the number of widgets found */
     764                                /* translators: %d: the number of widgets found */
    767765                                'widgetsFound'     => __( 'Number of widgets found: %d' ),
    768766                                'noWidgetsFound'   => __( 'No widgets found.' ),
  • trunk/src/wp-includes/script-loader.php

    r41626 r41640  
    474474        $scripts->add( 'wp-theme-plugin-editor', "/wp-admin/js/theme-plugin-editor$suffix.js", array( 'code-editor', 'jquery', 'jquery-ui-core', 'wp-a11y', 'underscore' ) );
    475475        did_action( 'init' ) && $scripts->add_inline_script( 'wp-theme-plugin-editor', sprintf( 'wp.themePluginEditor.l10n = %s;', wp_json_encode( wp_array_slice_assoc(
    476                 /* translators: placeholder is error count */
     476                /* translators: %d: error count */
    477477                _n_noop( 'There is %d error which must be fixed before you can save.', 'There are %d errors which must be fixed before you can save.' ),
    478478                array( 'singular', 'plural' )
    … …  
    572572                'untitledBlogName'   => __( '(Untitled)' ),
    573573                'serverSaveError'    => __( 'Failed connecting to the server. Please try saving again.' ),
    574                 /* translators: placeholder is URL to the Customizer to load the autosaved version */
     574                /* translators: %s: URL to the Customizer to load the autosaved version */
    575575                'autosaveNotice'     => __( 'There is a more recent autosave of your changes than the one you are previewing. <a href="%s">Restore the autosave</a>' ),
    576576                'videoHeaderNotice'  => __( 'This theme doesn\'t support video headers on this page. Navigate to the front page or another page that supports video headers.' ),
    … …  
    578578                'allowedFiles'       => __( 'Allowed Files' ),
    579579                'customCssError'     => wp_array_slice_assoc(
    580                         /* translators: placeholder is error count */
     580                        /* translators: %d: error count */
    581581                        _n_noop( 'There is %d error which must be fixed before you can save.', 'There are %d errors which must be fixed before you can save.' ),
    582582                        array( 'singular', 'plural' )
    … …  
    584584                'pageOnFrontError' => __( 'Homepage and posts page must be different.' ),
    585585                'saveBlockedError' => wp_array_slice_assoc(
    586                         /* translators: placeholder is error count */
     586                        /* translators: %s: error count */
    587587                        _n_noop( 'Unable to save due to %s invalid setting.', 'Unable to save due to %s invalid settings.' ),
    588588                        array( 'singular', 'plural' )
    … …  
    11711171
    11721172                        // This one is only used with wp.a11y.speak(), so it can/should be more brief.
    1173                         /* translators: %s is the name of a city. */
     1173                        /* translators: %s: the name of a city */
    11741174                        'city_updated' => __( 'City updated. Listing events near %s.' ),
    11751175                )
  • trunk/src/wp-includes/widgets/class-wp-widget-custom-html.php

    r41639 r41640  
    177177                $l10n = array(
    178178                        'errorNotice' => wp_array_slice_assoc(
    179                                 /* translators: placeholder is error count */
     179                                /* translators: %d: error count */
    180180                                _n_noop( 'There is %d error which must be fixed before you can save.', 'There are %d errors which must be fixed before you can save.' ),
    181181                                array( 'singular', 'plural' )
  • trunk/src/wp-includes/widgets/class-wp-widget-media-audio.php

    r41162 r41640  
    3434                        'edit_media' => _x( 'Edit Audio', 'label for button in the audio widget; should preferably not be longer than ~13 characters long' ),
    3535                        'missing_attachment' => sprintf(
    36                                 /* translators: placeholder is URL to media library */
     36                                /* translators: %s: URL to media library */
    3737                                __( 'We can&#8217;t find that audio file. Check your <a href="%s">media library</a> and make sure it wasn&#8217;t deleted.' ),
    3838                                esc_url( admin_url( 'upload.php' ) )
    3939                        ),
    40                         /* translators: %d is widget count */
     40                        /* translators: %d: widget count */
    4141                        'media_library_state_multi' => _n_noop( 'Audio Widget (%d)', 'Audio Widget (%d)' ),
    4242                        'media_library_state_single' => __( 'Audio Widget' ),
    … …  
    7878                                'default' => '',
    7979                                'format' => 'uri',
    80                                 /* translators: placeholder is audio extension */
     80                                /* translators: %s: audio extension */
    8181                                'description' => sprintf( __( 'URL to the %s audio source file' ), $audio_extension ),
    8282                        );
  • trunk/src/wp-includes/widgets/class-wp-widget-media-image.php

    r41549 r41640  
    3434                        'edit_media' => _x( 'Edit Image', 'label for button in the image widget; should preferably not be longer than ~13 characters long' ),
    3535                        'missing_attachment' => sprintf(
    36                                 /* translators: placeholder is URL to media library */
     36                                /* translators: %s: URL to media library */
    3737                                __( 'We can&#8217;t find that image. Check your <a href="%s">media library</a> and make sure it wasn&#8217;t deleted.' ),
    3838                                esc_url( admin_url( 'upload.php' ) )
    3939                        ),
    40                         /* translators: %d is widget count */
     40                        /* translators: %d: widget count */
    4141                        'media_library_state_multi' => _n_noop( 'Image Widget (%d)', 'Image Widget (%d)' ),
    4242                        'media_library_state_single' => __( 'Image Widget' ),
  • trunk/src/wp-includes/widgets/class-wp-widget-media-video.php

    r41198 r41640  
    3434                        'edit_media' => _x( 'Edit Video', 'label for button in the video widget; should preferably not be longer than ~13 characters long' ),
    3535                        'missing_attachment' => sprintf(
    36                                 /* translators: placeholder is URL to media library */
     36                                /* translators: %s: URL to media library */
    3737                                __( 'We can&#8217;t find that video. Check your <a href="%s">media library</a> and make sure it wasn&#8217;t deleted.' ),
    3838                                esc_url( admin_url( 'upload.php' ) )
    3939                        ),
    40                         /* translators: %d is widget count */
     40                        /* translators: %d: widget count */
    4141                        'media_library_state_multi' => _n_noop( 'Video Widget (%d)', 'Video Widget (%d)' ),
    4242                        'media_library_state_single' => __( 'Video Widget' ),
    43                         /* translators: placeholder is a list of valid video file extensions */
    44                         'unsupported_file_type' => sprintf( __( 'Sorry, we can&#8217;t display the video file type selected. Please select a supported video file (%1$s) or stream (YouTube or Vimeo) instead.' ), '<code>.' . implode( '</code>, <code>.', wp_get_video_extensions() ) . '</code>' ),
     43                        /* translators: %s: a list of valid video file extensions */
     44                        'unsupported_file_type' => sprintf( __( 'Sorry, we can&#8217;t display the video file type selected. Please select a supported video file (%s) or stream (YouTube or Vimeo) instead.' ), '<code>.' . implode( '</code>, <code>.', wp_get_video_extensions() ) . '</code>' ),
    4545                ) );
    4646        }
    … …  
    8888                                'default' => '',
    8989                                'format' => 'uri',
    90                                 /* translators: placeholder is video extension */
     90                                /* translators: %s: video extension */
    9191                                'description' => sprintf( __( 'URL to the %s video source file' ), $video_extension ),
    9292                        );
  • trunk/src/wp-includes/widgets/class-wp-widget-media.php

    r41590 r41640  
    7070                        'add_to_widget' => __( 'Add to Widget' ),
    7171                        'missing_attachment' => sprintf(
    72                                 /* translators: placeholder is URL to media library */
     72                                /* translators: %s: URL to media library */
    7373                                __( 'We can&#8217;t find that file. Check your <a href="%s">media library</a> and make sure it wasn&#8217;t deleted.' ),
    7474                                esc_url( admin_url( 'upload.php' ) )
    7575                        ),
    76                         /* translators: %d is widget count */
     76                        /* translators: %d: widget count */
    7777                        'media_library_state_multi' => _n_noop( 'Media Widget (%d)', 'Media Widget (%d)' ),
    7878                        'media_library_state_single' => __( 'Media Widget' ),
Note: See TracChangeset for help on using the changeset viewer.