Make WordPress Core

Changeset 60187


Ignore:
Timestamp:
04/25/2025 06:26:40 PM (4 weeks ago)
Author:
joedolson
Message:

Editor: Use different keys in array of translatable strings.

[59696] changed the 'Text' tab of the classic editor to 'Code' but Code was already used as a key in the array of translatable text. Since arrays keys need to be unique, this meant that it is possible for the wrong translation to appear in a locale. Using different keys fixes that.

Reviewed by joedolson.
Merges [60182] to the 6.8 branch.

Props joedolson, sabernhardt, justlevine, swissspidy, audrasjb.
Fixes #63269. See #38061.

Location:
branches/6.8
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/6.8

  • branches/6.8/src/js/_enqueues/wp/editor/base.js

    r59696 r60187  
    12941294                            id: id + '-html',
    12951295                            'class': 'wp-switch-editor switch-html'
    1296                         }).text( window.tinymce.translate( 'Code' ) ) )
     1296                        }).text( window.tinymce.translate( 'Code|tab' ) ) )
    12971297                    ).append( $editorContainer )
    12981298            );
  • branches/6.8/src/wp-includes/class-wp-editor.php

    r59696 r60187  
    13971397                'Link options'                         => __( 'Link options' ), // Tooltip for the 'link options' button in the inline link dialog.
    13981398                'Visual'                               => _x( 'Visual', 'Name for the Visual editor tab' ),             // Editor switch tab label.
    1399                 'Code'                                 => _x( 'Code', 'Name for the Code editor tab (formerly Text)' ), // Editor switch tab label.
     1399                'Code|tab'                             => _x( 'Code', 'Name for the Code editor tab (formerly Text)' ), // Editor switch tab label.
    14001400                'Add Media'                            => array( __( 'Add Media' ), 'accessM' ), // Tooltip for the 'Add Media' button in the block editor Classic block.
    14011401
Note: See TracChangeset for help on using the changeset viewer.