-
Notifications
You must be signed in to change notification settings - Fork 1.9k
feat : add new language picker component #2040
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 11 commits
def57d6
7f02d3f
6c9d8d3
63a14f1
d85fa0e
29413a7
743f9cf
bd4ccc8
c553628
4333c86
2814d64
035d48c
25275d9
815495c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,11 +12,6 @@ | |
<nav id="navbar" aria-label="primary"> | ||
<input id="q" placeholder="🔎 search"> | ||
<ul id="navmenu"> | ||
<li> | ||
<a href="/" id="home-menu" {% if page.menu=='home' %} class="active" {% endif %}> | ||
{{ site.data[page.lang].menu.home }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Translations for this is removed. This link is redundant because express logo also points to homepage. |
||
</a> | ||
</li> | ||
<li id="getting-started-menu" class="submenu"> | ||
<a href="/{{ page.lang }}/starter/installing.html" {% if page.menu=='starter' %} class="active" {% endif%}> | ||
{{ site.data[page.lang].menu.getting_started }} | ||
|
@@ -252,6 +247,5 @@ | |
<span id="icon-sun">{% include icons/sun.svg %}</span> | ||
</button> | ||
{% include language-picker.html %} | ||
{% include language-picker-mobile.html %} | ||
</div> | ||
</header> |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,18 @@ | ||
<div class="desktop-lang-switcher"> | ||
{% assign url_parts = page.url | split: '/' %} | ||
{% assign url_remainder = url_parts | slice: 2, url_parts.size | join: '/' %} | ||
{% assign current_lang = page.lang %} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this should stay, otherwise we won’t be able to know the current URL to keep the page where it was and only change the language. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right, thank you for pointing out. |
||
<button class="lang-btn" type="button" aria-haspopup="menu" aria-label="Change language"> | ||
<span id="current-lang"></span> | ||
</button> | ||
<ul class="lang-list submenu-content" aria-labelledby="current-lang" > | ||
{% for lang in site.data.languages %} | ||
<li> | ||
<a href="/{{ lang.code }}/{{ url_remainder }}"> | ||
{% if lang.code == current_lang %} | ||
<button id="langBtn" class="lang-btn" type="button" aria-expanded="false" aria-haspopup="listbox" aria-label="Change language"> | ||
{% include icons/i18n.svg %} | ||
</button> | ||
<ul id="langList" class="lang-list" role="listbox"> | ||
{% for lang in site.data.languages %} | ||
<li> | ||
<a href="/{{ lang.code }}/{{ url_remainder }}"> | ||
{% if lang.code == current_lang %} | ||
<strong>{{ lang.name }}</strong> | ||
{% else %} | ||
{% else %} | ||
{{ lang.name }} | ||
{% endif %} | ||
</a> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
<div id="languageData" data-languages='{{ site.data.languages | jsonify }}' style="display:none;"></div> | ||
</div> | ||
{% endif %} | ||
</a> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
</div> |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correcting header status string. Now lighthouse audit is not running because of wrong status checking.