Make WordPress Core


Ignore:
Timestamp:
02/07/2023 05:08:26 PM (2 years ago)
Author:
SergeyBiryukov
Message:

I18N: Mark screen reader strings as such with translator comments.

This aims to provide better context for translators and make it easier to determine that some strings contain hidden accessibility text and are not displayed in the UI.

Props kebbet, mercime, pavelevap, ocean90, swissspidy, Chouby, jipmoors, afercia, desrosj, costdev, audrasjb, SergeyBiryukov.
Fixes #29748.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-text-diff-renderer-table.php

    r55163 r55276  
    115115     */
    116116    public function addedLine( $line ) {
    117         return "<td class='diff-addedline'><span aria-hidden='true' class='dashicons dashicons-plus'></span><span class='screen-reader-text'>" . __( 'Added:' ) . " </span>{$line}</td>";
     117        return "<td class='diff-addedline'><span aria-hidden='true' class='dashicons dashicons-plus'></span><span class='screen-reader-text'>" .
     118            /* translators: Hidden accessibility text. */
     119            __( 'Added:' ) .
     120        " </span>{$line}</td>";
    118121
    119122    }
     
    126129     */
    127130    public function deletedLine( $line ) {
    128         return "<td class='diff-deletedline'><span aria-hidden='true' class='dashicons dashicons-minus'></span><span class='screen-reader-text'>" . __( 'Deleted:' ) . " </span>{$line}</td>";
     131        return "<td class='diff-deletedline'><span aria-hidden='true' class='dashicons dashicons-minus'></span><span class='screen-reader-text'>" .
     132            /* translators: Hidden accessibility text. */
     133            __( 'Deleted:' ) .
     134        " </span>{$line}</td>";
    129135    }
    130136
     
    136142     */
    137143    public function contextLine( $line ) {
    138         return "<td class='diff-context'><span class='screen-reader-text'>" . __( 'Unchanged:' ) . " </span>{$line}</td>";
     144        return "<td class='diff-context'><span class='screen-reader-text'>" .
     145            /* translators: Hidden accessibility text. */
     146            __( 'Unchanged:' ) .
     147        " </span>{$line}</td>";
    139148    }
    140149
Note: See TracChangeset for help on using the changeset viewer.