mirror of
https://github.com/rvtr/wiki.git
synced 2025-10-31 06:31:13 -04:00
Move config data to data files and link crowdin in language
This commit is contained in:
parent
76509bc782
commit
7191630b9b
23
_config.yml
23
_config.yml
@ -48,26 +48,3 @@ collections:
|
|||||||
output: true
|
output: true
|
||||||
zh-TW:
|
zh-TW:
|
||||||
output: true
|
output: true
|
||||||
|
|
||||||
lang-names:
|
|
||||||
da-DK: Dansk
|
|
||||||
de-DE: Deutsch
|
|
||||||
en-US: English
|
|
||||||
es-ES: Español
|
|
||||||
fr-FR: Français
|
|
||||||
he-IL: עברית
|
|
||||||
hu-HU: Magyar
|
|
||||||
it-IT: Italiano
|
|
||||||
ja-JP: 日本語
|
|
||||||
ko-KR: 한국어
|
|
||||||
no-NO: Norsk bokmål
|
|
||||||
pl-PL: Polski
|
|
||||||
pt-PT: Português
|
|
||||||
ru-RU: Русский
|
|
||||||
sv-SE: Svenska
|
|
||||||
tr-TR: Türkçe
|
|
||||||
uk-UA: Українська
|
|
||||||
zh-CN: 中文 (简体)
|
|
||||||
zh-TW: 中文 (繁體)
|
|
||||||
|
|
||||||
rtl: [he-IL]
|
|
||||||
19
_data/crowdin-languages.yml
Normal file
19
_data/crowdin-languages.yml
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
da-DK: da
|
||||||
|
de-DE: de
|
||||||
|
# en-US:
|
||||||
|
es-ES: es
|
||||||
|
fr-FR: fr
|
||||||
|
# he-IL:
|
||||||
|
hu-HU: hu
|
||||||
|
it-IT: it
|
||||||
|
ja-JP: ja
|
||||||
|
# ko-KR:
|
||||||
|
# no-NO:
|
||||||
|
pl-PL: pl
|
||||||
|
pt-PT: pt
|
||||||
|
ru-RU: ru
|
||||||
|
# sv-SE:
|
||||||
|
tr-TR: tr
|
||||||
|
uk-UA: uk
|
||||||
|
# zh-CN:
|
||||||
|
# zh-TW:
|
||||||
21
_data/lang-names.json
Normal file
21
_data/lang-names.json
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"da-DK": "Dansk",
|
||||||
|
"de-DE": "Deutsch",
|
||||||
|
"en-US": "English",
|
||||||
|
"es-ES": "Español",
|
||||||
|
"fr-FR": "Français",
|
||||||
|
"he-IL": "עברית",
|
||||||
|
"hu-HU": "Magyar",
|
||||||
|
"it-IT": "Italiano",
|
||||||
|
"ja-JP": "日本語",
|
||||||
|
"ko-KR": "한국어",
|
||||||
|
"no-NO": "Norsk bokmål",
|
||||||
|
"pl-PL": "Polski",
|
||||||
|
"pt-PT": "Português",
|
||||||
|
"ru-RU": "Русский",
|
||||||
|
"sv-SE": "Svenska",
|
||||||
|
"tr-TR": "Türkçe",
|
||||||
|
"uk-UA": "Українська",
|
||||||
|
"zh-CN": "中文 (简体)",
|
||||||
|
"zh-TW": "中文 (繁體)"
|
||||||
|
}
|
||||||
3
_data/rtl.json
Normal file
3
_data/rtl.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[
|
||||||
|
"he-IL"
|
||||||
|
]
|
||||||
@ -11,7 +11,7 @@
|
|||||||
</title>
|
</title>
|
||||||
|
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||||
{% if site.rtl contains page.collection %}
|
{% if site.data.rtl contains page.collection %}
|
||||||
<link id="bootstrap-stylesheet" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/css/bootstrap.rtl.min.css" integrity="sha384-mUkCBeyHPdg0tqB6JDd+65Gpw5h/l8DKcCTV2D2UpaMMFd7Jo8A+mDAosaWgFBPl" crossorigin="anonymous">
|
<link id="bootstrap-stylesheet" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/css/bootstrap.rtl.min.css" integrity="sha384-mUkCBeyHPdg0tqB6JDd+65Gpw5h/l8DKcCTV2D2UpaMMFd7Jo8A+mDAosaWgFBPl" crossorigin="anonymous">
|
||||||
{% else %}
|
{% else %}
|
||||||
<link id="bootstrap-stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1" crossorigin="anonymous">
|
<link id="bootstrap-stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1" crossorigin="anonymous">
|
||||||
|
|||||||
@ -47,14 +47,14 @@
|
|||||||
{% for item in site[collection.label] %}
|
{% for item in site[collection.label] %}
|
||||||
{% assign itemRef = item.url | split: item.lang | last %}
|
{% assign itemRef = item.url | split: item.lang | last %}
|
||||||
{% if itemRef == ref %}
|
{% if itemRef == ref %}
|
||||||
<li><a class="dropdown-item{% if item.lang == page.collection %} active{% endif %}" data-language-id="{{ item.lang }}" href="{{ item.url | remove: ".html" }}">{{ site.lang-names[item.lang] }}</a></li>
|
<li><a class="dropdown-item{% if item.lang == page.collection %} active{% endif %}" data-language-id="{{ item.lang }}" href="{{ item.url | remove: ".html" }}">{{ site.data.lang-names[item.lang] }}</a></li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endunless %}
|
{% endunless %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<li><hr class="dropdown-divider"></li>
|
<li><hr class="dropdown-divider"></li>
|
||||||
<li><a class="dropdown-item" href="{% for item in site.ic-IC %}{% assign itemRef = item.url | split: item.collection | last %}{% if itemRef == ref %}{{ item.url | remove: ".html" }}{% endif %}{% endfor %}">{{ site.data[page.collection].strings.translate-here }}</a></li>
|
<li><a class="dropdown-item" href="{% for item in site.ic-IC %}{% assign itemRef = item.url | split: item.collection | last %}{% if itemRef == ref %}{{ item.url | remove: ".html" }}{% endif %}{% endfor %}">{{ site.data[page.collection].strings.translate-here }}</a></li>
|
||||||
<li><a class="dropdown-item" href="https://crowdin.com/project/ds-homebrew-wiki">{{ site.data[page.collection].strings.translate-on-crowdin }}</a></li>
|
<li><a class="dropdown-item" href="https://{% if site.data.crowdin-languages contains page.collection %}{{ site.data.crowdin-languages[page.collection] }}.{% endif %}crowdin.com/project/ds-homebrew-wiki">{{ site.data[page.collection].strings.translate-on-crowdin }}</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="{{ page.collection | default: "en-US" }}" {% if site.rtl contains page.collection %}dir="rtl"{% endif %}>
|
<html lang="{{ page.collection | default: "en-US" }}" {% if site.data.rtl contains page.collection %}dir="rtl"{% endif %}>
|
||||||
{% include head.html%}
|
{% include head.html%}
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@ -3,7 +3,7 @@ layout: compress
|
|||||||
---
|
---
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="{{ page.collection | default: "en-US" }}" {% if site.rtl contains page.collection %}dir="rtl"{% endif %}>
|
<html lang="{{ page.collection | default: "en-US" }}" {% if site.data.rtl contains page.collection %}dir="rtl"{% endif %}>
|
||||||
{% include head.html%}
|
{% include head.html%}
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user