From 2e947367bc210bf7cf4bd58f2ca6d975aee03381 Mon Sep 17 00:00:00 2001 From: Dmitriy Chubinidze Date: Fri, 28 Mar 2025 16:10:52 +0000 Subject: [PATCH] docs: Define locale directory Define locale directory to enable doc translations on other languages. F.e. https://docs.openstack.org/horizon/latest/ru/user/index.html returns 404 error, although translation for that page was imported. Change-Id: I282eb05ea387f0ff498da5dfe9d9650a29f3f0f9 --- bindep.txt | 2 ++ doc/requirements.txt | 3 ++- doc/source/conf.py | 4 +++- tox.ini | 3 +++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/bindep.txt b/bindep.txt index 0c3f3dba13..b7a13ae173 100644 --- a/bindep.txt +++ b/bindep.txt @@ -5,3 +5,5 @@ firefox-esr [selenium platform:debian] xvfb [selenium platform:dpkg] # already part of xorg-x11-server on openSUSE xorg-x11-server-Xvfb [selenium platform:redhat] +# Required to build language docs +gettext diff --git a/doc/requirements.txt b/doc/requirements.txt index faa25cc8b3..7736ef89a0 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,6 +1,7 @@ -openstackdocstheme>=2.2.0 # Apache-2.0 +openstackdocstheme>=2.2.1 # Apache-2.0 reno>=3.1.0 # Apache-2.0 sphinx>=2.0.0 # BSD +sphinxcontrib-svg2pdfconverter>=0.1.0 # BSD doc8>=0.8.1 # Apache-2.0 # The below is rewquired to build testing module reference diff --git a/doc/source/conf.py b/doc/source/conf.py index 191b01ef27..2905edfd7c 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -110,7 +110,7 @@ copyright = '2012, OpenStack Foundation' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. -# language = None +language = 'en' # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: @@ -342,3 +342,5 @@ epub_copyright = '2012, OpenStack' # Allow duplicate toc entries. # epub_tocdup = True + +locale_dirs = ['locale/'] diff --git a/tox.ini b/tox.ini index 38cc1e205e..049dec5616 100644 --- a/tox.ini +++ b/tox.ini @@ -153,6 +153,9 @@ deps = commands = sphinx-build -j auto -W -b html doc/source doc/build/html doc8 doc/source + docstheme-build-translated.sh +setenv = + SPHINX_WARNINGS_TRANS=1 [testenv:venv-docs] deps = {[testenv:docs]deps}