Skip to content

Commit

Permalink
feat: test theme template translations
Browse files Browse the repository at this point in the history
  • Loading branch information
tillywoodfield committed Jan 21, 2025
1 parent 783c41b commit 817fa3b
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 2 deletions.
16 changes: 14 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

import os.path
from sphinx.locale import get_translation
import sphinx.application

MESSAGE_CATALOG_NAME = "iati-sphinx-theme"
_ = get_translation(MESSAGE_CATALOG_NAME)

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

Expand Down Expand Up @@ -34,12 +41,17 @@
"es": "Español",
},
# Uncomment below lines to display tool navigation
# "tool_name": "IATI Example Tool",
# "tool_url": "https://example.com/",
"tool_name": _("IATI Example Tool"),
"tool_url": "https://example.com/",
}

todo_include_todos = True

# -- Options for Texinfo output -------------------------------------------

locale_dirs = ["locale/", "../iati_sphinx_theme/locale"]


def setup(app: sphinx.application.Sphinx) -> None:
locale_dir = os.path.join(os.path.abspath(os.path.dirname(__file__)), "locale")
app.add_message_catalog(MESSAGE_CATALOG_NAME, locale_dir)
24 changes: 24 additions & 0 deletions docs/locale/es/LC_MESSAGES/iati-sphinx-theme.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Spanish translations for PROJECT.
# Copyright (C) 2025 ORGANIZATION
# This file is distributed under the same license as the PROJECT project.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2025.
#
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2025-01-21 16:42+0200\n"
"PO-Revision-Date: 2025-01-21 16:42+0200\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: es\n"
"Language-Team: es <[email protected]>\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.14.0\n"

#: conf.py:44
msgid "IATI Example Tool"
msgstr "IATI Example Tool Spanish"

23 changes: 23 additions & 0 deletions docs/locale/iati-sphinx-theme.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Translations template for PROJECT.
# Copyright (C) 2025 ORGANIZATION
# This file is distributed under the same license as the PROJECT project.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2025.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2025-01-21 16:42+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.14.0\n"

#: conf.py:44
msgid "IATI Example Tool"
msgstr ""

0 comments on commit 817fa3b

Please sign in to comment.