From b7f834fcce80a5bc44ffef73b38874c9e963d889 Mon Sep 17 00:00:00 2001 From: yuhan Date: Tue, 12 Aug 2025 09:42:07 +0800 Subject: [PATCH] add locale in tutorials --- tutorials/source_zh_cn/conf.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tutorials/source_zh_cn/conf.py b/tutorials/source_zh_cn/conf.py index 078356edb9..e2ee32c125 100644 --- a/tutorials/source_zh_cn/conf.py +++ b/tutorials/source_zh_cn/conf.py @@ -93,7 +93,16 @@ myst_heading_anchors = 4 # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -# + +# Reconstruction of sphinx auto generated document translation. +import sphinx +import shutil +mo_target = os.path.join(os.path.dirname(sphinx.__file__), 'locale/zh_CN/LC_MESSAGES/sphinx.mo') +if os.path.exists(mo_target): + os.remove(mo_target) +language = 'zh_CN' +locale_dirs = ['../../resource/locale/'] + html_theme = 'sphinx_rtd_theme' #modify layout.html for sphinx_rtd_theme. import sphinx_rtd_theme -- Gitee