From 8481367caefacfdbe57802d41dcd507ae797620e Mon Sep 17 00:00:00 2001 From: Sarunas Date: Tue, 27 Aug 2024 10:43:11 +0300 Subject: [PATCH] adjust custom_admonitions.py --- extensions/custom_admonitions/__init__.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/extensions/custom_admonitions/__init__.py b/extensions/custom_admonitions/__init__.py index 81cc404363..518dcf6654 100644 --- a/extensions/custom_admonitions/__init__.py +++ b/extensions/custom_admonitions/__init__.py @@ -2,7 +2,7 @@ from docutils import nodes from docutils.parsers.rst.directives import admonitions -from sphinx.locale import admonitionlabels +from sphinx.locale import admonitionlabels, _ from sphinx.util.docutils import SphinxRole @@ -65,11 +65,11 @@ def setup(app): app.add_role('dfn', Dfn(), override=True) app.add_node(DfnSpan, html=(DfnSpan.visit, DfnSpan.depart)) + # Add translations for the admonition labels + admonitionlabels['example'] = _('Example') + admonitionlabels['exercise'] = _('Exercise') + return { 'parallel_read_safe': True, 'parallel_write_safe': True - } - - -admonitionlabels['example'] = 'Example' -admonitionlabels['exercise'] = 'Exercise' + } \ No newline at end of file