<p></p>
<p><b>@lonvia</b> commented on this pull request.</p>
<hr>
<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/6079#discussion_r2120256570">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">You cannot make such assumptions. Nominatim decides for each part of the display name separately which translation fits best. Consequently, this whole guessing here will go wrong if a user with Japanese language settings searches something in China and gets a result which is mixed Chinese/Japanese. It's also not clear to me, if a Japanese reader would rather expect Japanese han even in the Chinese-language parts or if that would only be the case when they are able to read the different han versions.</p>
<p dir="auto">Sounds to me like it is worth tackling language-tagging of the display name in Nominatim instead of making educated guesses here. We currently have a GSoC project running for transliteration of display names. Language-tagging will be a part of that. Should be feasible to return that information.</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#discussion_r2120256570">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLLNFGJWQB3QO73MEQL3BP2RZAVCNFSM6AAAAAB6L3HHASVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDQOBXGA2TSOBQGQ">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLNCVWBNALJIAPCWFLL3BP2RZA5CNFSM6AAAAAB6L3HHASWGG33NNVSW45C7OR4XAZNRKB2WY3CSMVYXKZLTORJGK5TJMV32UY3PNVWWK3TUL5UWJTVMCUEVY.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/2887059804</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#discussion_r2120256570",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/6079#discussion_r2120256570",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>