Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d4a28ec

Browse files
authored
[3.11] gh-113637: Let c_annotations.py to handle the spacing of Limited/Unstable API & Stable ABI translation strings (#113638) (#113679)
1 parent 93e9381 commit d4a28ec

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

Doc/tools/extensions/c_annotations.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ def add_annotations(self, app, doctree):
126126
f"Object type mismatch in limited API annotation "
127127
f"for {name}: {record['role']!r} != {objtype!r}")
128128
stable_added = record['added']
129-
message = sphinx_gettext(' Part of the ')
129+
message = sphinx_gettext('Part of the')
130+
message = message.center(len(message) + 2)
130131
emph_node = nodes.emphasis(message, message,
131132
classes=['stableabi'])
132133
ref_node = addnodes.pending_xref(
@@ -139,20 +140,20 @@ def add_annotations(self, app, doctree):
139140
ref_node += nodes.Text(sphinx_gettext('Stable ABI'))
140141
emph_node += ref_node
141142
if struct_abi_kind == 'opaque':
142-
emph_node += nodes.Text(sphinx_gettext(' (as an opaque struct)'))
143+
emph_node += nodes.Text(' ' + sphinx_gettext('(as an opaque struct)'))
143144
elif struct_abi_kind == 'full-abi':
144-
emph_node += nodes.Text(sphinx_gettext(' (including all members)'))
145+
emph_node += nodes.Text(' ' + sphinx_gettext('(including all members)'))
145146
if record['ifdef_note']:
146147
emph_node += nodes.Text(' ' + record['ifdef_note'])
147148
if stable_added == '3.2':
148149
# Stable ABI was introduced in 3.2.
149150
pass
150151
else:
151-
emph_node += nodes.Text(sphinx_gettext(' since version %s') % stable_added)
152+
emph_node += nodes.Text(' ' + sphinx_gettext('since version %s') % stable_added)
152153
emph_node += nodes.Text('.')
153154
if struct_abi_kind == 'members':
154155
emph_node += nodes.Text(
155-
sphinx_gettext(' (Only some members are part of the stable ABI.)'))
156+
' ' + sphinx_gettext('(Only some members are part of the stable ABI.)'))
156157
node.insert(0, emph_node)
157158

158159
# Return value annotation

Doc/tools/templates/dummy.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99

1010
In extensions/c_annotations.py:
1111

12-
{% trans %} Part of the {% endtrans %}
12+
{% trans %}Part of the{% endtrans %}
1313
{% trans %}Limited API{% endtrans %}
1414
{% trans %}Stable ABI{% endtrans %}
15-
{% trans %} (as an opaque struct){% endtrans %}
16-
{% trans %} (including all members){% endtrans %}
17-
{% trans %} since version %s{% endtrans %}
18-
{% trans %} (Only some members are part of the stable ABI.){% endtrans %}
15+
{% trans %}(as an opaque struct){% endtrans %}
16+
{% trans %}(including all members){% endtrans %}
17+
{% trans %}since version %s{% endtrans %}
18+
{% trans %}(Only some members are part of the stable ABI.){% endtrans %}
1919
{% trans %}Return value: Always NULL.{% endtrans %}
2020
{% trans %}Return value: New reference.{% endtrans %}
2121
{% trans %}Return value: Borrowed reference.{% endtrans %}

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Farhan Ahmad
3131
Matthew Ahrens
3232
Nir Aides
3333
Akira
34+
Ege Akman
3435
Yaniv Aknin
3536
Jyrki Alakuijala
3637
Tatiana Al-Chueyr

0 commit comments

Comments
 (0)