1sphinx-i18nThe True Storyrobertlehmann.deDevelopment Processes in Open Source Projects
\documentclass{manual}\usepackage[T1]{fontenc}\usepackage{textcomp}\title{PythonTutorial}\input{boilerplate}\makeindex\begin{document}\maketitle\ifhtml\chapter*{FrontMatter\label{front}}\fi\input{copyright}\begin{abstract}\noindent For a description of standard objects and modules, see the \citetitle[../lib/lib.html]{Python Library Reference} document. The \citetitle[../ref/ref.html]{Python Reference Manual} gives a more formal definition of the language. To write extensions in C or \Cpp, read \citetitle[../ext/ext.html]{Extending and Embedding the Python Interpreter} and \citetitle[../api/api.html]{Python/C API Reference}. There are also several books covering Python in depth. \end{abstract} \tableofcontents \chapter{Whetting Your Appetite \label{intro}} Python enables programs to be written compactly and readably. Programs written in Python are typically much shorter than equivalent C, \Cpp{}, or Java programs, for several reasons:\begin{itemize}\item the high-level data types allow you to express complex operations in a single statement;\item statement grouping is done by indentation;\item no variable or argument declarations are necessary.\end{itemize} On Windows machines, the Python installation is usually placed in \file{C:\e Python24}, though you can change this when you're running the installer: \begin{verbatim} set path=%path%; C:\python24\end{verbatim}\begin{seealso}\seetitle[../lib/typesseq.html]{Sequence Types}%{Strings, and the Unicode strings described in the next section, are examples of \emph{sequence types}, and support the common operations supported by such types.}\end{seealso}\subsection{Unicode Strings \label{unicodeStrings}}\sectionauthor{Marc-Andre Lemburg}{mal@ lemburg.com}\begin{methoddesc}[list]{pop}{\optional{i}}If no index is specified, \code{a.pop()} removes and returns the last item in the list. You will see this notation frequently in the \citetitle[../lib/lib.html]{Python Library Reference}.)\end{methoddesc}Everbodyhates it with a passion.2
GSoCReSTDocutilsgettextSphinxIssue #653to the rescue!3
implemented June 2007as py-rest-docfor Docutilslive August 2007on docs.python.orgreleased March 2008as SphinxBSD licenserequires attribution1.0 in July 20101.0.7 in January 2011latest stable release3290 commits[as of 2011/05/15]4
Docutilstutorial.rst"reST" is **ONE** word,*not two!* tutorial"reST" isONE word,not two!5Check out http://docutils.sf.net/docs/user/rst/quickstart.html for details!
math renderingmarkup domainssearchindicesfeedbacksyntax highlightingtutorial.rst"reST" is **ONE** word,*not two!* tutorial.pdftutorial.htmltutorial.textutorial.1.gztutorial.epubi18n...autodocthemesHierarchical structure: easy definition of a document tree, with automatic links to siblings, parents and childrendoctests6
Georg “birkenfeld” Brandl2004: Pocoo projectthe makers of Werkzeug, Pygments, Jinja, …2008: PSF Community Award2011: Frank Willison Award205k churns [as of 2011/06/27]2500 commitsthat‘s changed LOCswithout bfb5b73af019, e88201ce226b, and 2d7e85e0c7b4, which imported the Python docs7
Daniel NeuhäuserJacob MasonJapanese communityArmin Ronacher…and about 70 others!http://sphinx-users.jp/event/20100724_release_party.htmlhttp://flickr.com/photos/bastispicks/39110440338
Who’s using itAll logos and trademarks are © Copyright their respective owners.9
bitbucket.org/birkenfeld/sphinxGithub for Mercurial10
groups.google.com/groups/sphinx-devsphinx-dev mailing list11
gsoc.robertlehmann.de© 2010 Google Open Source Programs Office 12
13gsoc.robertlehmann.deumbrellaorganisation© 2010 Google Open Source Programs Office
14© 2010 Google Open Source Programs Office, http://socghop.appspot.com/document/show/gsoc_program/google/gsoc2010/timeline
pootle.python.org15Sphinx Native Language Support:Toolchain for Creating, Tracking and Viewing Internationalized Versions of Sphinx Documents
cool story, bro.?but what is thisinternationalizationyou are talking aboutenter  gettext!16
gettext0106  #include <libintl.h>2954 char *lcopy = malloc(len);2955 if (!lcopy)2956dfaerror("out of memory"); 2954 char *lcopy = malloc(len);2955 if (!lcopy)2956dfaerror(_("out of memory")); dfa.c - deterministic extended regexp routines for GNU gettext(3) usually aliased as _ftp://mirrors.kernel.org/gnu/grep/grep-2.5.1.tar.bz217
gettextdfa.c2954 char *lcopy = malloc(len);2955 if (!lcopy)2956dfaerror(_("out of memory")); xgettextgrep.pot#: src/dfa.c:2956msgid "out of memory"msgstr ""18
gettextgrep.po#: src/dfa.c:2956msgid "out of memory"msgstrmsginit"Speicheristalle." ""http://translationproject.org/PO-files/de/grep-2.5.de.po19
gettextgrep.po#: src/dfa.c:2956msgid "out of memory"msgstr "Speicheristalle."msgfmtgrep.mo20
gettext/usr/share/locale/de/LC_MESSAGES/grep.mogrep.moLANG=degrep.c1346#if defined(ENABLE_NLS)1347bindtextdomain("grep", "/usr/share/locale")1348textdomain("grep");1349#endifbindtextdomain(3) – set directory containing message catalogstextdomain(3) – set domain for gettext() calls21
*gasp*Cool. What else?internationalization is hard,let’s go shopping22
gettextinterpolation873 if (not_text)874printf (_("Binary file %s matches\n"),875           filename);grep.c – main driver file for grep#: src/grep.c:874#, c-formatmsgid "Binary file: %s matches\n"msgstr """ÜbereinstimmungeninBinärdatei %s\n"http://translationproject.org/PO-files/de/grep-2.5.de.po23
gettextplural forms219 x = ngettext("There is %s file",220"There are %s files", n)test_gettext.py, CPythonPlural-Forms:nplurals=2; plural=n!=1msgid "There is %s file"msgid_plural "There are %s files"msgstr[0] "Hay %s fichero"msgstr[1] "Hay %s ficheros"24
gettextcomments751/* --option */752printf(_("unrecognized option\n"));lib/getopt.c#. --option#: lib/getopt.c:752msgid "unrecognized option\n"msgstr ""25
awesome!  but… how does it work in Sphinx?enter  sphinx-i18n26
replaces xgettextreplaces libintl.hhttp://sphinx.pocoo.org/latest/intl.html27
d.hatena.ne.jp/rudi/20110202/1296632643Shirou Wakayamaactuallytriedtoi18n the Sphinx28
29messages are scrambled(sorry, my Japanese is horrible)
Ian Lewis @ PyConMini.JPslideshare.net/Ianmlewis/Sphinx-11-I18N30
?you are doing it wronghttp://www.flickr.com/photos/iirraa/141120311/31
32
Pull request@mtlpythonWe’ve just fixed a problem in the gettext builder.Pull request@shibuI'd like to create patch for Internationalization feature for 1.1.Pull request@r_rudiHello, I write the gettext builder patch. Please check and merge if fair enough.Pull request@kouI hereby encourage you to pull some changes in my fork of sphinx.You can find my changes on the i18n-generate-valid-pot branch.messages snipped33
let‘s call it a dayall work hasalready been done!not quite:the dreaded merge34
35releasethe krakenoctomerge of sortsliterally 8 different sources!http://www.flickr.com/photos/kfisto/1926477413
36merged by Georg
37cower, mere mortalshere comes   the merge resolverGeorg Brandlhttp://www.flickr.com/photos/pasukaru76/4293395231/
thanks.  questions?I’m that stargaming guy.#pocoo on Freenodesphinx.pocoo.org38

sphinx-i18n — The True Story