Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added gettext target to sphinx makefiles.

This have been copied from sphinx-quickstart result in latest sphinx versions.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@17877 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 393aeb79b818dd8fa921b051b1091525bbd52930 1 parent 8dd04fd
Claude Paroz authored April 07, 2012
10  docs/Makefile
@@ -11,8 +11,10 @@ BUILDDIR      = _build
11 11
 PAPEROPT_a4     = -D latex_paper_size=a4
12 12
 PAPEROPT_letter = -D latex_paper_size=letter
13 13
 ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
  14
+# the i18n builder cannot share the environment and doctrees with the others
  15
+I18NSPHINXOPTS  = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
14 16
 
15  
-.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
  17
+.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
16 18
 
17 19
 help:
18 20
 	@echo "Please use \`make <target>' where <target> is one of"
@@ -29,6 +31,7 @@ help:
29 31
 	@echo "  latexpdf   to make LaTeX files and run them through pdflatex"
30 32
 	@echo "  text       to make text files"
31 33
 	@echo "  man        to make manual pages"
  34
+	@echo "  gettext    to make PO message catalogs"
32 35
 	@echo "  changes    to make an overview of all changed/added/deprecated items"
33 36
 	@echo "  linkcheck  to check all external links for integrity"
34 37
 	@echo "  doctest    to run all doctests embedded in the documentation (if enabled)"
@@ -113,6 +116,11 @@ man:
113 116
 	@echo
114 117
 	@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
115 118
 
  119
+gettext:
  120
+	$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
  121
+	@echo
  122
+	@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
  123
+
116 124
 changes:
117 125
 	$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
118 126
 	@echo
10  docs/make.bat
@@ -9,6 +9,7 @@ set BUILDDIR=_build
9 9
 set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
10 10
 if NOT "%PAPER%" == "" (
11 11
 	set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
  12
+	set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
12 13
 )
13 14
 
14 15
 if "%1" == "" goto help
@@ -28,6 +29,7 @@ if "%1" == "help" (
28 29
 	echo.  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter
29 30
 	echo.  text       to make text files
30 31
 	echo.  man        to make manual pages
  32
+	echo.  gettext    to make PO message catalogs
31 33
 	echo.  changes    to make an overview over all changed/added/deprecated items
32 34
 	echo.  linkcheck  to check all external links for integrity
33 35
 	echo.  doctest    to run all doctests embedded in the documentation if enabled
@@ -141,6 +143,14 @@ if "%1" == "man" (
141 143
 	goto end
142 144
 )
143 145
 
  146
+if "%%1" == "gettext" (
  147
+	%SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
  148
+	if errorlevel 1 exit /b 1
  149
+	echo.
  150
+	echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
  151
+	goto end
  152
+)
  153
+
144 154
 if "%1" == "changes" (
145 155
 	%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
146 156
 	if errorlevel 1 exit /b 1

0 notes on commit 393aeb7

Please sign in to comment.
Something went wrong with that request. Please try again.