Files
maigret/docs/Makefile
T
SoxojandGitHub 5bf33eae8a Add a French translation of the README and the docs (#3166)
* Add a French translation of the README and the docs

* Put a documentation link in the README header
2026-09-15 19:58:45 +03:00

42 lines
1.4 KiB
Makefile

# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile gettext intl-update html-zh_CN html-fr
# Translation pipeline
#
# 1. `make gettext` regenerates .pot files from the English .rst sources.
# 2. `make intl-update LANG=zh_CN` syncs the .po files for that language
# against the new .pot files (new strings get empty msgstrs, removed
# strings get commented out, changed strings get a `fuzzy` marker).
# 3. `make html-zh_CN` (or `make html-<code>`) builds a local HTML preview
# in that language.
#
# To bootstrap a new language, run `make intl-update LANG=<code>`.
LANG ?= zh_CN
gettext:
$(SPHINXBUILD) -b gettext $(SPHINXOPTS) "$(SOURCEDIR)" "$(BUILDDIR)/gettext"
intl-update: gettext
sphinx-intl update -p "$(BUILDDIR)/gettext" -l $(LANG) -d "$(SOURCEDIR)/locale"
html-%:
$(SPHINXBUILD) -b html -D language=$* $(SPHINXOPTS) "$(SOURCEDIR)" "$(BUILDDIR)/html_$*"
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)