diff options
| author | Scott Shawcroft <scott@tannewt.org> | 2018-07-31 16:53:54 -0700 |
|---|---|---|
| committer | Scott Shawcroft <scott@tannewt.org> | 2018-08-07 14:58:57 -0700 |
| commit | 933add6cd833bb6ba6682ad2b6eb478871415ff5 (patch) | |
| tree | 8cb5ee1feb0516c24ee270fcee5ed00d310aced8 /Makefile | |
| parent | 2029c4e87e3e71ada07c8be91fe6877edf4a606b (diff) | |
Support internationalisation.
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 19 |
1 files changed, 15 insertions, 4 deletions
@@ -17,10 +17,9 @@ CONFDIR = . FORCE = -E VERBOSE = -v -# User-friendly check for sphinx-build -ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) -$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) -endif +# Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the +# full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the +# executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 @@ -190,3 +189,15 @@ pseudoxml: $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml @echo @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." + +# phony target so we always run +all-source: + +locale/circuitpython.pot: all-source + find . -iname "*.c" | xargs xgettext -L C --keyword=translate -o circuitpython.pot -p locale + +translate: locale/circuitpython.pot + for po in $(shell ls locale/*.po); do msgmerge -U $$po locale/circuitpython.pot; done + +check-translate: locale/circuitpython.pot $(wildcard locale/*.po) + $(PYTHON) tools/check_translations.py $^ |
