Page MenuHomePhabricator

Special:Translate's search function is missing results for Chinese query
Open, MediumPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Open the translate interface
  • Search a Chinese phrase for the translated strings
    • For instance, there is a translated string "苹果香蕉鸭梨"
    • I respectively search "苹果", "香蕉" and "鸭梨"

What happens?:
Only the first and the third query ("苹果" and "鸭梨") has result. "香蕉" has no result.

What should have happened instead?:
"香蕉" should have result.

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):
It's most likely because Chinese doesn't use space for word separation, and the search function only shows results at word boundaries as in other languages.
This should not be the case when the search query is Chinese.
(I believe this also affects Japanese)

Event Timeline

Indeed it only searches at the “start of a word”, which is defined as an English letter not preceded by an English letter, anything preceded by a space, or the start of the text. The latter two were added in T47546 to support at least non-Latin scripts that do use spaces, but this is obviously no solution for Chinese.

The easiest fix would be simply removing this start-of-word limitation: this would find 苹果香蕉鸭梨 if you search for 苹果, 香蕉, or even 果; and it would find “email” whether you search for “emai” or “mail”. I think it would be beneficial in Latin-script languages as well, but I don’t know how much searching anywhere would affect performance (I assume this limitation was added to improve performance almost twelve years ago in rETRAaffde5b5ead7fb7f45e2de851bb6d43f0b0cd04c).

Nikerabbit triaged this task as Medium priority.Nov 7 2024, 9:18 AM
Nikerabbit moved this task from Backlog to tux on the MediaWiki-extensions-Translate board.
Nikerabbit removed a project: translatewiki.net.