tracestrack / react-localize-osm

A localization tool for openstreetmap
https://localize.osm.tracestrack.com
Mozilla Public License 2.0
9 stars 3 forks source link

Adding other languages (auto-detection) #13

Closed mnalis closed 8 months ago

mnalis commented 1 year ago

I miss Croatian (HR) specifically, but it would be nice if default language could be auto-detected from OSM preferences.

E.g. I have in my OSM preferred languages on https://www.openstreetmap.org/preferences set to following: en-US en hr

It would be nice if user-specified languages could be supported (and perhaps even selected automatically), by e.g. extracting all two-letter words from that string (which would yield en and hr in this specific case). Of course, language variants (like en-US or pt-BR could be supported too if easy enough).

And if I am not mistaken, since OsmLT already requests read your user preferences permission from OAuth, it should have access to those preferred languages values.


Alternatively, if implementing that is more complex than it seems, then could you hardcode support for Croatian? thanks.

soumendrak commented 1 year ago

Please add Odia language too.

quinncnl commented 11 months ago

Hi, thanks for your feedback. In next release we'll implement a newer approach that supports custom languages!

mnalis commented 8 months ago

In next release we'll implement a newer approach that supports custom languages!

Has it perhaps been worked on? I've seen several releases in the meantime, but I still can't select e.g. hr as a language at https://localize.osm.tracestrack.com ?

quinncnl commented 8 months ago

Hi @mnalis today I worked on it. Now it supports custom locale. Could you test it and provide some feedback?

Screenshot 2024-03-03 at 20 22 44
mnalis commented 8 months ago

Thanks @quinncnl I'm trying it out and it seems to be working fine. I can specify multiple languages and update them; even adding a new language seems to immediately automatically updates the fields without the need to click Get Names button again!


(Only thing I've noticed is that Get Names seems slow and often timeouts with errors like Runtime error: Query timed out in "query" at line 3 after 29 seconds for example for place=town filter on area 150x150km in Croatia; while for example overpass-turbo.eu returns 234 place=town nodes in ~2 seconds on much larger area of 500x500km - but I guess that is not related to adding this custom language support)

quinncnl commented 8 months ago

(Only thing I've noticed is that Get Names seems slow and often timeouts with errors like Runtime error: Query timed out in "query" at line 3 after 29 seconds for example for place=town filter on area 150x150km in Croatia; while for example overpass-turbo.eu returns 234 place=town nodes in ~2 seconds on much larger area of 500x500km - but I guess that is not related to adding this custom language support)

We look all three node/way/relation types for name tags. That could cause the query to be slower than only nodes. I'd suggest to zoom in before doing the search!