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

Blocks/Patterns with default content should be inserted in site language, not user language #65382

Closed
2 tasks done
senadir opened this issue Sep 16, 2024 · 1 comment
Closed
2 tasks done
Labels
Internationalization (i18n) Issues or PRs related to internationalization efforts [Type] Bug An existing feature does not function as intended

Comments

@senadir
Copy link
Contributor

senadir commented Sep 16, 2024

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.

  1. Set site language to something you're familiar with, say English.
  2. Set your profile language to something you're familiar with, say Spanish or French.
  3. Create a new page, insert a new pattern from the theme pattern repository.
  4. Notice the pattern is inserted in your profile language (Spanish or french).
  5. Go to frontend, the pattern is still in that language.

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:

  1. Set site language to something you're familiar with, say English.

  2. Set your profile language to something you're familiar with, say Spanish or French.

  3. In a new page, Insert the search block.

  4. Notice its label and button content are in french or spanish.

  5. Save the page, go to frontend, they're still in that language.

  6. Install WooCommerce.

  7. In a new page, insert Cart block.

  8. Visit the page in frontend. Notice its "Empty cart" title and description are in the second language.

Screenshots, screen recording, code snippet

image image

Environment info

  • WordPress 6.6
  • No Gutenberg.

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes
@senadir senadir added [Type] Bug An existing feature does not function as intended Internationalization (i18n) Issues or PRs related to internationalization efforts labels Sep 16, 2024
@senadir
Copy link
Contributor Author

senadir commented Sep 16, 2024

Duplicate of #52777 I think, closing.

@senadir senadir closed this as not planned Won't fix, can't repro, duplicate, stale Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Internationalization (i18n) Issues or PRs related to internationalization efforts [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

1 participant