diff options
| author | Nozomu Kaneko <nozom.kaneko@gmail.com> | 2013-02-04 09:03:34 +0900 |
|---|---|---|
| committer | Nozomu Kaneko <nozom.kaneko@gmail.com> | 2013-02-04 09:03:34 +0900 |
| commit | f0a89991c3310eb61386a103297f608960bcd76e (patch) | |
| tree | 9d92ba294d740f4309ed965d2bb51de44d644772 /sphinx/directives | |
| parent | 2ce5da1c1866e2bc52d97fa2118d82590e302ae3 (diff) | |
| download | sphinx-f0a89991c3310eb61386a103297f608960bcd76e.tar.gz | |
make versionmodified translatable
Diffstat (limited to 'sphinx/directives')
| -rw-r--r-- | sphinx/directives/other.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sphinx/directives/other.py b/sphinx/directives/other.py index 50188ea4..e8955d16 100644 --- a/sphinx/directives/other.py +++ b/sphinx/directives/other.py @@ -194,12 +194,20 @@ class VersionChange(Directive): if len(self.arguments) == 2: inodes, messages = self.state.inline_text(self.arguments[1], self.lineno+1) - node.append(nodes.paragraph('', '', *inodes)) + para = nodes.paragraph(self.arguments[1], '', *inodes) + set_source_info(self, para) + node.append(para) else: messages = [] if self.content: self.state.nested_parse(self.content, self.content_offset, node) if len(node): + if isinstance(node[0], nodes.paragraph) and node[0].rawsource: + content = nodes.inline(node[0].rawsource, translatable=True) + content.source = node[0].source + content.line = node[0].line + content += node[0].children + node[0].replace_self(nodes.paragraph('', '', content)) node[0].insert(0, nodes.inline('', '%s: ' % text)) else: para = nodes.paragraph('', '', nodes.inline('', '%s.' % text)) |
