Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitedd92a1

Browse files
gh-98366: use sphinx.locale._ as gettext() in pyspecific.py (GH-98437)
fix(doc-tools): use sphinx.locale._ as gettext() for backward-compatibility in pyspecific.py[why] spinix 5.3 changed locale.translators from a defaultdict(gettext.NullTranslations) to a dict, which leads to failure of pyspecific.py. Use sphinx.locale._ as gettext to fix the issue.(cherry picked from commitd26ee8a)Co-authored-by: Wei-Hsiang (Matt) Wang <mattwang44@gmail.com>
1 parent17f1c0a commitedd92a1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎Doc/tools/extensions/pyspecific.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
fromsphinx.errorsimportNoUri
2727
exceptImportError:
2828
fromsphinx.environmentimportNoUri
29-
fromsphinx.localeimporttranslators
29+
fromsphinx.localeimport_assphinx_gettext
3030
fromsphinx.utilimportstatus_iterator,logging
3131
fromsphinx.util.nodesimportsplit_explicit_title
3232
fromsphinx.writers.textimportTextWriter,TextTranslator
@@ -109,7 +109,7 @@ class ImplementationDetail(Directive):
109109
defrun(self):
110110
self.assert_has_content()
111111
pnode=nodes.compound(classes=['impl-detail'])
112-
label=translators['sphinx'].gettext(self.label_text)
112+
label=sphinx_gettext(self.label_text)
113113
content=self.content
114114
add_text=nodes.strong(label,label)
115115
self.state.nested_parse(content,self.content_offset,pnode)
@@ -257,7 +257,7 @@ def run(self):
257257
else:
258258
args= []
259259

260-
label=translators['sphinx'].gettext(self._label[min(2,len(args))])
260+
label=sphinx_gettext(self._label[min(2,len(args))])
261261
text=label.format(name="``{}``".format(name),
262262
args=", ".join("``{}``".format(a)forainargsifa))
263263

@@ -436,7 +436,7 @@ def run(self):
436436
else:
437437
label=self._removed_label
438438

439-
label=translators['sphinx'].gettext(label)
439+
label=sphinx_gettext(label)
440440
text=label.format(deprecated=self.arguments[0],removed=self.arguments[1])
441441
iflen(self.arguments)==3:
442442
inodes,messages=self.state.inline_text(self.arguments[2],

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2026 Movatter.jp