Make WordPress Core

Changeset 55655


Ignore:
Timestamp:
04/18/2023 08:22:08 AM (20 months ago)
Author:
audrasjb
Message:

Twenty Nineteen: Fix a translation issue in Comments navigation text.

This changeset combines text strings for "Previous Comments" and "Next Comments" links to ensure translators can control word order in each string. The span tags are included in the translation to give more control over what is hidden on small screens.

Props sabernhardt.
Fixes #58149.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentynineteen/comments.php

    r55420 r55655  
    8888        // Show comment navigation.
    8989        if ( have_comments() ) :
    90             $prev_icon     = twentynineteen_get_icon_svg( 'chevron_left', 22 );
    91             $next_icon     = twentynineteen_get_icon_svg( 'chevron_right', 22 );
    92             $comments_text = __( 'Comments', 'twentynineteen' );
     90            $prev_icon = twentynineteen_get_icon_svg( 'chevron_left', 22 );
     91            $next_icon = twentynineteen_get_icon_svg( 'chevron_right', 22 );
    9392            the_comments_navigation(
    9493                array(
    95                     'prev_text' => sprintf( '%s <span class="nav-prev-text"><span class="primary-text">%s</span> <span class="secondary-text">%s</span></span>', $prev_icon, __( 'Previous', 'twentynineteen' ), __( 'Comments', 'twentynineteen' ) ),
    96                     'next_text' => sprintf( '<span class="nav-next-text"><span class="primary-text">%s</span> <span class="secondary-text">%s</span></span> %s', __( 'Next', 'twentynineteen' ), __( 'Comments', 'twentynineteen' ), $next_icon ),
     94                    'prev_text' => sprintf(
     95                        '%1$s <span class="nav-prev-text">%2$s</span>',
     96                        $prev_icon,
     97                        /* translators: Comments navigation link text. The secondary-text element is hidden on small screens. */
     98                        __( '<span class="primary-text">Previous</span> <span class="secondary-text">Comments</span>', 'twentynineteen' )
     99                    ),
     100                    'next_text' => sprintf(
     101                        '<span class="nav-next-text">%1$s</span> %2$s',
     102                        /* translators: Comments navigation link text. The secondary-text element is hidden on small screens. */
     103                        __( '<span class="primary-text">Next</span> <span class="secondary-text">Comments</span>', 'twentynineteen' ),
     104                        $next_icon
     105                    ),
    97106                )
    98107            );
Note: See TracChangeset for help on using the changeset viewer.