Skip to content

Commit 3624f6a

Browse files
committed
search url goes to the correct language for zh-hans and ja
1 parent 40aac83 commit 3624f6a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

templates/components/styles/global_nav.html.twig

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,13 @@
3939
</li>
4040
{%~ endfor %}
4141
<li class="top-nav-item">
42-
<a hreflang="en" href="https://www.w3.org/help/search/" class="nav-link icon-link">
42+
{% set locale = site.locale|default('en') %}
43+
{% if locale == 'zh-hans' or locale == 'ja' %}
44+
{% set search_url = 'https://www.w3.org/' ~ locale ~ '/help/search/' %}
45+
{% else %}
46+
{% set search_url = 'https://www.w3.org/help/search/' %}
47+
{% endif %}
48+
<a hreflang="en" href="{{ search_url }}" class="nav-link icon-link">
4349
<img class="icon" src="{{ absolute_url(asset('svg/search.svg', 'website-2021')) }}" width="24" height="24" alt aria-hidden="true">{# -#}
4450
<span class="hide-at-max-width">{{ 'header.search_link'|trans({}, 'w3c_website_templates_bundle') }}</span>
4551
</a>

0 commit comments

Comments
 (0)