diff --git a/_includes/t-github-issue.html b/_includes/t-github-issue.html deleted file mode 100644 index 5b44ebf..0000000 --- a/_includes/t-github-issue.html +++ /dev/null @@ -1,45 +0,0 @@ -{%- if include.page.collection -%}{%- assign col = site.collections | where: "label", include.page.collection | first -%}{%- endif- %} - -{%- if site.repository -%} - {%- assign repo = site.repository -%} -{%- endif- %} -{%- if include.page.collection -%} - {%- assign repo = col.repository -%} -{%- endif- %} -{%- if include.page.github.repository -%} - {%- assign repo = include.page.github.repository -%} -{%- endif- %} - -{%- assign branch = "master" -%} -{%- if site.branch -%} - {%- assign branch = site.branch -%} -{%- endif- %} -{%- if include.page.collection -%} - {%- if col.branch -%} - {%- assign branch = col.branch -%} - {%- endif -%} -{%- endif- %} -{%- if include.page.github.branch -%} - {%- assign branch = include.page.github.branch -%} -{%- endif- %} - -{%- assign path = "index.md" -%} -{%- if include.page.collection -%} - {%- assign path = include.page.path -%} -{%- endif- %} -{%- if include.page.github.path -%} - {%- assign path = include.page.github.path -%} -{%- endif- %} - -I would like to {% if include.status == 'new' %} translate into {{ include.tname }} {% elsif include.status == 'update' %} update the {{ include.tname }} translation of {% endif %} the following resource: -- Page URL: {{include.page.url | absolute_url}} -{% if include.status == 'new' %}- Link to original file in GitHub: [https://github.com/{{repo}}/edit/{{branch}}/{{path}}](https://github.com/{{repo}}/edit/{{branch}}/{{path}}){% endif %} -{% if include.status == 'update' %}- Link to file in GitHub: [https://github.com/{{repo}}/edit/{{branch}}/{{path}}](https://github.com/{{repo}}/edit/{{branch}}/{{path}}){% endif %} - -I have read the information on Translating WAI Documents at https://www.w3.org/WAI/about/translating/ - -I will wait for confirmation that the resource is ready for translation. - -{% if include.status == 'new' %}https://github.com/w3c/wai-translations/labels/initial-translation -{% elsif include.status == 'update' %}https://github.com/w3c/wai-translations/labels/translation-update -{% endif %} diff --git a/_includes/t-status.html b/_includes/t-status.html index 2c53a00..6986748 100644 --- a/_includes/t-status.html +++ b/_includes/t-status.html @@ -1,39 +1,42 @@ -{% assign original=alldocs | where_exp:"item", "item.lang == 'en' or item.lang == nil" | where_exp:"item", "item.ref == include.page.url or item.url == include.page.url" | first %} -{% assign t=alldocs | where_exp:"item", "item.lang == page.tlang and item.ref == include.page.url" | first %} -{%- capture page_title -%} - {%- if t != nil -%} - {{ t.title }} ({{ original.title }}) - {%- elsif t == nil and original.permalink != nil -%} - {{ original.title }} - {%- elsif t == nil and original.permalink == nil and include.page.name.en != nil -%} - {{ include.page.name.en }} +{% assign versions=alldocs | where_exp:"item", "item.ref == include.page.url or item.url == include.page.url" %} +{% assign original=versions | where_exp:"item", "item.lang == 'en' or item.lang == nil" | first %} +{% assign translation=versions | where_exp:"item", "item.lang == page.tlang" | first %} + +{%- capture original-title -%} + {%- if original.permalink != nil -%} +

{{ original.title }}

+ {%- elsif original.permalink == nil and include.page.name.en != nil -%} +

{{ include.page.name.en }}

{%- else -%} - {{ include.page.name }} +

{{ include.page.name }}

{%- endif -%} - {%- endcapture -%} -{% capture t-date %}{{t.last_updated | date: '%s' | plus: 0 }}{% endcapture %} -{% capture en-date %}{{original.last_updated | date: '%s' | plus: 0 }}{% endcapture %} -{%- capture t_status -%} - {%- if t == nil -%}none - {%- elsif t.size != 0 and t-date < en-date -%}outdated - {%- elsif t.size != 0 and t-date >= en-date -%}uptodate + +{% capture translation-date %}{{ translation.last_updated | date: '%s' | plus: 0 }}{% endcapture %} +{% capture original-date %}{{ original.last_updated | date: '%s' | plus: 0 }}{% endcapture %} +{%- capture t-status -%} + {%- if translation == nil -%}none + {%- elsif translation.size != 0 and translation-date < original-date -%}outdated + {%- elsif translation.size != 0 and translation-date >= original-date -%}uptodate {%- endif -%} {%- endcapture -%} -{% include box.html type="start" title=page_title h=include.h %} -{%- case t_status -%} - {%- when "none" -%} - {%- capture issue_body_new | newline_to_br -%} - {%- include t-github-issue.html status="new" tname=tlangname page=original -%} - {%- endcapture -%} -

{% include_cached icon.html name="ex-circle" %} No translation available

-

Volunteer to translate this page

- {%- when "outdated" -%} - {%- capture issue_body_update | newline_to_br -%} - {%- include t-github-issue.html status="update" tname=tlangname page=t -%} - {%- endcapture -%} -

{% include_cached icon.html name="warning" %} Translation needs update

-

Volunteer to update the translation

- {%- when "uptodate" -%} -

{% include_cached icon.html name="check-circle" %} Up-to-date

-{%- endcase -%} + + + {{ original-title }} + + {%- case t-status -%} + {%- when "none" -%} +

{% include_cached icon.html name="ex-circle" %} No translation

+ {%- capture github-file-path -%}{% include_cached github-file-path.html p=original %}{%- endcapture -%} +

Volunteer to translate this page

+ {%- when "outdated" -%} +

{% include_cached icon.html name="warning" %} Translation needs update

+

{{ translation.title }}

+ {%- capture github-file-path -%}{% include_cached github-file-path.html p=translation %}{%- endcapture -%} +

Volunteer to update the translation

+ {%- when "uptodate" -%} +

{% include_cached icon.html name="check-circle" %} Up-to-date

+

{{ translation.title }}

+ {%- endcase -%} + + diff --git a/_layouts/translation-sitemap.html b/_layouts/translation-sitemap.html new file mode 100755 index 0000000..92443e1 --- /dev/null +++ b/_layouts/translation-sitemap.html @@ -0,0 +1,241 @@ +{%- assign pagelang = 'en' -%} +{%- if page.lang -%} + {%- assign pagelang = page.lang -%} +{%- endif -%} +{%- if pagelang == 'en' -%} + {%- assign enpage = page -%} +{%- else -%} + {%- assign enpage=site.documents | where:"ref", page.ref | where: "lang", "en" | first -%} + {%- unless enpage.ref -%} + {%- assign enpage=site.pages | where:"ref", page.ref | where: "lang", "en" | first -%} + {%- endunless -%} +{%- endif -%} +{%- assign englishpageurl = enpage.url %} +{%- assign translations=site.documents | where:"ref", page.ref | where_exp:"item", "item.lang != 'en'" | sort: 'lang' -%} +{%- unless translations[0].ref -%} + {% assign translations=site.pages | where:"ref", page.ref | where_exp:"item", "item.lang != 'en'" | sort: 'lang' %} +{%- endunless -%} + + + {%- assign timestamp = site.time | date: '%s%N' -%} + {%- assign timestamp = '?' | append: timestamp -%} + {%- include_cached head.html type="start" timestamp=timestamp -%} + {%- if site.data.lang[pagelang].rtl -%} + W3C | {{ site.title | escape }} | {{ page.title | escape }} {%if page.doc-note-type == "archived" %}[{% include t.html t="Archived" %}]{% endif%}{%if page.doc-note-type == "draft" %}[{% include t.html t="Draft" %}]{% endif%} + {%- else -%} + {%if page.doc-note-type == "archived" %}[{% include t.html t="Archived" %}]{% endif%}{%if page.doc-note-type == "draft" %}[{% include t.html t="Draft" %}]{% endif%} {{ page.title | escape }} | {{ site.title | escape }} | W3C + {%- endif -%} + {%- if page.external_css %}{% endif -%} + {%- if page.ext_css %}{% endif -%} + {%- if page.inline_css %}{% endif -%} + {%- capture seo -%} + {%- seo title=false -%} + {%- endcapture -%} + {{- seo | replace: '', '' -}} + {%- unless page.image -%}{%- if site.twitter.image -%}{% assign twimage = site.twitter.image -%}{%- else -%}{% assign twimage = '/assets/images/social-sharing-default.jpg' -%}{%- endif -%} + + {%- endunless -%} + {% include_cached head.html type="end" %} + + {% include header.html translations=translations %} +
+ + {% if page.sidebaricon %} +
+ {% include_cached icon.html name=page.sidebaricon class="sidebaricon" %} +
+ {% else %} + {% unless page.sidebar == false %} + {% include secondarynav.html parent=page.parent %} + {% endunless %} + {% endif %} + +
+ + {% comment %} + + Header will be displayed in three ways, depending on which frontmatter was provided: + + - with 'in [Resource]' under the h1 (if page.resource.ref is provided) + - with 'in [Resource X], [Resource Y]' inside the h1 (if page.parent_in_h1 is provided) + - just the title (if neither are provided) + + {% endcomment %} + + {% if page.resource.ref %} +
+

+ {% if page.title_icon %} + + {% endif %} + {% if page.title_image %} + + {% endif %} + {% if page.title_html %} + {{ page.title_html }} + {% else %} + {{ page.title | xml_escape }} + {% endif %}

+ {%- if page.resource.ref -%}{%- unless page.ref == page.resource.ref -%} +

{% include t.html t="in" %} {% include link.html to=page.resource.ref %}

+ {%- endunless -%}{%- endif -%} +
+ {% elsif page.parent_in_h1 %} +
+

{% if page.title_icon %} + {% endif %} + {% if page.title_image %} + + {% endif %} + {% if page.title_html %} + {{ page.title_html }} + {% else %} + {{ page.title | xml_escape }} + {% endif %} + + {% include t.html t="in" %}{{ ' ' }} + {%- for link in page.parent_in_h1 -%} + {%- unless forloop.first == true -%},{{ ' ' }}{%- endunless -%} + {%- if link.ref -%}{%- unless page.ref == link.ref -%} + {%- if link.name == "title" -%} + {% include link.html to=link.ref %} + {%- elsif link.name == "nav_title" -%} + {% include link.html to=link.ref usenavtitle="true" %} + {%- elsif link.name == "title_html" -%} + {% include link.html to=link.ref usetitlehtml="true" %} + {%- else -%} + {% include link.html to=link.ref text=link.name %} + {%- endif -%} + {%- endunless -%}{%- endif -%} + {%- endfor -%} + +

+
+ {% else %} +
+

+ {% if page.title_html %} + {{ page.title_html }} + {% else %} + {{ page.title | xml_escape }} + {% endif %} +

+ {%- if page.resource.ref -%}{%- unless page.ref == page.resource.ref -%} +

{% include t.html t="in" %} {% include link.html to=page.resource.ref %}

+ {%- endunless -%}{%- endif -%} + {%- if page.collection == "posts" -%} +
+

Date: {{ page.date | date: "%d %B %Y" }}

+
+ {%- endif -%} +
+ {% endif %} + + {%- include doc-note-msg.html -%} + + + {% assign tlangname=site.data.lang[page.tlang].name %} + {% assign alldocs=site.documents | concat: site.pages %} + + {% include box.html type="start" h="2" title="Summary" class="full" %} + +

This page lists the status of {{ tlangname }} translations, for WAI resources for which we welcome translations.

+ +

Learn how to use this translation sitemap in Translations Sitemaps page.

+ + {% include box.html type="end" %} + + {% include_cached excol.html type="all" %} + + {% include_cached excol.html type="start" %} + +

Priorities Status

+ + {% include excol.html type="middle" %} + + {% if site.data.translations-priorities %} + + + + + + + + + {%- for prio in site.data.translations-priorities -%} + {%- include t-status.html page=prio -%} + {%- for priosub in prio.pages -%} + {%- include t-status.html page=priosub -%} + {%- endfor -%} + {%- endfor -%} + +
WAI ResourceTranslation Status
+ {% endif %} + + {% include_cached excol.html type="end" %} + +

Sitemap

+ + {% assign sections=site.data.navigation | where_exp:"item", "item.mainnav != false and item.hide != true and item.translate == true" -%} + {%- for section in sections -%} + {% include excol.html type="start" %} +

+ {%- if section.name.en -%} + {{ section.name.en }} + {%- else -%} + {{ section.name }} + {%- endif -%} +

+ {% include excol.html type="middle" %} + + + + + + + + + {%- assign pages=section.pages | where_exp:"item", "item.mainnav != false and item.hide != true" -%} + {%- for p in pages -%} + {% if p.translate == true %} + {%- include t-status.html page=p -%} + {% endif %} + {%- assign subpages=p.pages | where_exp:"item", "item.mainnav != false and item.hide != true" -%} + {%- for subpage in subpages -%} + {% if subpage.translate == true %} + {%- include t-status.html page=subpage -%} + {% endif %} + {%- assign subsubpages=subpage.pages | where_exp:"item", "item.mainnav != false and item.hide != true" -%} + {%- for subsubpage in subsubpages -%} + {% if subsubpage.translate == true %} + {%- include t-status.html page=subsubpage -%} + {% endif %} + {%- endfor -%} + {%- endfor -%} + {%- endfor -%} + +
WAI ResourceTranslation Status
+ {% include excol.html type="end" %} + {% endfor %} + + + {%- if page.navigation -%} + {%- include prevnext-navigation.html -%} + {%- else -%} + {%- if page.order -%} + {%- include prevnext-order.html -%} + {%- endif -%} + {%- endif -%} + + {% include feedback-box.html %} + + {% include_cached backtotop.html lang=page.lang %} +
+
+ +{% include footer.html lang=pagelang %} + + +