diff options
author | Aaron Jorbin <jorbin@git.wordpress.org> | 2025-04-24 22:20:56 +0000 |
---|---|---|
committer | Aaron Jorbin <jorbin@git.wordpress.org> | 2025-04-24 22:20:56 +0000 |
commit | 3854c2cc10dc09487476bc8c5ce9badf8a9d4cf6 (patch) | |
tree | 9c218136947b84245e8569020353cf8a9eecf97d /src | |
parent | 478a5ab5805e67524841913db5aa8bc1228dcf46 (diff) | |
download | wordpress-3854c2cc10dc09487476bc8c5ce9badf8a9d4cf6.tar.gz wordpress-3854c2cc10dc09487476bc8c5ce9badf8a9d4cf6.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/js/_enqueues/wp/editor/base.js | 2 | ||||
-rw-r--r-- | src/wp-includes/class-wp-editor.php | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/js/_enqueues/wp/editor/base.js b/src/js/_enqueues/wp/editor/base.js index 34c3705398..3ba7de8dbf 100644 --- a/src/js/_enqueues/wp/editor/base.js +++ b/src/js/_enqueues/wp/editor/base.js @@ -1293,7 +1293,7 @@ window.wp = window.wp || {}; .append( $button.attr({ id: id + '-html', 'class': 'wp-switch-editor switch-html' - }).text( window.tinymce.translate( 'Code' ) ) ) + }).text( window.tinymce.translate( 'Code|tab' ) ) ) ).append( $editorContainer ) ); diff --git a/src/wp-includes/class-wp-editor.php b/src/wp-includes/class-wp-editor.php index 8ec20d6b22..925d9d0b56 100644 --- a/src/wp-includes/class-wp-editor.php +++ b/src/wp-includes/class-wp-editor.php @@ -1396,7 +1396,7 @@ final class _WP_Editors { 'Apply' => __( 'Apply' ), // Tooltip for the 'apply' button in the inline link dialog. 'Link options' => __( 'Link options' ), // Tooltip for the 'link options' button in the inline link dialog. 'Visual' => _x( 'Visual', 'Name for the Visual editor tab' ), // Editor switch tab label. - 'Code' => _x( 'Code', 'Name for the Code editor tab (formerly Text)' ), // Editor switch tab label. + 'Code|tab' => _x( 'Code', 'Name for the Code editor tab (formerly Text)' ), // Editor switch tab label. 'Add Media' => array( __( 'Add Media' ), 'accessM' ), // Tooltip for the 'Add Media' button in the block editor Classic block. // Shortcuts help modal. |