Skip to content

Commit

Permalink
Add the codes for unlisted languages to languages list (#546)
Browse files Browse the repository at this point in the history
* Add the codes for unlisted languages to languages list

* Add the codes for unlisted languages to languages list

* Add article page for unlisted languages

* Show unlisted languages in code tags

* Show unlisted languages in code tagsand add a page for each one

* Remove unecessary imports

* Remove additional space from slugify

---------

Co-authored-by: Tovmas <tharrison748@gmail.com>
  • Loading branch information
tovmasharrison and Tovmas authored Oct 24, 2023
1 parent cac4154 commit 8fcd474
Show file tree
Hide file tree
Showing 499 changed files with 7,319 additions and 3,479 deletions.
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

0 comments on commit 8fcd474

Please sign in to comment.