Make WordPress Core

Changeset 55881


Ignore:
Timestamp:
06/05/2023 09:03:38 PM (16 months ago)
Author:
audrasjb
Message:

I18N: Provide gettext context to disambiguate various translation strings.

This changeset adds context to various strings:

  • 'Background' string when referring to Custom Background appearance screens
  • 'Header' string when referring to Custom Header appearance screens
  • 'General', 'Header' and 'Footer' strings when referring to template part areas

Props gonzomir, SergeyBiryukov, mukesh27, costdev, ankitmaru.
Fixes #58424.

Location:
trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-custom-background.php

    r55412 r55881  
    6464     */
    6565    public function init() {
    66         $page = add_theme_page( __( 'Background' ), __( 'Background' ), 'edit_theme_options', 'custom-background', array( $this, 'admin_page' ) );
     66        $page = add_theme_page(
     67            _x( 'Background', 'custom background' ),
     68            _x( 'Background', 'custom background' ),
     69            'edit_theme_options',
     70            'custom-background',
     71            array( $this, 'admin_page' )
     72        );
     73
    6774        if ( ! $page ) {
    6875            return;
  • trunk/src/wp-admin/includes/class-custom-image-header.php

    r55412 r55881  
    7272     */
    7373    public function init() {
    74         $page = add_theme_page( __( 'Header' ), __( 'Header' ), 'edit_theme_options', 'custom-header', array( $this, 'admin_page' ) );
     74        $page = add_theme_page(
     75            _x( 'Header', 'custom image header' ),
     76            _x( 'Header', 'custom image header' ),
     77            'edit_theme_options',
     78            'custom-header',
     79            array( $this, 'admin_page' )
     80        );
    7581
    7682        if ( ! $page ) {
  • trunk/src/wp-admin/menu.php

    r55703 r55881  
    231231if ( current_theme_supports( 'custom-header' ) && current_user_can( 'customize' ) ) {
    232232    $customize_header_url      = add_query_arg( array( 'autofocus' => array( 'control' => 'header_image' ) ), $customize_url );
    233     $submenu['themes.php'][15] = array( __( 'Header' ), $appearance_cap, esc_url( $customize_header_url ), '', 'hide-if-no-customize' );
     233    $submenu['themes.php'][15] = array( _x( 'Header', 'custom image header' ), $appearance_cap, esc_url( $customize_header_url ), '', 'hide-if-no-customize' );
    234234}
    235235
    236236if ( current_theme_supports( 'custom-background' ) && current_user_can( 'customize' ) ) {
    237237    $customize_background_url  = add_query_arg( array( 'autofocus' => array( 'control' => 'background_image' ) ), $customize_url );
    238     $submenu['themes.php'][20] = array( __( 'Background' ), $appearance_cap, esc_url( $customize_background_url ), '', 'hide-if-no-customize' );
     238    $submenu['themes.php'][20] = array( _x( 'Background', 'custom background' ), $appearance_cap, esc_url( $customize_background_url ), '', 'hide-if-no-customize' );
    239239}
    240240
  • trunk/src/wp-includes/admin-bar.php

    r55416 r55881  
    10531053                'parent' => 'appearance',
    10541054                'id'     => 'background',
    1055                 'title'  => __( 'Background' ),
     1055                'title'  => _x( 'Background', 'custom background' ),
    10561056                'href'   => admin_url( 'themes.php?page=custom-background' ),
    10571057                'meta'   => array(
     
    10671067                'parent' => 'appearance',
    10681068                'id'     => 'header',
    1069                 'title'  => __( 'Header' ),
     1069                'title'  => _x( 'Header', 'custom image header' ),
    10701070                'href'   => admin_url( 'themes.php?page=custom-header' ),
    10711071                'meta'   => array(
  • trunk/src/wp-includes/block-template-utils.php

    r55817 r55881  
    6666        array(
    6767            'area'        => WP_TEMPLATE_PART_AREA_UNCATEGORIZED,
    68             'label'       => __( 'General' ),
     68            'label'       => _x( 'General', 'template part area' ),
    6969            'description' => __(
    7070                'General templates often perform a specific role like displaying post content, and are not tied to any particular area.'
     
    7575        array(
    7676            'area'        => WP_TEMPLATE_PART_AREA_HEADER,
    77             'label'       => __( 'Header' ),
     77            'label'       => _x( 'Header', 'template part area' ),
    7878            'description' => __(
    7979                'The Header template defines a page area that typically contains a title, logo, and main navigation.'
     
    8484        array(
    8585            'area'        => WP_TEMPLATE_PART_AREA_FOOTER,
    86             'label'       => __( 'Footer' ),
     86            'label'       => _x( 'Footer', 'template part area' ),
    8787            'description' => __(
    8888                'The Footer template defines a page area that typically contains site credits, social links, or any other combination of blocks.'
Note: See TracChangeset for help on using the changeset viewer.