Skip to content

Commit

Permalink
Add multilanguage configurations for multilanguage support
Browse files Browse the repository at this point in the history
  • Loading branch information
cychitivav committed Aug 14, 2023
1 parent 3358c49 commit c30c451
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ plugins/__pycache__
_build/
.idea/
.vscode/
*.mo
13 changes: 10 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ SOURCE = source
OUT = build
LINKCHECKDIR = $(OUT)/linkcheck
BUILD = python3 -m sphinx
OPTS =-c .
LANG = en
OPTS = -c . -D language=$(LANG)

help:
@$(BUILD) -M help "$(SOURCE)" "$(OUT)" $(OPTS)
@echo " multiversion to build documentation for all branches"

multiversion: Makefile
sphinx-multiversion $(OPTS) "$(SOURCE)" build/html
@echo "<html><head><meta http-equiv=\"refresh\" content=\"0; url=iron/index.html\" /></head></html>" > build/html/index.html
sphinx-multiversion $(OPTS) "$(SOURCE)" build/html/$(LANG)
@echo "<html><head><meta http-equiv=\"refresh\" content=\"0; url=iron/index.html\" /></head></html>" > build/html/$(LANG)/index.html
python3 make_sitemapindex.py

%: Makefile
Expand All @@ -26,4 +27,10 @@ linkcheck:
@echo
@echo "Check finished. Report is in $(LINKCHECKDIR)."

updatepo:
sphinx-intl update -p "$(OUT)/gettext" -d "locale" -l $(LANG)

html:
$(BUILD) -b html $(OPTS) $(SOURCE) $(OUT)/html/$(LANG);

.PHONY: help Makefile multiversion test linkcheck
3 changes: 2 additions & 1 deletion conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'en'
# language = 'en'
locale_dirs = ['../locale/'] # Path from the source directory to the locale directory.

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ sphinx-copybutton==0.4.0
sphinx-multiversion==0.2.4
sphinx-rtd-theme==1.0.0
sphinx-tabs==3.2.0
sphinx-intl

0 comments on commit c30c451

Please sign in to comment.