Skip to content

Commit

Permalink
feat: make copyright year dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
tillywoodfield committed Nov 19, 2024
1 parent a08f6bb commit 471774c
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 12 deletions.
2 changes: 2 additions & 0 deletions iati_sphinx_theme/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""A sphinx theme for IATI documentation sites."""

from datetime import datetime
from os import path

import sphinx.application
Expand All @@ -10,6 +11,7 @@ def setup(app: sphinx.application.Sphinx) -> None:
app.config["html_permalinks_icon"] = "#"
app.config["html_favicon"] = "static/favicon-16x16.png"
app.config["html_context"]["language"] = app.config["language"]
app.config["html_context"]["current_year"] = datetime.now().year
app.add_js_file("language-switcher.js")
locale_path = path.join(path.abspath(path.dirname(__file__)), "locale")
app.add_message_catalog("sphinx", locale_path)
2 changes: 1 addition & 1 deletion iati_sphinx_theme/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ <h2 class="iati-footer-block__title">{{ _("Additional Information") }}</h2>
<li><a href="https://iatistandard.org/en/privacy-policy/">{{ _("Privacy Policy") }}</a></li>
<li>
<span>
{{ _("© Copyright 2024 United Nations Development Programme, on behalf of the IATI Secretariat") }}
&copy; {% trans %}Copyright {{ current_year }} United Nations Development Programme, on behalf of the IATI Secretariat{% endtrans %}
</span>
</li>
</ul>
Expand Down
9 changes: 5 additions & 4 deletions iati_sphinx_theme/locale/es/LC_MESSAGES/sphinx.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2024-11-12 16:24+0200\n"
"PO-Revision-Date: 2024-11-12 16:24+0200\n"
"POT-Creation-Date: 2024-11-19 10:48+0200\n"
"PO-Revision-Date: 2024-11-19 10:49+0200\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: es\n"
"Language-Team: es <LL@li.org>\n"
Expand Down Expand Up @@ -42,9 +42,10 @@ msgid "Privacy Policy"
msgstr ""

#: iati_sphinx_theme/footer.html:26
#, python-format
msgid ""
"© Copyright 2024 United Nations Development Programme, on behalf of the "
"IATI Secretariat"
"Copyright %(current_year)s United Nations Development Programme, on "
"behalf of the IATI Secretariat"
msgstr ""

#: iati_sphinx_theme/header.html:2
Expand Down
9 changes: 5 additions & 4 deletions iati_sphinx_theme/locale/fr/LC_MESSAGES/sphinx.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2024-11-12 16:24+0200\n"
"PO-Revision-Date: 2024-11-12 16:24+0200\n"
"POT-Creation-Date: 2024-11-19 10:48+0200\n"
"PO-Revision-Date: 2024-11-19 10:49+0200\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: fr\n"
"Language-Team: fr <LL@li.org>\n"
Expand Down Expand Up @@ -42,9 +42,10 @@ msgid "Privacy Policy"
msgstr ""

#: iati_sphinx_theme/footer.html:26
#, python-format
msgid ""
"© Copyright 2024 United Nations Development Programme, on behalf of the "
"IATI Secretariat"
"Copyright %(current_year)s United Nations Development Programme, on "
"behalf of the IATI Secretariat"
msgstr ""

#: iati_sphinx_theme/header.html:2
Expand Down
7 changes: 4 additions & 3 deletions iati_sphinx_theme/locale/sphinx.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2024-11-12 16:24+0200\n"
"POT-Creation-Date: 2024-11-19 10:48+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down Expand Up @@ -41,9 +41,10 @@ msgid "Privacy Policy"
msgstr ""

#: iati_sphinx_theme/footer.html:26
#, python-format
msgid ""
"© Copyright 2024 United Nations Development Programme, on behalf of the "
"IATI Secretariat"
"Copyright %(current_year)s United Nations Development Programme, on "
"behalf of the IATI Secretariat"
msgstr ""

#: iati_sphinx_theme/header.html:2
Expand Down

0 comments on commit 471774c

Please sign in to comment.