Ticket #18108: docs_translation.diff

File docs_translation.diff, 4.2 KB (added by Claude Paroz, 13 years ago)

Draft of build instructions

  • docs/Makefile

    diff --git a/docs/Makefile b/docs/Makefile
    index bdf4854..4a8bc75 100644
    a b SPHINXOPTS =  
    66SPHINXBUILD   = sphinx-build
    77PAPER         =
    88BUILDDIR      = _build
     9LANGUAGE      =
     10TRANSDIR      = translations
    911
    1012# Internal variables.
    1113PAPEROPT_a4     = -D latex_paper_size=a4
    1214PAPEROPT_letter = -D latex_paper_size=letter
    13 ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
     15ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees -D language=$(LANGUAGE) $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
    1416# the i18n builder cannot share the environment and doctrees with the others
    1517I18NSPHINXOPTS  = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
     18POFILES         = $(wildcard $(TRANSDIR)/*/LC_MESSAGES/*.po)
     19MOFILES         = $(POFILES:.po=.mo)
    1620
    17 .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
     21.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext translations
    1822
    1923help:
    2024        @echo "Please use \`make <target>' where <target> is one of"
    help:  
    3236        @echo "  text       to make text files"
    3337        @echo "  man        to make manual pages"
    3438        @echo "  gettext    to make PO message catalogs"
     39        @echo "  translations to compile PO files into MO files"
    3540        @echo "  changes    to make an overview of all changed/added/deprecated items"
    3641        @echo "  linkcheck  to check all external links for integrity"
    3742        @echo "  doctest    to run all doctests embedded in the documentation (if enabled)"
    3843
    3944clean:
    4045        -rm -rf $(BUILDDIR)/*
     46        -rm $(TRANSDIR)/*/*.mo
    4147
    4248html:
    4349        $(SPHINXBUILD) -b djangohtml $(ALLSPHINXOPTS) $(BUILDDIR)/html
    gettext:  
    121127        @echo
    122128        @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
    123129
     130translations: $(MOFILES)
     131        @echo "Translations compiled into .mo files."
     132
     133%.mo: %.po
     134        @msgfmt -o $@ $<
     135
    124136changes:
    125137        $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
    126138        @echo
  • docs/README

    diff --git a/docs/README b/docs/README
    index b02499d..210d964 100644
    a b To create an HTML version of the docs:  
    1414
    1515The documentation in _build/html/index.html can then be viewed in a web browser.
    1616
     17Building translated versions
     18----------------------------
     19
     20To build translated versions of the Django documentation, use the following
     21make commands and specify your language code in the LANGUAGE variable. For
     22example:
     23
     24    $ make translations
     25    $ make html LANGUAGE=fr
     26
     27This uses available translations in docs/translations. Those .po files are
     28obtained through the Transifex django-docs project [3].
     29This is currently only supported on Unix-based platforms.
     30
    1731[1] http://docutils.sourceforge.net/rst.html
    1832[2] http://sphinx.pocoo.org/
     33[3] https://www.transifex.net/projects/p/django-docs/
  • docs/conf.py

    diff --git a/docs/conf.py b/docs/conf.py
    index 2597916..7972225 100644
    a b django_next_version = '1.6'  
    6060# for a list of supported languages.
    6161#language = None
    6262
     63locale_dirs = ['translations']
     64
    6365# There are two options for replacing |today|: either, you set today to some
    6466# non-false value, then it is used:
    6567#today = ''
  • docs/internals/contributing/localizing.txt

    diff --git a/docs/internals/contributing/localizing.txt b/docs/internals/contributing/localizing.txt
    index ff957c4..61acd40 100644
    a b Django source tree, as for any code change:  
    6060* Open a ticket in Django's ticket system, set its ``Component`` field to
    6161  ``Translations``, and attach the patch to it.
    6262
     63Documentation
     64-------------
     65
     66The Django documentation can also be translated on Transifex `Django-docs
     67project page`_.
     68
     69To learn how to build a translated version of the Django documentation in your
     70language, see the README file in the docs directory of the Django source tree.
     71
    6372.. _Transifex: https://www.transifex.net/
    6473.. _Django i18n mailing list: http://groups.google.com/group/django-i18n/
    6574.. _Django project page: https://www.transifex.net/projects/p/django/
     75.. _Django-docs project page: https://www.transifex.net/projects/p/django-docs/
    6676.. _Transifex User Guide: http://help.transifex.net/
Back to Top