Skip to content

Commit 3854c2c

Browse files
committed
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. Props joedolson, sabernhardt, justlevine, swissspidy, audrasjb. Fixes #63269. See #38061. git-svn-id: https://develop.svn.wordpress.org/trunk@60182 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 478a5ab commit 3854c2c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/js/_enqueues/wp/editor/base.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1293,7 +1293,7 @@ window.wp = window.wp || {};
12931293
.append( $button.attr({
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
);
12991299

src/wp-includes/class-wp-editor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1396,7 +1396,7 @@ private static function get_translation() {
13961396
'Apply' => __( 'Apply' ), // Tooltip for the 'apply' button in the inline link dialog.
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

14021402
// Shortcuts help modal.

0 commit comments

Comments
 (0)