Skip to content

Commit

Permalink
Add makefile target to wrap po files
Browse files Browse the repository at this point in the history
  • Loading branch information
mmmarcos committed Nov 7, 2024
1 parent b3975c5 commit 10d6c06
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
6 changes: 6 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
PAPER ?=
POWRAP ?= powrap
BUILDDIR ?= _build

# User-friendly check for sphinx-build
Expand Down Expand Up @@ -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)/*
Expand Down Expand Up @@ -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')
10 changes: 9 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

0 comments on commit 10d6c06

Please sign in to comment.