osm-americana / openstreetmap-americana

A quintessentially American map style
https://americanamap.org
Creative Commons Zero v1.0 Universal
183 stars 59 forks source link

Search localization #862

Open andreadecorte opened 1 year ago

andreadecorte commented 1 year ago

Hi, first all of thanks for the great work done here! I am quite interested in the internationalization part, and I noticed that search https://github.com/ZeLonewolf/openstreetmap-americana/blob/main/src/search.js#L149 is not defining any accept language. Photon seems to support only a limited number of choices (en; fr; de), so I was wondering if there was any though in improving this somehow (https://github.com/komoot/photon/issues/494 upstream bug doesn't look very promising).

For reference, Nominatim seems to supports many more languages out of the box. I think that the expectation would be that when switching languages, search would also respect that choice by passing the language values.

An example using Italian, the search for the term Ratisbona should return the city of Regensburg (see Nominatim), as per its name:it tag. It is not returned by Photon.

ZeLonewolf commented 1 year ago

I would welcome a PR from anyone that would like to work on this. The search component was constructed rather hastily and I'm sure there's lots of room for improvement.

andreadecorte commented 1 year ago

I can take a look at this. As this is mostly a data issue, the idea would be to port the geocoder to use Nominatim API with the proper language as parameter. Is there any strong reason for which we would need to keep using Photon instead?

ZeLonewolf commented 1 year ago

Yes, the goal of using Photon was to have a "search as you type" capability.