Fix languages not being sorted correctly

This commit is contained in:
Pk11 2022-03-20 16:23:55 -05:00
parent fd746e76a0
commit 6ceec5def8
2 changed files with 32 additions and 32 deletions

View File

@ -1,23 +1,23 @@
{
"da-DK": "Dansk",
"de-DE": "Deutsch",
"en-US": "English",
"es-ES": "Español",
"fr-FR": "Français",
"he-IL": "עברית",
"hu-HU": "Magyar",
"id-ID": "Bahasa Indonesia",
"it-IT": "Italiano",
"ja-JP": "日本語",
"ko-KR": "한국어",
"nl-NL": "Nederlands",
"no-NO": "Norsk",
"pl-PL": "Polski",
"pt-PT": "Português",
"ru-RU": "Русский",
"sv-SE": "Svenska",
"tr-TR": "Türkçe",
"uk-UA": "Українська",
"zh-CN": "中文 (简体)",
"zh-TW": "中文 (繁體)"
"Dansk": "da-DK",
"Deutsch": "de-DE",
"English": "en-US",
"Español": "es-ES",
"Français": "fr-FR",
"עברית": "he-IL",
"Magyar": "hu-HU",
"Bahasa Indonesia": "id-ID",
"Italiano": "it-IT",
"日本語": "ja-JP",
"한국어": "ko-KR",
"Nederlands": "nl-NL",
"Norsk": "no-NO",
"Polski": "pl-PL",
"Português": "pt-PT",
"Русский": "ru-RU",
"Svenska": "sv-SE",
"Türkçe": "tr-TR",
"Українська": "uk-UA",
"中文 (简体)": "zh-CN",
"中文 (繁體)": "zh-TW"
}

View File

@ -37,18 +37,18 @@
</svg>
</button>
<ul class="dropdown-menu dropdown-menu-sm-end hover-content" id="language-dropdown">
{% for collection in site.collections %}
{% unless collection.label == "ic-IC" %}
{% assign langs = site.data.lang-names | sort %}
{% for lang in langs %}
{% assign collection = site.collections | where_exp: "c", "c.label == lang[1]" | first %}
{% assign path = page.path | replace: page.collection, collection.label %}
{% assign item = site[collection.label] | where: "path", path | first %}
{% if item %}
{% if item.lang != "en-US" or item.collection == "en-US" %}
<li><a class="dropdown-item {% if item.lang == page.collection %}active{% endif %}" lang="{{ item.lang }}" href="{{ item.url | remove: "index.html" | remove: ".html" }}" dir="{% if site.data.rtl contains item.collection %}rtl{%else%}ltr{% endif %}">{{ site.data.lang-names[item.lang] }}</a></li>
{% if item and item.lang != "en-US" or item.collection == "en-US" %}
<li><a class="dropdown-item {% if item.lang == page.collection %}active{% endif %}" lang="{{ item.lang }}" href="{{ item.url | remove: "index.html" | remove: ".html" }}" dir="{% if site.data.rtl contains item.collection %}rtl{%else%}ltr{% endif %}">{{ lang[0] }}</a></li>
{% endif %}
{% endif %}
{% endunless %}
{% endfor %}
<li><hr class="dropdown-divider"></li>
{% assign path = page.path | replace: page.collection, "ic-IC" %}
{% assign item = site.ic-IC | where: "path", path | first %}
{% if item %}