diff --git a/docs/Makefile b/docs/Makefile index 5423c877ecc..e71547af7f3 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -7,6 +7,7 @@ SPHINXOPTS ?= SPHINXBUILD ?= sphinx-build PAPER ?= +POWRAP ?= powrap BUILDDIR ?= _build # User-friendly check for sphinx-build @@ -49,6 +50,7 @@ help: @echo " pseudoxml to make pseudoxml-XML files for display purposes" @echo " linkcheck to check all external links for integrity" @echo " doctest to run all doctests embedded in the documentation (if enabled)" + @echo " wrap to wrap all the PO files to a fixed column width" clean: rm -rf $(BUILDDIR)/* @@ -192,3 +194,7 @@ pseudoxml: $(SPHINXBUILD) --builder pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml @echo @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." + +.PHONY: wrap +wrap: + $(POWRAP) $(shell find locale/ -type f -name '*.po') diff --git a/docs/README.md b/docs/README.md index c8f92cb1c5b..5bf3cf3e4b8 100644 --- a/docs/README.md +++ b/docs/README.md @@ -74,8 +74,16 @@ Translations are based on [Sphinx Internationalization](http://www.sphinx-doc.or 3. Translate `.po` files (manually or with a tool like [Poedit](https://poedit.net/)) -4. Build docs `.po -> .mo` +4. Make sure to wrap files before commit + + ```bash + make wrap + ``` + +5. To build translations locally (`.po -> .mo`). ```bash make -e SPHINXOPTS="-D language='fr'" html ``` + +Note that you should only commit the `.po` files (not `.mo` files).