templates: Add support for article state notice translations.

Add initial German translations for draft and obsolete notices.
This commit is contained in:
Bradley Sepos 2018-08-14 21:03:52 -04:00
parent 94e17bfaa8
commit 17f284d522
No known key found for this signature in database
GPG Key ID: DEADE2F57D42D9C7
2 changed files with 19 additions and 4 deletions

View File

@ -278,6 +278,15 @@ article.docs span.notice { /* inline notice */
vertical-align: middle;
}
article.docs .notice p {
display: none;
}
article.docs[lang="de"] .notice p[lang="de"],
article.docs[lang="en"] .notice p[lang="en"] { /* notice matching article language */
display: block;
}
article.docs li a + span.notice { /* table of contents notice */
display: inline-block;
transform: scaleX(0);
@ -295,13 +304,13 @@ article.docs .notice.draft {
background-color: lightyellow;
}
article.docs .notice > :first-child:before {
article.docs .notice > *:before {
display: inline;
margin-right: .5em;
content: "♻";
}
article.docs .notice.draft > :first-child:before {
article.docs .notice.draft > *:before {
content: "⚠";
}

View File

@ -1,6 +1,12 @@
{% if document.state contains "obsolete" %}
<div class="notice obsolete" lang="en"><p>This article is for an older version of {{ document.project }}. <a href="{{ base.relpath }}{{ document.language-code | slug }}/">See all versions</a>.</p></div>
<div class="notice obsolete">
<p lang="en">This article is for an older version of {{ document.project }}. <a href="{{ base.relpath }}{{ document.language-code | slug }}/">All versions</a>.</p>
<p lang="de">Dieser Artikel ist für eine ältere Version von {{ document.project }}. <a href="{{ base.relpath }}{{ document.language-code | slug }}/">Alle Versionen</a>.</p>
</div>
{% endif %}
{% if document.state contains "draft" %}
<div class="notice draft" lang="en"><p>This article is a draft and may contain incomplete or incorrect information.</p></div>
<div class="notice draft">
<p lang="en">This article is a draft and may contain incomplete or incorrect information.</p>
<p lang="de">Dieser Artikel ist ein Entwurf und enthält möglicherweise unvollständige oder falsche Information.</p>
</div>
{% endif %}