Skip to content

Content Classification: Make character count locale-aware #571

@t-hamano

Description

@t-hamano

Description

Content classification requires more than 150 words to be enabled. However, CJK languages like Japanese and Chinese do not use spaces between words. Consequently, this feature cannot be utilized even with sufficient content.

We should adopt a locale-aware approach rather than hard-coding the words. So, as the word count type, we should use the translated text.

https://github.com/WordPress/gutenberg/blob/1ecc3d2fe9c819af35ef312563805bc16a103036/packages/block-library/src/post-time-to-read/edit.js#L51-L61

'Add more content to enable AI suggestions (approximately 150 words).',

This text should also change depending on whether it is counted by words or characters.

Add more content to enable AI suggestions (approximately 150 words).
Add more content to enable AI suggestions (approximately 150 characters).

Step-by-step reproduction instructions

  • Change the site language to Japanese.
  • Open a post.
  • Copy the following Japanese text multiple times to create content: こんにちは。
  • Confirm that the Suggest Categories button remains disabled.

Screenshots, screen recording, code snippet

Image

Environment info

No response

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

  • Yes

Please confirm that you have tested with all plugins deactivated except the AI plugin.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Type] BugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    In progress

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions