diff --git a/_includes/translation-note-msg.html b/_includes/translation-note-msg.html index f0a1389..c2f1b8f 100644 --- a/_includes/translation-note-msg.html +++ b/_includes/translation-note-msg.html @@ -1,47 +1,40 @@ -{%- assign pagelang = 'en' -%} +{%- assign page_lang = 'en' -%} {%- if page.lang -%} - {%- assign pagelang = page.lang -%} + {%- assign page_lang = page.lang -%} {%- endif -%} -{%- unless pagelang == "en" -%} -{%- assign enupdatedate = enpage.last_updated | date: "%s" -%} -{%- assign thisupdatedate = page.last_updated | date: "%s" -%} -{%- if page.changelog -%} - {%- assign chagelogpage=site.documents | where:"ref", page.changelog | first -%} - {%- unless changelogpage.ref -%} - {%- assign changelogpage=site.pages | where:"ref", page.changelog | first -%} - {%- endunless -%} - {%- assign changelogpageurl = changelogpage.url | relative_url -%} - {%- assign changelogpagereplace = "$1|" | append: changelogpageurl -%} -{%- else -%} - {%- assign changelog = "" -%} -{%- endif -%} -
-

{% include t.html t="About this Translation" %}

-

{% assign replacepattern = enpage.url | relative_url | prepend: "$1|" %}{% include t.html t='This volunteer translation might not accurately reflect the intentions of the English original.' replace=replacepattern %}

- {% if pagelang == 'en' %} -

{% include_cached icon.html name="check-circle" %} {% include t.html t='Translation up-to-date with the English version.' %} -
{% include t.html t='Translation updated:' %} {{page.last_updated | date: "%Y-%m-%d"}}. {% include t.html t='English updated:' %} {{enpage.last_updated | date: "%Y-%m-%d"}}. -

-

{% include_cached icon.html name="warning" %} {% include t.html t='English version updated since this translation: Change log.' replace=changelogpagereplace %} -
{% include t.html t='English updated:' %} {{enpage.last_updated | date: "%Y-%m-%d"}}. {% include t.html t='Translation updated:' %} {{page.last_updated | date: "%Y-%m-%d"}}. -

- {% else %} - {% if enupdatedate <= thisupdatedate %} -

{% include_cached icon.html name="check-circle" %} {% include t.html t='Translation up-to-date with the English version.' %} -
{% include t.html t='Translation updated:' %} {{page.last_updated | date: "%Y-%m-%d"}}. {% include t.html t='English updated:' %} {{enpage.last_updated | date: "%Y-%m-%d"}}. -

- {% else %} -

{% include_cached icon.html name="warning" %} {% include t.html t='English version updated since this translation: Change log.' replace=changelogpagereplace %} -
{% include t.html t='English updated:' %} {{enpage.last_updated | date: "%Y-%m-%d"}}. {% include t.html t='Translation updated:' %} {{page.last_updated | date: "%Y-%m-%d"}}. -

- {% endif %} - {% endif %} -

- {%- capture translatorslabel %}{% include t.html t='Translator:' %}{%- endcapture %} - {% include peoplelist.html label=translatorslabel people=page.translators %} - {%- capture contributorslabel %}{% include t.html t='Contributor:' %}{%- endcapture %} - {% include peoplelist.html label=contributorslabel people=page.contributors %} - {%- assign replacepattern = "/about/translating/" | relative_url | prepend: "$1|" -%} -
{% include t.html t='WAI thanks translators, and welcomes other translations.' replace=replacepattern %}

-
+{%- unless page_lang == "en" -%} + {%- if page.custom_changelog -%} + {%- assign changelog_url = page.custom_changelog -%} + {%- elsif page.changelog -%}{%- comment -%}Supports legacy method for now{% endcomment -%} + {%- assign changelog_url = page.changelog -%} + {%- elsif page.ref -%} + {%- capture changelog_url -%}{{ page.ref | append: "changelog/" }}{%- endcapture -%} + {%- else -%} + {%- capture changelog_url -%}{{ page.url | append: "changelog/" }}{%- endcapture -%} + {%- endif -%} + {%- assign all_docs = site.documents | concat: site.pages -%} + {%- assign changelog_page = all_docs | where: "url", changelog_url | first -%} +
+

{% include_cached t.html t="About this translation" lang=page_lang %}

+

+ {%- assign replace_pattern = enpage.url | relative_url | prepend: "$1|" -%} + {%- include t.html t='This volunteer translation might not accurately reflect the intentions of the English original.' replace=replace_pattern lang=page_lang -%} +

+

+ {%- capture translatorslabel %}{% include_cached t.html t='Translator:' lang=page_lang %}{%- endcapture %} + {%- include peoplelist.html label=translatorslabel people=page.translators -%} + {%- capture contributorslabel %}{% include_cached t.html t='Contributor:' lang=page_lang %}{%- endcapture -%} + {%- include peoplelist.html label=contributorslabel people=page.contributors -%} +
+ {%- assign replace_pattern = "/about/translating/" | relative_url | prepend: "$1|" -%} + {%- include_cached t.html t='The Web Accessibility Initiative (WAI) thanks translators, and welcomes other translations.' replace=replace_pattern lang=page_lang -%} +

+ {%- if page.translation.status == "outdated" -%} +
+

{% include_cached icon.html name="warning" %} {% include_cached t.html t='Notice:' lang=page_lang %} {% include t.html t='The English original has been substantially updated since this translation.' lang=page_lang %}{%- if changelog_page %} — {%- include_cached t.html t="Latest changes" lang=page_lang -%}{%- endif -%} +
{% include_cached t.html t='English version updated:' lang=page_lang %} {{ enpage.last_updated | date: "%Y-%m-%d" }} — {% include_cached t.html t='Translation date:' lang=page_lang %} {{ page.translation.last_updated | date: "%Y-%m-%d" }}. +
{% include_cached t.html t='We welcome a translation update.' lang=page_lang replace=replace_pattern %} +

+ {%- endif -%} +
{%- endunless -%} \ No newline at end of file