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

Site Editor: Unnecessary commas in text of excerpt block of posts only in preview #49121

Closed
miminari opened this issue Mar 16, 2023 · 3 comments · Fixed by #49123
Closed

Site Editor: Unnecessary commas in text of excerpt block of posts only in preview #49121

miminari opened this issue Mar 16, 2023 · 3 comments · Fixed by #49123
Assignees
Labels
[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") Internationalization (i18n) Issues or PRs related to internationalization efforts [Type] Bug An existing feature does not function as intended

Comments

@miminari
Copy link
Member

Description

When I convert WordPress to Japanese and open the site editor, I get unnecessary commas in the text of the excerpt block of a post. This phenomenon has been observed only on the site editor. I tried changing to several other languages(簡体中文, Espanol etc.), but this occurred only in Japanese.

Step-by-step reproduction instructions

  1. Activate Block Theme.
  2. Change site language "日本語"
  3. Go to "Site Editor".

Screenshots, screen recording, code snippet

スクリーンショット 2023-03-16 9 37 25

Environment info

  • WordPress 6.1.1 and 6.2
  • Gutenberg 15.3.1
  • Mac OS 12.5.1
  • Google Chrome 111.0.5563.64

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

@miminari miminari added [Type] Bug An existing feature does not function as intended Internationalization (i18n) Issues or PRs related to internationalization efforts [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") labels Mar 16, 2023
@miminari
Copy link
Member Author

miminari commented Mar 16, 2023

And, this maybe same issue, in the frontend, it seems that Japanese post couldn`t excerpt correctly ( the texts are too long ). This phenomenon also occurred on English mode.
スクリーンショット 2023-03-16 10 07 21

@t-hamano
Copy link
Contributor

@miminari
Thanks for the report.

I think #49123 will solve this problem.

And, this maybe same issue, in the frontend, it seems that Japanese post couldn`t excerpt correctly ( the texts are too long ). This phenomenon also occurred on English mode.

This problem is caused by the fact that the word count rules change depending on the site language.

If the site language is English, the text divided by a space is considered a single word. Therefore, if the target text is in a language where it is desirable to count according to that rule, the word count will work as expected. However, for languages such as Japanese, where one character should be counted as one word, this rule will not work correctly.

If you change the language of your site to Japanese, the Japanese excerpts will be trimmed to the expected length. Instead, the English excerpts will not work as expected because they are counted character by character.

Ideally, the language of the given text should be parsed and counting rules applied according to that language, but I think that is a separate issue to be discussed.

@miminari
Copy link
Member Author

miminari commented Mar 17, 2023

@t-hamano Thanks for the super-fast PR!

I've figured out my misunderstanding.
And, It is too tough for me (maybe everyone) to get into the matter of the word count rule 🤪

If there is a site that needs to handle multilingual articles at the same time, I think it would be safe to use CSS on the theme or plugin side 😉

@priethor priethor removed the [Status] In Progress Tracking issues with work in progress label May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") Internationalization (i18n) Issues or PRs related to internationalization efforts [Type] Bug An existing feature does not function as intended
3 participants