How to write multi-language documentation? What tools can you use? What mistakes should you avoid?
This talk is based on the experiences I gathered while working on several multi-language documentation projects using Sphinx. I will talk about how Sphinx internationalization support works, which tools and services I use and how to organize the translation workflow. Finally I will have a look at what the future of internationalization in Sphinx might bring.
19. Using code inside
the documentation
All text inside the code should be English:
!
class Bookmark(models.Model):
url = models.URLField()
title = models.CharField('title', max_length=255)
description = models.TextField('description', blank=True)
20. How to handle URLs
Always use the inline syntax:
!
Alternatively, you can get the `Python Sources <http://python.org/
download/>`_ from the website and compile it
yourself.
!
Because this way the URL will get lost:
!
Alternatively, you can get the `Python Sources`_ from the website
and compile it yourself.
!
.. _Python Sources: http://python.org/download/
21. How to maintain
versoined URLs
You can use the extlinks extension to define URLs in the configuration:
!
extlinks = {
'djangodocs': ('https://docs.djangoproject.com/en/1.5/%s', None),
'djangopdf': ('http://media.readthedocs.org/pdf/django/1.5.x/django.pdf%s', None)
}
!
You can find a list of all ``QuerySet`` methods in the :djangodocs:`documentation <ref/
models/querysets/#queryset-api>`.
!
Download the :djangopdf:`Django Offline PDF Documentation <>` which has currently more
than 1,200 pages.
22. How to handle
special cases
ifconfig can be used to handle special cases:
!
.. ifconfig:: language == 'de'
!
Nützliche Links für deutschsprachige Django-Nutzer:
!
- `Deutschsprachige Django-Community <http://django-de.org/>`_
23. Link checking
You can check the links for each language separately:
!
$ make SPHINXOPTS="-Dlanguage=de" linkcheck
24. What is still missing?
It’s not possible to build all languages at once
A way to add a „landing page“
A translations setting
Use gettext_compact to create a single catalog
A language switch template
25. Sphinx 1.3
Merge sphinx-intl into Sphinx
Move Transifex support from sphinx-intl to a new extension
Allow to build all languages with a single command