SlideShare ist ein Scribd-Unternehmen logo
1 von 38
1 sphinx-i18n The True Story robertlehmann.de Development Processes in Open Source Projects
ocumentclass{manual}sepackage[T1]{fontenc}sepackage{textcomp}itle{PythonTutorial}nput{boilerplate}akeindexegin{document}aketitlefhtmlhapter*{FrontMatterabel{front}}input{copyright}egin{abstract}oindent For a description of standard objects and modules, see the itetitle[../lib/lib.html]{Python Library Reference} document. The itetitle[../ref/ref.html]{Python Reference Manual} gives a more formal definition of the language. To write extensions in C or pp, read itetitle[../ext/ext.html]{Extending and Embedding the Python Interpreter} and itetitle[../api/api.html]{Python/C API Reference}. There are also several books covering Python in depth. nd{abstract} ableofcontents hapter{Whetting Your Appetite abel{intro}} Python enables programs to be written compactly and readably. Programs written in Python are typically much shorter than equivalent C, pp{}, or Java programs, for several reasons:egin{itemize}tem the high-level data types allow you to express complex operations in a single statement;tem statement grouping is done by indentation;tem no variable or argument declarations are necessary.nd{itemize} On Windows machines, the Python installation is usually placed in ile{C: Python24}, though you can change this when you're running the installer: egin{verbatim} set path=%path%; C:ython24nd{verbatim}egin{seealso}eetitle[../lib/typesseq.html]{Sequence Types}%{Strings, and the Unicode strings described in the next section, are examples of mph{sequence types}, and support the common operations supported by such types.}nd{seealso}ubsection{Unicode Strings abel{unicodeStrings}}ectionauthor{Marc-Andre Lemburg}{mal@ lemburg.com}egin{methoddesc}[list]{pop}{ptional{i}}If no index is specified, ode{a.pop()} removes and returns the last item in the list. You will see this notation frequently in the itetitle[../lib/lib.html]{Python Library Reference}.)nd{methoddesc} Everbodyhates it with a passion. 2
GSoC ReST Docutils gettext Sphinx Issue #653 to the rescue! 3
implemented June 2007 as py-rest-docfor Docutils live August 2007 on docs.python.org released March 2008 as Sphinx BSD license requires attribution 1.0 in July 2010 1.0.7 in January 2011 latest stable release 3290 commits[as of 2011/05/15] 4
Docutils tutorial.rst "reST" is **ONE** word, *not two!*  tutorial "reST" isONE word, not two! 5 Check out http://docutils.sf.net/docs/user/rst/quickstart.html for details!
math rendering markup domains search indices feedback syntax highlighting tutorial.rst "reST" is **ONE** word, *not two!*  tutorial.pdf tutorial.html tutorial.tex tutorial.1.gz tutorial.epub i18n ... autodoc themes Hierarchical structure: easy definition of a document tree, with automatic links to siblings, parents and children doctests 6
Georg “birkenfeld” Brandl 2004: Pocoo project the makers of Werkzeug, Pygments, Jinja, … 2008: PSF Community Award 2011: Frank Willison Award 205k churns [as of 2011/06/27] 2500 commits that‘s changed LOCs without bfb5b73af019, e88201ce226b, and 2d7e85e0c7b4, which imported the Python docs 7
Daniel Neuhäuser Jacob Mason Japanese community Armin Ronacher …and about 70 others! http://sphinx-users.jp/event/20100724_release_party.html http://flickr.com/photos/bastispicks/3911044033 8
Who’s using it All logos and trademarks are © Copyright their respective owners. 9
bitbucket.org/birkenfeld/sphinx Github for Mercurial 10
groups.google.com/groups/sphinx-dev sphinx-dev mailing list 11
gsoc.robertlehmann.de © 2010 Google Open Source Programs Office  12
13 gsoc.robertlehmann.de umbrellaorganisation © 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.org 15 Sphinx Native Language Support: Toolchain for Creating, Tracking and Viewing Internationalized Versions of Sphinx Documents
cool story, bro. ? but what is this internationalization you are talking about enter  gettext! 16
gettext 0106  #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.bz2 17
gettext dfa.c 2954 char *lcopy = malloc(len); 2955 if (!lcopy) 2956dfaerror(_("out of memory"));  xgettext grep.pot #: src/dfa.c:2956 msgid "out of memory" msgstr "" 18
gettext grep.po #: src/dfa.c:2956 msgid "out of memory" msgstr msginit "Speicheristalle."  "" http://translationproject.org/PO-files/de/grep-2.5.de.po 19
gettext grep.po #: src/dfa.c:2956 msgid "out of memory" msgstr "Speicheristalle." msgfmt grep.mo 20
gettext /usr/share/locale/de/LC_MESSAGES/grep.mo grep.mo LANG=de grep.c 1346#if defined(ENABLE_NLS) 1347bindtextdomain("grep", "/usr/share/locale") 1348textdomain("grep"); 1349#endif bindtextdomain(3) – set directory containing message catalogs textdomain(3) – set domain for gettext() calls 21
*gasp* Cool. What else? internationalization is hard,let’s go shopping 22
gettext interpolation 873 if (not_text) 874printf (_("Binary file %s matches"), 875           filename); grep.c – main driver file for grep #: src/grep.c:874 #, c-format msgid "Binary file: %s matches" msgstr "" "ÜbereinstimmungeninBinärdatei %s" http://translationproject.org/PO-files/de/grep-2.5.de.po 23
gettext plural forms 219 x = ngettext("There is %s file", 220"There are %s files", n) test_gettext.py, CPython Plural-Forms:nplurals=2; plural=n!=1 msgid "There is %s file" msgid_plural "There are %s files" msgstr[0] "Hay %s fichero" msgstr[1] "Hay %s ficheros" 24
gettext comments 751/* --option */ 752printf(_("unrecognized option")); lib/getopt.c #. --option #: lib/getopt.c:752 msgid "unrecognized option" msgstr "" 25
awesome!  but…  how does it work  in Sphinx? enter  sphinx-i18n 26
replaces xgettext replaces libintl.h http://sphinx.pocoo.org/latest/intl.html 27
d.hatena.ne.jp/rudi/20110202/1296632643 Shirou Wakayama actuallytriedtoi18n the Sphinx 28
29 messages are scrambled (sorry, my Japanese is horrible)
Ian Lewis @ PyConMini.JP slideshare.net/Ianmlewis/Sphinx-11-I18N 30
? you are doing it wrong http://www.flickr.com/photos/iirraa/141120311/ 31
32
Pull request @mtlpython We’ve just fixed a problem in the gettext builder. Pull request @shibu I'd like to create patch for Internationalization feature for 1.1. Pull request @r_rudi Hello, I write the gettext builder patch.  Please check and merge if fair enough. Pull request @kou I 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 snipped 33
let‘s call it a day all work has already been done! not quite:the dreaded merge 34
35 releasethe kraken octomerge of sorts literally 8 different sources! http://www.flickr.com/photos/kfisto/1926477413
36 merged by Georg
37 cower, mere mortals here comes    the merge resolver Georg Brandl http://www.flickr.com/photos/pasukaru76/4293395231/
thanks.  questions? I’m that stargaming guy. #pocoo on Freenode sphinx.pocoo.org 38

Weitere ähnliche Inhalte

Was ist angesagt?

How to check valid email? Find using regex(p?)
How to check valid email? Find using regex(p?)How to check valid email? Find using regex(p?)
How to check valid email? Find using regex(p?)Visuality
 
15 bufferand records
15 bufferand records15 bufferand records
15 bufferand recordsashish61_scs
 
Concept of file handling in c
Concept of file handling in cConcept of file handling in c
Concept of file handling in cMugdhaSharma11
 
File Management in C
File Management in CFile Management in C
File Management in CPaurav Shah
 
Unit 3
Unit  3Unit  3
Unit 3siddr
 
Python File Handling | File Operations in Python | Learn python programming |...
Python File Handling | File Operations in Python | Learn python programming |...Python File Handling | File Operations in Python | Learn python programming |...
Python File Handling | File Operations in Python | Learn python programming |...Edureka!
 
Unit 7
Unit 7Unit 7
Unit 7siddr
 
Remodelling of a Database of Bavarian Dialects into TEI XML and LOD
Remodelling of a Database of Bavarian Dialects into TEI XML and LODRemodelling of a Database of Bavarian Dialects into TEI XML and LOD
Remodelling of a Database of Bavarian Dialects into TEI XML and LODJack Bowers
 
Python - File operations & Data parsing
Python - File operations & Data parsingPython - File operations & Data parsing
Python - File operations & Data parsingFelix Z. Hoffmann
 
File handling in c
File handling in cFile handling in c
File handling in cmohit biswal
 
File handling in C
File handling in CFile handling in C
File handling in CRabin BK
 

Was ist angesagt? (19)

COM1407: File Processing
COM1407: File Processing COM1407: File Processing
COM1407: File Processing
 
How to check valid email? Find using regex(p?)
How to check valid email? Find using regex(p?)How to check valid email? Find using regex(p?)
How to check valid email? Find using regex(p?)
 
15 bufferand records
15 bufferand records15 bufferand records
15 bufferand records
 
Python-files
Python-filesPython-files
Python-files
 
Schizophrenic files
Schizophrenic filesSchizophrenic files
Schizophrenic files
 
Vim and Python
Vim and PythonVim and Python
Vim and Python
 
Concept of file handling in c
Concept of file handling in cConcept of file handling in c
Concept of file handling in c
 
File Management in C
File Management in CFile Management in C
File Management in C
 
File management
File managementFile management
File management
 
Unit 3
Unit  3Unit  3
Unit 3
 
File mangement
File mangementFile mangement
File mangement
 
Python File Handling | File Operations in Python | Learn python programming |...
Python File Handling | File Operations in Python | Learn python programming |...Python File Handling | File Operations in Python | Learn python programming |...
Python File Handling | File Operations in Python | Learn python programming |...
 
Unit 7
Unit 7Unit 7
Unit 7
 
Remodelling of a Database of Bavarian Dialects into TEI XML and LOD
Remodelling of a Database of Bavarian Dialects into TEI XML and LODRemodelling of a Database of Bavarian Dialects into TEI XML and LOD
Remodelling of a Database of Bavarian Dialects into TEI XML and LOD
 
Python - File operations & Data parsing
Python - File operations & Data parsingPython - File operations & Data parsing
Python - File operations & Data parsing
 
File management
File managementFile management
File management
 
File in c
File in cFile in c
File in c
 
File handling in c
File handling in cFile handling in c
File handling in c
 
File handling in C
File handling in CFile handling in C
File handling in C
 

Ähnlich wie sphinx-i18n — The True Story

The Big Documentation Extravaganza
The Big Documentation ExtravaganzaThe Big Documentation Extravaganza
The Big Documentation ExtravaganzaStephan Schmidt
 
The Beauty And The Beast Php N W09
The Beauty And The Beast Php N W09The Beauty And The Beast Php N W09
The Beauty And The Beast Php N W09Bastian Feder
 
The Beauty and the Beast
The Beauty and the BeastThe Beauty and the Beast
The Beauty and the BeastBastian Feder
 
Ekon bestof rtl_delphi
Ekon bestof rtl_delphiEkon bestof rtl_delphi
Ekon bestof rtl_delphiMax Kleiner
 
Automating API Documentation
Automating API DocumentationAutomating API Documentation
Automating API DocumentationSelvakumar T S
 
The beautyandthebeast phpbat2010
The beautyandthebeast phpbat2010The beautyandthebeast phpbat2010
The beautyandthebeast phpbat2010Bastian Feder
 
Php Documentor The Beauty And The Beast
Php Documentor The Beauty And The BeastPhp Documentor The Beauty And The Beast
Php Documentor The Beauty And The BeastBastian Feder
 
The use of the code analysis library OpenC++: modifications, improvements, er...
The use of the code analysis library OpenC++: modifications, improvements, er...The use of the code analysis library OpenC++: modifications, improvements, er...
The use of the code analysis library OpenC++: modifications, improvements, er...PVS-Studio
 
Reversingobfuscatedpythonapplications dropbox-140819110311-phpapp01
Reversingobfuscatedpythonapplications dropbox-140819110311-phpapp01Reversingobfuscatedpythonapplications dropbox-140819110311-phpapp01
Reversingobfuscatedpythonapplications dropbox-140819110311-phpapp01Wajhi Ul Hassan Naqvi
 

Ähnlich wie sphinx-i18n — The True Story (20)

The Big Documentation Extravaganza
The Big Documentation ExtravaganzaThe Big Documentation Extravaganza
The Big Documentation Extravaganza
 
The Beauty And The Beast Php N W09
The Beauty And The Beast Php N W09The Beauty And The Beast Php N W09
The Beauty And The Beast Php N W09
 
abc12
abc12abc12
abc12
 
abc
abcabc
abc
 
popopo
popopopopopo
popopo
 
The Beauty and the Beast
The Beauty and the BeastThe Beauty and the Beast
The Beauty and the Beast
 
Ekon bestof rtl_delphi
Ekon bestof rtl_delphiEkon bestof rtl_delphi
Ekon bestof rtl_delphi
 
Sample
SampleSample
Sample
 
Automating API Documentation
Automating API DocumentationAutomating API Documentation
Automating API Documentation
 
The beautyandthebeast phpbat2010
The beautyandthebeast phpbat2010The beautyandthebeast phpbat2010
The beautyandthebeast phpbat2010
 
Project Automation
Project AutomationProject Automation
Project Automation
 
lf-2003_01-0269
lf-2003_01-0269lf-2003_01-0269
lf-2003_01-0269
 
lf-2003_01-0269
lf-2003_01-0269lf-2003_01-0269
lf-2003_01-0269
 
Processing XML with Java
Processing XML with JavaProcessing XML with Java
Processing XML with Java
 
COinS (eng version)
COinS (eng version)COinS (eng version)
COinS (eng version)
 
Php Documentor The Beauty And The Beast
Php Documentor The Beauty And The BeastPhp Documentor The Beauty And The Beast
Php Documentor The Beauty And The Beast
 
The use of the code analysis library OpenC++: modifications, improvements, er...
The use of the code analysis library OpenC++: modifications, improvements, er...The use of the code analysis library OpenC++: modifications, improvements, er...
The use of the code analysis library OpenC++: modifications, improvements, er...
 
Learn python
Learn pythonLearn python
Learn python
 
Pmm05 16
Pmm05 16Pmm05 16
Pmm05 16
 
Reversingobfuscatedpythonapplications dropbox-140819110311-phpapp01
Reversingobfuscatedpythonapplications dropbox-140819110311-phpapp01Reversingobfuscatedpythonapplications dropbox-140819110311-phpapp01
Reversingobfuscatedpythonapplications dropbox-140819110311-phpapp01
 

Kürzlich hochgeladen

Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 

Kürzlich hochgeladen (20)

Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 

sphinx-i18n — The True Story

  • 1. 1 sphinx-i18n The True Story robertlehmann.de Development Processes in Open Source Projects
  • 2. ocumentclass{manual}sepackage[T1]{fontenc}sepackage{textcomp}itle{PythonTutorial}nput{boilerplate}akeindexegin{document}aketitlefhtmlhapter*{FrontMatterabel{front}}input{copyright}egin{abstract}oindent For a description of standard objects and modules, see the itetitle[../lib/lib.html]{Python Library Reference} document. The itetitle[../ref/ref.html]{Python Reference Manual} gives a more formal definition of the language. To write extensions in C or pp, read itetitle[../ext/ext.html]{Extending and Embedding the Python Interpreter} and itetitle[../api/api.html]{Python/C API Reference}. There are also several books covering Python in depth. nd{abstract} ableofcontents hapter{Whetting Your Appetite abel{intro}} Python enables programs to be written compactly and readably. Programs written in Python are typically much shorter than equivalent C, pp{}, or Java programs, for several reasons:egin{itemize}tem the high-level data types allow you to express complex operations in a single statement;tem statement grouping is done by indentation;tem no variable or argument declarations are necessary.nd{itemize} On Windows machines, the Python installation is usually placed in ile{C: Python24}, though you can change this when you're running the installer: egin{verbatim} set path=%path%; C:ython24nd{verbatim}egin{seealso}eetitle[../lib/typesseq.html]{Sequence Types}%{Strings, and the Unicode strings described in the next section, are examples of mph{sequence types}, and support the common operations supported by such types.}nd{seealso}ubsection{Unicode Strings abel{unicodeStrings}}ectionauthor{Marc-Andre Lemburg}{mal@ lemburg.com}egin{methoddesc}[list]{pop}{ptional{i}}If no index is specified, ode{a.pop()} removes and returns the last item in the list. You will see this notation frequently in the itetitle[../lib/lib.html]{Python Library Reference}.)nd{methoddesc} Everbodyhates it with a passion. 2
  • 3. GSoC ReST Docutils gettext Sphinx Issue #653 to the rescue! 3
  • 4. implemented June 2007 as py-rest-docfor Docutils live August 2007 on docs.python.org released March 2008 as Sphinx BSD license requires attribution 1.0 in July 2010 1.0.7 in January 2011 latest stable release 3290 commits[as of 2011/05/15] 4
  • 5. Docutils tutorial.rst "reST" is **ONE** word, *not two!* tutorial "reST" isONE word, not two! 5 Check out http://docutils.sf.net/docs/user/rst/quickstart.html for details!
  • 6. math rendering markup domains search indices feedback syntax highlighting tutorial.rst "reST" is **ONE** word, *not two!* tutorial.pdf tutorial.html tutorial.tex tutorial.1.gz tutorial.epub i18n ... autodoc themes Hierarchical structure: easy definition of a document tree, with automatic links to siblings, parents and children doctests 6
  • 7. Georg “birkenfeld” Brandl 2004: Pocoo project the makers of Werkzeug, Pygments, Jinja, … 2008: PSF Community Award 2011: Frank Willison Award 205k churns [as of 2011/06/27] 2500 commits that‘s changed LOCs without bfb5b73af019, e88201ce226b, and 2d7e85e0c7b4, which imported the Python docs 7
  • 8. Daniel Neuhäuser Jacob Mason Japanese community Armin Ronacher …and about 70 others! http://sphinx-users.jp/event/20100724_release_party.html http://flickr.com/photos/bastispicks/3911044033 8
  • 9. Who’s using it All logos and trademarks are © Copyright their respective owners. 9
  • 12. gsoc.robertlehmann.de © 2010 Google Open Source Programs Office 12
  • 13. 13 gsoc.robertlehmann.de umbrellaorganisation © 2010 Google Open Source Programs Office
  • 14. 14 © 2010 Google Open Source Programs Office, http://socghop.appspot.com/document/show/gsoc_program/google/gsoc2010/timeline
  • 15. pootle.python.org 15 Sphinx Native Language Support: Toolchain for Creating, Tracking and Viewing Internationalized Versions of Sphinx Documents
  • 16. cool story, bro. ? but what is this internationalization you are talking about enter gettext! 16
  • 17. gettext 0106 #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.bz2 17
  • 18. gettext dfa.c 2954 char *lcopy = malloc(len); 2955 if (!lcopy) 2956dfaerror(_("out of memory")); xgettext grep.pot #: src/dfa.c:2956 msgid "out of memory" msgstr "" 18
  • 19. gettext grep.po #: src/dfa.c:2956 msgid "out of memory" msgstr msginit "Speicheristalle." "" http://translationproject.org/PO-files/de/grep-2.5.de.po 19
  • 20. gettext grep.po #: src/dfa.c:2956 msgid "out of memory" msgstr "Speicheristalle." msgfmt grep.mo 20
  • 21. gettext /usr/share/locale/de/LC_MESSAGES/grep.mo grep.mo LANG=de grep.c 1346#if defined(ENABLE_NLS) 1347bindtextdomain("grep", "/usr/share/locale") 1348textdomain("grep"); 1349#endif bindtextdomain(3) – set directory containing message catalogs textdomain(3) – set domain for gettext() calls 21
  • 22. *gasp* Cool. What else? internationalization is hard,let’s go shopping 22
  • 23. gettext interpolation 873 if (not_text) 874printf (_("Binary file %s matches"), 875 filename); grep.c – main driver file for grep #: src/grep.c:874 #, c-format msgid "Binary file: %s matches" msgstr "" "ÜbereinstimmungeninBinärdatei %s" http://translationproject.org/PO-files/de/grep-2.5.de.po 23
  • 24. gettext plural forms 219 x = ngettext("There is %s file", 220"There are %s files", n) test_gettext.py, CPython Plural-Forms:nplurals=2; plural=n!=1 msgid "There is %s file" msgid_plural "There are %s files" msgstr[0] "Hay %s fichero" msgstr[1] "Hay %s ficheros" 24
  • 25. gettext comments 751/* --option */ 752printf(_("unrecognized option")); lib/getopt.c #. --option #: lib/getopt.c:752 msgid "unrecognized option" msgstr "" 25
  • 26. awesome! but… how does it work in Sphinx? enter sphinx-i18n 26
  • 27. replaces xgettext replaces libintl.h http://sphinx.pocoo.org/latest/intl.html 27
  • 28. d.hatena.ne.jp/rudi/20110202/1296632643 Shirou Wakayama actuallytriedtoi18n the Sphinx 28
  • 29. 29 messages are scrambled (sorry, my Japanese is horrible)
  • 30. Ian Lewis @ PyConMini.JP slideshare.net/Ianmlewis/Sphinx-11-I18N 30
  • 31. ? you are doing it wrong http://www.flickr.com/photos/iirraa/141120311/ 31
  • 32. 32
  • 33. Pull request @mtlpython We’ve just fixed a problem in the gettext builder. Pull request @shibu I'd like to create patch for Internationalization feature for 1.1. Pull request @r_rudi Hello, I write the gettext builder patch. Please check and merge if fair enough. Pull request @kou I 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 snipped 33
  • 34. let‘s call it a day all work has already been done! not quite:the dreaded merge 34
  • 35. 35 releasethe kraken octomerge of sorts literally 8 different sources! http://www.flickr.com/photos/kfisto/1926477413
  • 36. 36 merged by Georg
  • 37. 37 cower, mere mortals here comes the merge resolver Georg Brandl http://www.flickr.com/photos/pasukaru76/4293395231/
  • 38. thanks. questions? I’m that stargaming guy. #pocoo on Freenode sphinx.pocoo.org 38