@1ec5 commented on this pull request.


> @@ -12,6 +14,14 @@ def create
       # ask nominatim
       response = fetch_xml(nominatim_reverse_query_url(:format => "xml"))
 
+      # add lang attribute for frontend in certain regions
+      addressparts = response.elements["reversegeocode/addressparts"]
+      lang = nil
+      if addressparts
+        region_code = addressparts.elements["ISO3166-2-lvl3"]&.text == "CN-HK" 
? "hk" : addressparts.elements["country_code"]&.text
+        lang = region_code ? LANGUAGE_CODES[region_code] : nil

Does this assume the displayed name is always in Chinese if the result is from 
China? That could result in suboptimal font selection and unexpected screen 
reader behavior if the name is in a different language due to the interface 
language. Based on `extratags`, could we determine whether the display name is 
based on one of the preferred interface languages or falling back to `name=*`?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6079#pullrequestreview-2886672465
You are receiving this because you are subscribed to this thread.

Message ID: 
<openstreetmap/openstreetmap-website/pull/6079/review/2886672...@github.com>
_______________________________________________
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to