[ADD] Modify build scripts to enable translations

New command make i18nhtml to add parameter LANG=...

e.g. make LANG=fr i18nhtml
This commit is contained in:
Martin Trigaux 2015-11-03 11:32:49 +01:00
parent 4ab658a5ba
commit c0098583eb
2 changed files with 13 additions and 2 deletions

View File

@ -17,6 +17,7 @@ endif
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
ALLI18NSPHINXOPTS = -d $(BUILDDIR)/doctrees/$(LANG) $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) -D language=$(LANG) .
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
@ -29,6 +30,7 @@ _extensions/odoo/static/style.css: $(lessfiles)
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " i18nhtml to make standalone translated HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@ -59,6 +61,11 @@ html: _extensions/odoo/static/style.css
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
i18nhtml: _extensions/odoo/static/style.css
$(SPHINXBUILD) -b html $(ALLI18NSPHINXOPTS) $(BUILDDIR)/html/$(LANG)
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html/$(LANG)."
dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@ -151,9 +158,9 @@ info:
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
gettext:
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) locale/sources
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
@echo "Build finished. The message catalogs are in locale/sources."
changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes

View File

@ -267,6 +267,10 @@ texinfo_documents = [
github_user = 'odoo'
github_project = 'documentation-user'
# Where are stored the localisations files
locale_dirs = ['locale/']
def setup(app):
app.add_stylesheet('accounting.css')
app.add_javascript('prefixfree.min.js')