diff --git a/docs/conf.py b/docs/conf.py index 498025d..65dbebd 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -9,6 +9,7 @@ project = "IATI Sphinx Theme" copyright = "2024 IATI Secretariat" author = "IATI Secretariat" +language = "en" # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration @@ -26,6 +27,11 @@ # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output html_theme = "iati_sphinx_theme" -html_theme_options = {"github_repository": "https://github.com/IATI/sphinx-theme"} +html_theme_options = { + "github_repository": "https://github.com/IATI/sphinx-theme", + "languages": { + "en": "English", + }, +} todo_include_todos = True diff --git a/iati_sphinx_theme/__init__.py b/iati_sphinx_theme/__init__.py index 516e47c..ea3ea5b 100644 --- a/iati_sphinx_theme/__init__.py +++ b/iati_sphinx_theme/__init__.py @@ -9,4 +9,6 @@ def setup(app: sphinx.application.Sphinx) -> None: app.add_html_theme("iati_sphinx_theme", path.abspath(path.dirname(__file__))) app.config["html_permalinks_icon"] = "#" app.config["html_favicon"] = "static/favicon-16x16.png" + app.config["html_context"]["language"] = app.config["language"] app.add_js_file("header.js") + app.add_js_file("language-switcher.js") diff --git a/iati_sphinx_theme/footer.html b/iati_sphinx_theme/footer.html index f38305c..b30f300 100644 --- a/iati_sphinx_theme/footer.html +++ b/iati_sphinx_theme/footer.html @@ -28,12 +28,9 @@ -
- - -
+ + {%- include "language-switcher.html" %} +