diff --git a/_includes/t-github-issue.html b/_includes/t-github-issue.html new file mode 100644 index 0000000..b92b604 --- /dev/null +++ b/_includes/t-github-issue.html @@ -0,0 +1,11 @@ +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 {{original.github.repository}} %}- Github Repository: [{{original.github.repository}}](https://github.com/{{original.github.repository}}){% 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 new file mode 100644 index 0000000..0aae533 --- /dev/null +++ b/_includes/t-status.html @@ -0,0 +1,39 @@ +{% 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=site.alldocs | where_exp:"item", "item.lang == tlangname 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 }} + {%- else -%} + {{ 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 + {%- 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=include.page -%} + {%- 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=include.page -%} + {%- 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 -%}