Make WordPress Core


Ignore:
Timestamp:
12/22/2020 04:19:26 PM (4 years ago)
Author:
desrosj
Message:

Twenty Twenty-One: Improve strings found in post navigations for easier translating.

This change adjusts strings found within post navigations to ensure translators are provided the full context needed to properly translate.

Props poena, SergeyBiryukov, aristath.
Merges [49866] to the 5.6 branch.
Fixes #52047.

Location:
branches/5.6
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.6

  • branches/5.6/src/wp-content/themes/twentytwentyone/single.php

    r49829 r49869  
    3737    $twentytwentyone_prev = is_rtl() ? twenty_twenty_one_get_icon_svg( 'ui', 'arrow_right' ) : twenty_twenty_one_get_icon_svg( 'ui', 'arrow_left' );
    3838
    39     $twentytwentyone_post_type      = get_post_type_object( get_post_type() );
    40     $twentytwentyone_post_type_name = '';
    41     if (
    42         is_object( $twentytwentyone_post_type ) &&
    43         property_exists( $twentytwentyone_post_type, 'labels' ) &&
    44         is_object( $twentytwentyone_post_type->labels ) &&
    45         property_exists( $twentytwentyone_post_type->labels, 'singular_name' )
    46     ) {
    47         $twentytwentyone_post_type_name = $twentytwentyone_post_type->labels->singular_name;
    48     }
    49 
    50     /* translators: %s: The post-type singular name (example: Post, Page, etc.) */
    51     $twentytwentyone_next_label = sprintf( esc_html__( 'Next %s', 'twentytwentyone' ), $twentytwentyone_post_type_name );
    52     /* translators: %s: The post-type singular name (example: Post, Page, etc.) */
    53     $twentytwentyone_previous_label = sprintf( esc_html__( 'Previous %s', 'twentytwentyone' ), $twentytwentyone_post_type_name );
     39    $twentytwentyone_next_label     = esc_html__( 'Next post', 'twentytwentyone' );
     40    $twentytwentyone_previous_label = esc_html__( 'Previous post', 'twentytwentyone' );
    5441
    5542    the_post_navigation(
Note: See TracChangeset for help on using the changeset viewer.