<p></p>
<p><b>@1ec5</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/6079#discussion_r2120014580">app/controllers/searches/nominatim_reverse_queries_controller.rb</a>:</p>
<pre style='color:#555'>> @@ -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
</pre>
<p dir="auto">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 <code class="notranslate">extratags</code>, could we determine whether the display name is based on one of the preferred interface languages or falling back to <code class="notranslate">name=*</code>?</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/6079#pullrequestreview-2886672465">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLOM4UGO3IV5S465QIL3BPHBJAVCNFSM6AAAAAB6L3HHASVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDQOBWGY3TENBWGU">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLP763GFBYNWXA2EKLL3BPHBJA5CNFSM6AAAAAB6L3HHASWGG33NNVSW45C7OR4XAZNRKB2WY3CSMVYXKZLTORJGK5TJMV32UY3PNVWWK3TUL5UWJTVMB4QFC.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/6079/review/2886672465</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/6079#pullrequestreview-2886672465",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/6079#pullrequestreview-2886672465",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>