OSMCha / osmcha-frontend

Frontend for the osmcha-django REST API
https://osmcha.org
ISC License
121 stars 37 forks source link

Location search doesn't work with Chinese input method #538

Open c933103 opened 3 years ago

c933103 commented 3 years ago

I'm submitting a bug report

Brief Description

I am trying to search for a location name in Chinese but the website failed to recognize input

How do we replicate the issue ?

  1. Use the browser environment and input method specified below
  2. Go to the "Location" input box in "filter" part of the page
  3. Type Chinese names of location, like "新疆"

What is the expected behaviour ?

The website should be able to recognize the Chinese input and search location that contain the matching Chinese name

What is the current behaviour, (attach relevant screenshots) ?

It still tell me "Type to search" even after I finished typing, as if I didn't type anything image

When does this occur ?

Always

Please tell us about your environment:

Windows 10 Vivaldi 3.3.2022.47 Browser addon: Google Input Method Google Input Method setting: Cantonese Phonetic Input mode: Chinese characters, Half-width, Chinese punctuation

Other Information / context:

willemarcel commented 2 years ago

I think the problem here is that we enable the search only when we type 3 characters. We should check the locale of the browser and enable it with any number of chars when the locale is Japanese, Chinese, Korean and some other Asiatic languages.

lliehu commented 1 year ago

I would like to work on this.

With that said, this requirement of at least 3 characters is not a problem only in certain Asian locales. There are also multiple cities, municipalities etc. where the name is only 2 Latin-script letters. Examples:

I would start with:

Browser locale and input method can correlate with the used script but as far as I understand these are separate concepts. You can type place names in Chinese while using the browser in a different language and still want those Chinese search results.

If we didn't require any number of characters, the logic would be simpler and allow searching also certain place names where the whole name is just 1 Latin-script letter. Examples can be seen in the above mentioned list of short place names. Could we somehow make it possible to remove this limit completely? Would this perhaps require limiting the number of results when the number of characters is small?