Blocks/Patterns with default content should be inserted in site language, not user language #65382
Closed
2 tasks done
Labels
Internationalization (i18n)
Issues or PRs related to internationalization efforts
[Type] Bug
An existing feature does not function as intended
Description
I noticed this issue when dealing with a site that has a different language than the current user, in which if you insert a pattern or a block with default content, it will be inserted in the user language, and saved in the user langauge, instead of the site language. This is confusing because user language should be limited to admin only, but the editor canvas should reflect frontend language, which is always site language.
This has nothing to do with multilanguage and you don't need any multi language plugins to see it. If you're a freelancer that builds websites in different languages, you get this. I build Arabic websites but set my profile to English just because I'm used to English terms, now any content I insert is in English.
I'm cc-ing who I know is familiar and worked most with languages, @swissspidy
Step-by-step reproduction instructions
You can reproduce this using either patterns or a block that has default content.
Now you might say patterns are meant to be edited, but not all patterns are built that way, still, as a block developer, I run into this issue.
You can reproduce this with core blocks or 3rd party blocks, I will include both examples:
Set site language to something you're familiar with, say English.
Set your profile language to something you're familiar with, say Spanish or French.
In a new page, Insert the search block.
Notice its label and button content are in french or spanish.
Save the page, go to frontend, they're still in that language.
Install WooCommerce.
In a new page, insert Cart block.
Visit the page in frontend. Notice its "Empty cart" title and description are in the second language.
Screenshots, screen recording, code snippet
Environment info
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
The text was updated successfully, but these errors were encountered: