Skip to content
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

Add the codes for unlisted languages to languages list #546

Merged
merged 10 commits into from
Oct 24, 2023
  •  
  •  
  •  
1,310 changes: 1,310 additions & 0 deletions _data/languages.json

Large diffs are not rendered by default.

8 changes: 0 additions & 8 deletions _layouts/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ <h2>Language support</h2>
<ul>
{% for language in page.supported_languages %}
<li>
{% if language.slug %}
<a href="/{{ language.slug }}">
<code>{{ language.normalized_code }}</code>
{{ language.name }}
Expand All @@ -147,14 +146,7 @@ <h2>Language support</h2>
{% if language.normalized_code != language.code %}
⚠️ {{ page.title }} uses <code>{{ language.code }}</code>.
{% endif %}
{% else %}
<a href="https://en.wikipedia.org/wiki/ISO_639:{{ language.base_code }}" target="_blank">
<code>{{ language.code }}</code>
{% if language.variant_name %}
| {{ language.variant_name }}
{% endif %}
</a>
{% endif %}
</li>
{% endfor %}
</ul>
Expand Down
17 changes: 15 additions & 2 deletions _layouts/language.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
parent: Languages
---


<h1>
{{ page.title }}
</h1>
Expand All @@ -12,6 +13,18 @@ <h2>

<hr/>

{% unless page.names %}
<blockquote>
<p>
This language has not yet been fully added to Machine Translate.

You can add it to Machine Translate by getting the name, language family, script and typology to <a target="_blank" href="https://github.com/machinetranslate/machinetranslate.org/blob/master/_data/languages.json">languages.json</a> and submitting a pull request.

You may be able to find this information in <a target="_blank" href="https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes#{{ page.codes }}">its Wikipedia article.</a>
</p>
</blockquote>
{% endunless %}

<p>
Machine translation for the <strong>{{ page.title }}</strong> language is supported by <a href="#machine-translation">{{ page.supported_apis | size }} machine translation APIs</a>.
</p>
Expand All @@ -32,7 +45,7 @@ <h2>
<dt>Language family</dt>
<dd>
{% for family in page.family %}
<a href="/{{ family.slug }}">{{ family.name }}</a> {% unless forloop.last %}<{% endunless %}
<a href="/{{ family.slug }}">{{ family.name }}</a> {% unless forloop.last %}<{% endunless %}
{% endfor %}
</dd>

Expand All @@ -47,7 +60,7 @@ <h2>
<dt>Locale variants</dt>
<dd>
{% for variant in page.territories %}
<code style="white-space: nowrap;">{{ page.codes | first | append: '-' | append: variant }}</code>{% unless forloop.last %}{% endunless %}
<code style="white-space: nowrap;">{{ page.codes | first | append: '-' | append: variant }}</code>{% unless forloop.last %}{% endunless %}
{% endfor %}
</dd>

Expand Down
Loading