mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Document basic workflow in gettext builder.
This commit is contained in:
@@ -39,6 +39,9 @@ msgstr ""
|
|||||||
"""[1:]
|
"""[1:]
|
||||||
|
|
||||||
class MessageCatalogBuilder(Builder):
|
class MessageCatalogBuilder(Builder):
|
||||||
|
"""
|
||||||
|
Builds gettext-style message catalogs (.pot files).
|
||||||
|
"""
|
||||||
name = 'gettext'
|
name = 'gettext'
|
||||||
|
|
||||||
def init(self):
|
def init(self):
|
||||||
@@ -54,6 +57,11 @@ class MessageCatalogBuilder(Builder):
|
|||||||
return
|
return
|
||||||
|
|
||||||
def write_doc(self, docname, doctree):
|
def write_doc(self, docname, doctree):
|
||||||
|
"""
|
||||||
|
Store a document's translatable strings in the message catalog of its
|
||||||
|
section. For this purpose a document's *top-level directory* -- or
|
||||||
|
otherwise its *name* -- is considered its section.
|
||||||
|
"""
|
||||||
catalog = self.catalogs[docname.split('/')[0]]
|
catalog = self.catalogs[docname.split('/')[0]]
|
||||||
for node in doctree.traverse(nodes.TextElement):
|
for node in doctree.traverse(nodes.TextElement):
|
||||||
if isinstance(node, (nodes.Invisible, nodes.Inline)):
|
if isinstance(node, (nodes.Invisible, nodes.Inline)):
|
||||||
|
|||||||
Reference in New Issue
Block a user