Remove 'langs' from language files and move them to their own 'languages.yml' file in /_data

The list of languages doesn't need to be translated, so there is no reason to keep it in the language files. Moved to its own
file (/_data/languages.yml). Now the language dropdown parses the languages from there.
This change is also needed for the migration to Weblate (which would ask translators to translate the language names).
This commit is contained in:
erciccione 2020-01-28 17:49:37 +01:00
parent bb514879b9
commit c82f3e3d7b
No known key found for this signature in database
GPG Key ID: 762AF8C608E56CDF
15 changed files with 22 additions and 218 deletions

14
_data/languages.yml Normal file
View File

@ -0,0 +1,14 @@
langs:
en: English
es: Español
it: Italiano
pl: Polski
fr: Français
ar: العربية
ru: Русский
de: Deutsch
nl: Nederlands
pt-br: Português do Brasil
tr: Türkçe
zh-cn: 简体中文
zh-tw: 繁體中文 臺灣

View File

@ -1,18 +1,3 @@
langs:
en: English
es: Español
it: Italiano
pl: Polski
fr: Français
ar: Arabic
ru: Русский
de: Deutsch
nl: Nederlands
pt-br: Português do Brasil
tr: Türkçe
zh-cn: 简体中文
zh-tw: 繁體中文 臺灣
global:
date: '%Y/%m/%d'
monero: مونيرو

View File

@ -1,18 +1,3 @@
langs:
en: English
es: Español
it: Italiano
pl: Polski
fr: Français
ar: العربية
ru: Русский
de: Deutsch
nl: Nederlands
pt-br: Português do Brasil
tr: Türkçe
zh-cn: 简体中文
zh-tw: 繁體中文 臺灣
global:
date: '%Y/%m/%d'
monero: Monero

View File

@ -1,18 +1,3 @@
langs:
en: English
es: Español
it: Italiano
pl: Polski
fr: Français
ar: العربية
ru: Русский
de: Deutsch
nl: Nederlands
pt-br: Português do Brasil
tr: Türkçe
zh-cn: 简体中文
zh-tw: 繁體中文 臺灣
global:
date: '%Y/%m/%d'
monero: Monero

View File

@ -1,18 +1,3 @@
langs:
en: English
es: Español
it: Italiano
pl: Polski
fr: Français
ar: العربية
ru: Русский
de: Deutsch
nl: Nederlands
pt-br: Português do Brasil
tr: Türkçe
zh-cn: 简体中文
zh-tw: 繁體中文 臺灣
global:
date: '%d/%m/%Y'
monero: Monero

View File

@ -1,18 +1,3 @@
langs:
en: English
es: Español
it: Italiano
pl: Polski
fr: Français
ar: العربية
ru: Русский
de: Deutsch
nl: Nederlands
pt-br: Português do Brasil
tr: Türkçe
zh-cn: 简体中文
zh-tw: 繁體中文 臺灣
global:
date: '%d/%m/%Y'
monero: Monero

View File

@ -1,18 +1,3 @@
langs:
en: English
es: Español
it: Italiano
pl: Polski
fr: Français
ar: العربية
ru: Русский
de: Deutsch
nl: Nederlands
pt-br: Português do Brasil
tr: Türkçe
zh-cn: 简体中文
zh-tw: 繁體中文 臺灣
global:
date: '%Y/%m/%d'
monero: Monero

View File

@ -1,18 +1,3 @@
langs:
en: English
es: Español
it: Italiano
pl: Polski
fr: Français
ar: العربية
ru: Русский
de: Deutsch
nl: Nederlands
pt-br: Português do Brasil
tr: Türkçe
zh-cn: 简体中文
zh-tw: 繁體中文 臺灣
global:
date: '%Y/%m/%d'
monero: Monero

View File

@ -1,18 +1,3 @@
langs:
en: English
es: Español
it: Italian
pl: Polski
fr: Français
ar: العربية
ru: Русский
de: Deutsch
nl: Nederlands
pt-br: Português do Brasil
tr: Türkçe
zh-cn: 简体中文
zh-tw: 繁體中文 臺灣
global:
date: '%Y/%m/%d'
monero: Monero

View File

@ -1,18 +1,3 @@
langs:
en: English
es: Español
it: Italiano
pl: Polski
fr: Français
ar: العربية
ru: Русский
de: Deutsch
nl: Nederlands
pt-br: Português do Brasil
tr: Türkçe
zh-cn: 简体中文
zh-tw: 繁體中文 臺灣
global:
date: '%Y/%m/%d'
monero: Monero

View File

@ -1,18 +1,3 @@
langs:
en: English
es: Español
it: Italiano
pl: Polski
fr: Français
ar: العربية
ru: Русский
de: Deutsch
nl: Nederlands
pt-br: Português do Brasil
tr: Türkçe
zh-cn: 简体中文
zh-tw: 繁體中文 臺灣
global:
date: '%Y/%m/%d'
monero: Monero

View File

@ -1,18 +1,3 @@
langs:
en: English
es: Español
it: Italiano
pl: Polski
fr: Français
ar: العربية
ru: Русский
de: Deutsch
nl: Nederlands
pt-br: Português do Brasil
tr: Türkçe
zh-cn: 简体中文
zh-tw: 繁體中文 臺灣
global:
date: '%Y/%m/%d'
monero: Monero

View File

@ -1,18 +1,3 @@
langs:
en: English
es: Español
it: Italiano
pl: Polski
fr: Français
ar: العربية
ru: Русский
de: Deutsch
nl: Nederlands
pt-br: Português do Brasil
tr: Türkçe
zh-cn: 简体中文
zh-tw: 繁體中文 臺灣
global:
date: '%Y/%m/%d'
monero: Monero

View File

@ -1,18 +1,3 @@
langs:
en: English
es: Español
it: Italiano
pl: Polski
fr: Français
ar: العربية
ru: Русский
de: Deutsch
nl: Nederlands
pt-br: Português do Brasil
tr: Türkçe
zh-cn: 简体中文
zh-tw: 繁體中文 臺灣
global:
date: '%Y/%m/%d'
monero: 門羅幣

View File

@ -71,22 +71,15 @@
<a href="{{site.baseurl}}/the-monero-project/" class="top-link">The Monero Project</a>
<div href="#" class="dropdown top-link language-change">
<input class="burger-checkdropdown" id="langdrop" type="checkbox">
<label for="langdrop">{% for lang in site.languages %}
{% if lang == site.lang %}
{% t langs.{{ lang }} %}
{%endif%}
{%endfor%}<div class="arrow-down"></div></label>
<label for="langdrop">{{ site.data.languages.langs.[site.lang] }}
<div class="arrow-down"></div></label>
<div class="dropdown-content text-center">
{% for lang in site.languages %}
{% for lang in site.languages %}
{% unless site.lang == lang %}
{% if lang == site.default_lang %}
<a href="{{ site.baseurl_root }}{{ page.url }}" >{% t langs.{{ lang }} %}</a>
<a href="{{ site.baseurl_root }}{{ page.url }}" >{{ site.data.languages.langs.[lang] }}</a>
{% else %}
<a href="{{ site.baseurl_root }}/{{ lang }}{{ page.url }}" >{% t langs.{{ lang }} %}</a>
<a href="{{ site.baseurl_root }}/{{ lang }}{{ page.url }}" >{{ site.data.languages.langs.[lang] }}</a>
{% endif %}
{% endunless %}
{% endfor %}
@ -136,21 +129,13 @@
<input class="burger-checkdropdown" id="moblangdrop" type="checkbox">
<label for="moblangdrop"><img src="/img/language.png" alt="Lang" class="icon-language"/><div class="arrow-down"></div></label>
<div class="mob dropdown-content text-center">
<p class="mob-lang-change mob-lang-selected">
{% for lang in site.languages %}
{% if site.lang == lang %}
{% t langs.{{ lang }} %}
{% endif %}
{% endfor %}
</p>
<p class="mob-lang-change mob-lang-selected">{{ site.data.languages.langs.[site.lang] }}</p>
{% for lang in site.languages %}
{% unless site.lang == lang %}
{% if lang == site.default_lang %}
<a class="mob-lang-change" href="{{ site.baseurl_root }}{{ page.url }}" >{% t langs.{{ lang }} %}</a>
<a class="mob-lang-change" href="{{ site.baseurl_root }}{{ page.url }}" >{{ site.data.languages.langs.[lang] }}</a>
{% else %}
<a class="mob-lang-change" href="{{ site.baseurl_root }}/{{ lang }}{{ page.url }}" >{% t langs.{{ lang }} %}</a>
<a class="mob-lang-change" href="{{ site.baseurl_root }}/{{ lang }}{{ page.url }}" >{{ site.data.languages.langs.[lang] }}</a>
{% endif %}
{% endunless %}
{% endfor %}