<h3 dir="auto">Description</h3>
<p dir="auto">In Unicode, some CJK characters such as 化 have one codepoint but will appear differently in Simplified Chinese (<span lang="zh-Hans">化</span>), Traditional Chinese (<span lang="zh-Hant">化</span>), and Japanese (<span lang="ja">化</span>). On the frontend, we can display names correctly using an HTML attribute such as <code class="notranslate">lang="zh-Hant"</code> This issue is known as <a href="https://en.wikipedia.org/wiki/Han_unification" rel="nofollow">Han unification</a> and it has appeared over the years <a href="https://issues.chromium.org/issues/41315603" rel="nofollow">in many software projects</a></p>
<p dir="auto">This was addressed in iD <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2817395783" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/iD/issues/10716" data-hovercard-type="pull_request" data-hovercard-url="/openstreetmap/iD/pull/10716/hovercard" href="https://github.com/openstreetmap/iD/pull/10716">openstreetmap/iD#10716</a> and is a long-running discussion in openstreetmap-carto.</p>
<p dir="auto">If we add <code class="notranslate">&addressdetails=1</code> to Nominatim queries, we can read the country_code and display the best label for mainland China, Hong Kong, Japan, or Taiwan.</p>
<h3 dir="auto">How has this been tested?</h3>
<p dir="auto">This can be tricky to test, as <strong>many names do not change</strong>, and the display_name will be in your browser's language if it's available</p>
<ul dir="auto">
<li>Search results will have a lang tag, such as <code class="notranslate">lang="zh-HK"</code> or <code class="notranslate">lang="ja"</code>, regardless of language of display_name</li>
<li>In Taiwan, a search result for <span lang="zh-Hant">彰化</span> should show a horizontal bar in <span lang="zh-Hant">化</span></li>
<li>In mainland China, a search result for <span lang="zh-Hans">玉门 expressway</span> should return a split frame <span lang="zh-Hans">门</span>  in the second character, not the 门 with a +</li>
</ul>
<h3 dir="auto">Notes</h3>
<p dir="auto">As an alternative to adding <code class="notranslate">&addressdetails=1</code> to queries, we could possibly parse display_name (varies with the browser language) or use geo bounding boxes?</p>
<p dir="auto">This matching of languages is imperfect, but without a language tag we are always using your browser's default for any CJK character. It would be difficult to make exceptions (for example, Japanese restaurants in these countries) without a name regex, a language tag, or access to other tags</p>
<p dir="auto">This does not affect Chinese names in other countries</p>
<p dir="auto">I have heard that there are some variations for Cyrillic in <a href="https://en.wikipedia.org/wiki/Bulgarian_alphabet" rel="nofollow">Bulgaria</a> and <a href="https://en.wikipedia.org/wiki/Serbian_Cyrillic_alphabet#Differences_from_other_Cyrillic_alphabets" rel="nofollow">Serbia</a>, particularly in italics? But I don't know how universal it is. <a href="https://commons.wikimedia.org/wiki/File:Special_Cyrillics_BGDPT.svg" rel="nofollow">Additional info</a></p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/openstreetmap/openstreetmap-website/pull/6079'>https://github.com/openstreetmap/openstreetmap-website/pull/6079</a></p>

<h4>Commit Summary</h4>
<ul>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/6079/commits/73445bfcd9bf02b34a4ef85e026299d5856d4fda" class="commit-link">73445bf</a>  add lang attribute to results from CJK countries, plus Cyrillic</li>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/6079/commits/b90d47bba5ac9fd4ed85331684aa32cb2bf8d92f" class="commit-link">b90d47b</a>  remove Bulgaria/Serbia for now</li>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/6079/commits/72a1995031f0ff809d977fcc933ffe7893da5530" class="commit-link">72a1995</a>  fix HK subregion</li>
</ul>

<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/openstreetmap/openstreetmap-website/pull/6079/files">3 files</a>)</p>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/6079/files#diff-aa536e139b3e6adc9cf65c55fffec124e07c1d23e2186083fa4190c219551740">app/controllers/concerns/nominatim_methods.rb</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/6079/files#diff-66f1b57c319cb649978e1ed7a82a34d277edb39b26a448dc5cb19d55a7e435c9">app/controllers/searches/nominatim_queries_controller.rb</a>
    (7)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/6079/files#diff-bed4ca7da5223552daa225793ab8007631d3d86673a13728e29be74bbf47dd00">app/helpers/geocoder_helper.rb</a>
    (2)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/6079.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/6079.patch</a></li>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/6079.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/6079.diff</a></li>
</ul>

<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">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLK4EUXM2SNCDOEP7UD3BO6I5AVCNFSM6AAAAAB6L3HHASVHI2DSMVQWIX3LMV43ASLTON2WKOZTGEYDQMZXGIYTIMI">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLPMXT56UUYBXSPQSGL3BO6I5A5CNFSM6AAAAAB6L3HHASWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHLSRP6VU.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</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",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/6079",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>