[wp-trac] [WordPress Trac] #58716: Chrome opens Translate modal when opening a pattern from Manage Patterns

WordPress Trac noreply at wordpress.org
Mon Jul 10 01:02:55 UTC 2023


#58716: Chrome opens Translate modal when opening a pattern from Manage Patterns
--------------------------+---------------------
 Reporter:  eric.7186     |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  high          |   Milestone:  6.3
Component:  Editor        |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:
--------------------------+---------------------

Comment (by ramonopoly):

 Could this be a Chrome bug I wonder?

 I see there are two `<h1 />` tags in the file that renders the translation
 (src/wp-admin/edit-form-blocks.php)

 **First h1**: `<h1 class="screen-reader-text hide-if-no-js"><?php echo
 esc_html( $title ); ?></h1>`
 **Second h1**: `<h1 class="wp-heading-inline"><?php echo esc_html( $title
 ); ?></h1>`

 So the same string twice.

 As far as I can tell, it's the first h1 that is triggering the `de`
 translation detection.

 The following appears to **prevent the false language** detection:


 - Removing the first h1
 - Removing the text in the first h1
 - Adding an extra string, e.g., `?>!</h1>` after the php tag in the first
 h1
 - Adding an extra string, e.g., `</h1>!` after the closing first h1 tag

 Here's what I also tried that had **no effect** in my testing:

 - Removed classnames on the first h1
 - Changing the first h1 element to span
 - Removing the text in the second h1
 - Removing the second h1 completely
 - Changing the second h1 to h2
 - First h1 moved out of container `<div class="block-editor">`
 - Removing `esc_html` from first h1
 - Wrapping first h1 text in span

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58716#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list