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.

git-svn-id: https://develop.svn.wordpress.org/trunk@48861 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2020-08-26 01:33:45 +00:00
parent 04d555e91d
commit ad9f02ed80
4 changed files with 9 additions and 9 deletions

View File

@ -122,8 +122,8 @@ if ( ! class_exists( 'TwentyTwenty_Customize' ) ) {
'section' => 'colors',
'label' => __( 'Primary Color', 'twentytwenty' ),
'choices' => array(
'default' => __( 'Default', 'twentytwenty' ),
'custom' => __( 'Custom', 'twentytwenty' ),
'default' => _x( 'Default', 'color', 'twentytwenty' ),
'custom' => _x( 'Custom', 'color', 'twentytwenty' ),
),
)
);

View File

@ -486,12 +486,12 @@ function twentytwenty_block_editor_settings() {
'color' => twentytwenty_get_color_for_area( 'content', 'accent' ),
),
array(
'name' => __( 'Primary', 'twentytwenty' ),
'name' => _x( 'Primary', 'color', 'twentytwenty' ),
'slug' => 'primary',
'color' => twentytwenty_get_color_for_area( 'content', 'text' ),
),
array(
'name' => __( 'Secondary', 'twentytwenty' ),
'name' => _x( 'Secondary', 'color', 'twentytwenty' ),
'slug' => 'secondary',
'color' => twentytwenty_get_color_for_area( 'content', 'secondary' ),
),

View File

@ -50,7 +50,7 @@
<span class="toggle-icon">
<?php twentytwenty_the_theme_svg( 'search' ); ?>
</span>
<span class="toggle-text"><?php _e( 'Search', 'twentytwenty' ); ?></span>
<span class="toggle-text"><?php _ex( 'Search', 'toggle text', 'twentytwenty' ); ?></span>
</span>
</button><!-- .search-toggle -->
@ -85,7 +85,7 @@
if ( has_nav_menu( 'primary' ) || ! has_nav_menu( 'expanded' ) ) {
?>
<nav class="primary-menu-wrapper" aria-label="<?php esc_attr_e( 'Horizontal', 'twentytwenty' ); ?>" role="navigation">
<nav class="primary-menu-wrapper" aria-label="<?php echo esc_attr_x( 'Horizontal', 'menu', 'twentytwenty' ); ?>" role="navigation">
<ul class="primary-menu reset-list-style">
@ -154,7 +154,7 @@
<button class="toggle search-toggle desktop-search-toggle" data-toggle-target=".search-modal" data-toggle-body-class="showing-search-modal" data-set-focus=".search-modal .search-field" aria-expanded="false">
<span class="toggle-inner">
<?php twentytwenty_the_theme_svg( 'search' ); ?>
<span class="toggle-text"><?php _e( 'Search', 'twentytwenty' ); ?></span>
<span class="toggle-text"><?php _ex( 'Search', 'toggle text', 'twentytwenty' ); ?></span>
</span>
</button><!-- .search-toggle -->

View File

@ -45,7 +45,7 @@
?>
<nav class="expanded-menu<?php echo esc_attr( $expanded_nav_classes ); ?>" aria-label="<?php esc_attr_e( 'Expanded', 'twentytwenty' ); ?>" role="navigation">
<nav class="expanded-menu<?php echo esc_attr( $expanded_nav_classes ); ?>" aria-label="<?php echo esc_attr_x( 'Expanded', 'menu', 'twentytwenty' ); ?>" role="navigation">
<ul class="modal-menu reset-list-style">
<?php
@ -70,7 +70,7 @@
if ( 'expanded' !== $mobile_menu_location ) {
?>
<nav class="mobile-menu" aria-label="<?php esc_attr_e( 'Mobile', 'twentytwenty' ); ?>" role="navigation">
<nav class="mobile-menu" aria-label="<?php echo esc_attr_x( 'Mobile', 'menu', 'twentytwenty' ); ?>" role="navigation">
<ul class="modal-menu reset-list-style">