Skip to content

Commit

Permalink
Use new video method & add video subtitles translations in "All WAI T…
Browse files Browse the repository at this point in the history
…ranslations" (w3c#377)

* Add symlink to video-metadata.yml

* Add symlink to wai-videos folder containing VTT files

* Automatically list Video Subtitles in All WAI Translations
  • Loading branch information
remibetin authored Nov 28, 2023
1 parent 45840c8 commit d38766c
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 15 deletions.
1 change: 1 addition & 0 deletions _data/video-metadata.yml
50 changes: 35 additions & 15 deletions translations.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,12 +265,21 @@ _Languages are listed alphabetically by language code. For example, "Chinese" is

{% assign lang1=site.documents | where_exp:"item", "item.lang != 'en'" | where_exp:"item", "item.lang != nil" | map: "lang" %}
{% assign lang2=site.pages | where_exp:"item", "item.lang != 'en'" | where_exp:"item", "item.lang != nil" | map: "lang" %}

{% for lang in page.translated_standards %}
{%- if forloop.first %}{% assign lang3 = lang.lang %}{%else%}{% assign lang3 = lang3 | append: "," | append: lang.lang %}{% endif -%}
{% endfor %}

{% assign lang3 = lang3 | split: "," %}
{% assign langs = lang3 | concat: lang2 | concat: lang1 | uniq | sort %}

{% assign video-translations=site.data.video-metadata | where_exp: "item", "item.name.en and item.main-page" | map: "subtitles" %}
{%- for video in video-translations -%}
{%- for video-lang in video -%}
{%- if forloop.first and forloop.parentloop.first -%}{% assign lang4 = video-lang %}{% else %}{% assign lang4 = lang4 | append: "," | append: video-lang %}{% endif -%}
{%- endfor -%}
{%- endfor -%}
{% assign lang4 = lang4 | split: ',' %}

{% assign langs = lang4 | concat: lang3 | concat: lang2 | concat: lang1 | uniq | sort %}

{%- for l in langs -%}
{% if l %}
Expand Down Expand Up @@ -344,26 +353,37 @@ _Languages are listed alphabetically by language code. For example, "Chinese" is
{% endif -%}
{% endfor %}

{% assign videos = site.data.video-metadata | where_exp: "item", "item.subtitles contains l and item.name.en and item.main-page" | sort: "main-page" %}
{% for video in videos %}
{%- assign alldocs=site.documents | concat: site.pages -%}
{%- assign t-video-page=alldocs | where: "ref", video.main-page | where: "lang", l | first -%}
{%- if forloop.first -%}
<div>
<dt>{% include_cached t.html t='Video Subtitles' lang=l hideTranslationHints=true %}</dt>
<dd>
<dl lang="{{l}}">
{%- endif -%}
<div>
<dt>
<a href="{% if t-video-page %}{{ t-video-page.url | relative_url }}"{% else %}{{ video.main-page | relative_url }}" lang="en"{% endif %}>
{% if video.name[l] %}{{ video.name[l]}}{% else %}<span lang="en">{{ video.name.en }}</span>{% endif %}
</a>
</dt>
<dd lang="en">{% if video.name[l] %}English title: <i>{{ video.name.en }}</i>{% endif %}</dd>
</div>
{%- if forloop.last %}
</dl>
</dd>
</div>
{% endif -%}
{% endfor %}
</dl>

{% include excol.html type="end" %}

{% endif %}
{% endfor %}

## Other Languages: Video Subtitles

Subtitles for the [Video Introduction to Web Accessibility and W3C Standards](https://www.w3.org/WAI/videos/standards-and-benefits/) are available in the following languages (in addition to the ones listed above):
* فارسی (Persian) fa
* ગુજરાતી (Gujarati) gu
* हिन्दी, हिंदी (Hindi) hi
* Magyar (Hungarian) hu
* Italiano (Italian) it
* kok कोंकणी (Goan Konkani) kok
* മലയാളം (Malayalam) ml
* मराठी (Marathi) mr
* తెలుగు (Telugu) te

## Other WAI Translations Listings

_The lists below are for specific standards, whereas the lists above include all published WAI translations. The completed translations in the lists below are included under the languages above._
Expand Down
1 change: 1 addition & 0 deletions wai-videos

0 comments on commit d38766c

Please sign in to comment.