WordPress.org

Make WordPress Core

Changeset 48861


Ignore:
Timestamp:
08/26/2020 01:33:45 AM (14 months ago)
Author:
SergeyBiryukov
Message:

Twenty Twenty: Add context to adjectives and homonyms.

This allows for better localization in languages where adjectives are translated differently depending on which noun they modify, or when a different translation is required for a noun vs. a verb.

Props dimadin, justinahinon.
Fixes #49797.

Location:
trunk/src/wp-content/themes/twentytwenty
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentytwenty/classes/class-twentytwenty-customize.php

    r48782 r48861  
    123123                    'label'   => __( 'Primary Color', 'twentytwenty' ),
    124124                    'choices' => array(
    125                         'default' => __( 'Default', 'twentytwenty' ),
    126                         'custom'  => __( 'Custom', 'twentytwenty' ),
     125                        'default' => _x( 'Default', 'color', 'twentytwenty' ),
     126                        'custom'  => _x( 'Custom', 'color', 'twentytwenty' ),
    127127                    ),
    128128                )
  • trunk/src/wp-content/themes/twentytwenty/functions.php

    r48102 r48861  
    487487        ),
    488488        array(
    489             'name'  => __( 'Primary', 'twentytwenty' ),
     489            'name'  => _x( 'Primary', 'color', 'twentytwenty' ),
    490490            'slug'  => 'primary',
    491491            'color' => twentytwenty_get_color_for_area( 'content', 'text' ),
    492492        ),
    493493        array(
    494             'name'  => __( 'Secondary', 'twentytwenty' ),
     494            'name'  => _x( 'Secondary', 'color', 'twentytwenty' ),
    495495            'slug'  => 'secondary',
    496496            'color' => twentytwenty_get_color_for_area( 'content', 'secondary' ),
  • trunk/src/wp-content/themes/twentytwenty/header.php

    r46827 r48861  
    5151                                    <?php twentytwenty_the_theme_svg( 'search' ); ?>
    5252                                </span>
    53                                 <span class="toggle-text"><?php _e( 'Search', 'twentytwenty' ); ?></span>
     53                                <span class="toggle-text"><?php _ex( 'Search', 'toggle text', 'twentytwenty' ); ?></span>
    5454                            </span>
    5555                        </button><!-- .search-toggle -->
     
    8686                        ?>
    8787
    88                             <nav class="primary-menu-wrapper" aria-label="<?php esc_attr_e( 'Horizontal', 'twentytwenty' ); ?>" role="navigation">
     88                            <nav class="primary-menu-wrapper" aria-label="<?php echo esc_attr_x( 'Horizontal', 'menu', 'twentytwenty' ); ?>" role="navigation">
    8989
    9090                                <ul class="primary-menu reset-list-style">
     
    155155                                    <span class="toggle-inner">
    156156                                        <?php twentytwenty_the_theme_svg( 'search' ); ?>
    157                                         <span class="toggle-text"><?php _e( 'Search', 'twentytwenty' ); ?></span>
     157                                        <span class="toggle-text"><?php _ex( 'Search', 'toggle text', 'twentytwenty' ); ?></span>
    158158                                    </span>
    159159                                </button><!-- .search-toggle -->
  • trunk/src/wp-content/themes/twentytwenty/template-parts/modal-menu.php

    r46827 r48861  
    4646                    ?>
    4747
    48                     <nav class="expanded-menu<?php echo esc_attr( $expanded_nav_classes ); ?>" aria-label="<?php esc_attr_e( 'Expanded', 'twentytwenty' ); ?>" role="navigation">
     48                    <nav class="expanded-menu<?php echo esc_attr( $expanded_nav_classes ); ?>" aria-label="<?php echo esc_attr_x( 'Expanded', 'menu', 'twentytwenty' ); ?>" role="navigation">
    4949
    5050                        <ul class="modal-menu reset-list-style">
     
    7171                    ?>
    7272
    73                     <nav class="mobile-menu" aria-label="<?php esc_attr_e( 'Mobile', 'twentytwenty' ); ?>" role="navigation">
     73                    <nav class="mobile-menu" aria-label="<?php echo esc_attr_x( 'Mobile', 'menu', 'twentytwenty' ); ?>" role="navigation">
    7474
    7575                        <ul class="modal-menu reset-list-style">
Note: See TracChangeset for help on using the changeset viewer.