Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Pattern edit_item string to Edit Block Pattern #4826

Conversation

andrewserong
Copy link
Contributor

Trac ticket: https://core.trac.wordpress.org/ticket/58716

Update the Pattern post type's edit_item label to be Edit Block Pattern instead of Edit Pattern to resolve an edge case in Google Chrome where Edit Pattern causes the browser to think that the page is in German, and therefore displays the translation popup.

After some digging, I couldn't work out why exactly Google Chrome thinks that the page is in German based on the string Edit Pattern, but my suspicion is that the server-rendered view of the block editor doesn't involve very many words, which could potentially contribute to it not recognising the language correctly (it appears to ignore the lang attribute set on the page). Updating to Edit Block Pattern appears to resolve the issue.

Before After
image image

Testing instructions

  1. Go to http://localhost:8889/wp-admin/edit.php?post_type=wp_block
  2. Edit an existing pattern (if you don't have any patterns, you'll need to add one first, then go back to the list and click Edit)
  3. With this PR applied, Google Chrome should no longer prompt to translate the page when the editor loads

This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

Copy link
Member

@ramonjd ramonjd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before

Screenshot 2023-07-11 at 1 19 30 pm

After

Screenshot 2023-07-11 at 1 18 51 pm

This is a good compromise for a very strange bug. Thank you @andrewserong

Copy link
Contributor

@tellthemachines tellthemachines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Can confirm this fixes the issue for me.

@tellthemachines
Copy link
Contributor

Committed in r56200 / 444bdf4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

3 participants