[issue28331] "CPython implementation detail:" is removed when contents is translated

New submission from INADA Naoki: "CPython implementation detail:" label is removed when contents of impl-detail directive is translated. This is very bad for people reading translated documents. Attached patch fixes this, with enabling translating the label, like versionchanged directive. ---------- assignee: docs@python components: Documentation files: impl-detail.patch keywords: patch messages: 277817 nosy: docs@python, inada.naoki priority: normal severity: normal stage: patch review status: open title: "CPython implementation detail:" is removed when contents is translated type: enhancement versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7 Added file: http://bugs.python.org/file44910/impl-detail.patch _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue28331> _______________________________________

Changes by Ned Deily <nad@python.org>: ---------- nosy: +georg.brandl _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue28331> _______________________________________

Berker Peksag added the comment: Does Sphinx use a dummy HTML file like you did in the patch? ---------- nosy: +berker.peksag _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue28331> _______________________________________

INADA Naoki added the comment: Yes. Actually speaking, this patch is almost copy from VersionChanged directive. See here: https://github.com/sphinx-doc/sphinx/blob/master/sphinx/directives/other.py#... ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue28331> _______________________________________

Berker Peksag added the comment: I couldn't find any dummy HTML in the Sphinx codebase. Wouldn't something like work without a dummy HTML? from sphinx.locale import versionlabels, l_ versionlabels['cpythonimpldetail'] = l_('CPython implementation detail') Then use it in ImplementationDetail.run() method like https://github.com/sphinx-doc/sphinx/blob/master/sphinx/directives/other.py#... ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue28331> _______________________________________

INADA Naoki added the comment: Ah, I misunderstood your comment is about Sphinx's internal DOM. Sphinx has own pot and po files. In case of custom extension, `sphinx-build -b gettext` doesn't extract messages from Python code. That's why I used dummy html template. Another way is adding custom make target, which runs `sphinx-build -b gettext` and custom command to generate another pot from pyspecific extension. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue28331> _______________________________________

Changes by INADA Naoki <songofacandy@gmail.com>: Added file: http://bugs.python.org/file44969/impl-detail2.patch _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue28331> _______________________________________

Terry J. Reedy added the comment: I abbreviated title to make most of it visible in listings. ---------- nosy: +terry.reedy title: "CPython implementation detail:" is removed when contents is translated -> "CPython implementation detail:" removed when content translated _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue28331> _______________________________________

Changes by INADA Naoki <songofacandy@gmail.com>: ---------- nosy: +Julien.Palard, JulienPalard _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue28331> _______________________________________

Changes by INADA Naoki <songofacandy@gmail.com>: ---------- pull_requests: +162 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue28331> _______________________________________

Changes by INADA Naoki <songofacandy@gmail.com>: ---------- pull_requests: +676 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue28331> _______________________________________

Changes by INADA Naoki <songofacandy@gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 2.7, Python 3.5 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue28331> _______________________________________

INADA Naoki added the comment: New changeset 906118d8c68160ed4a3d15cec803d1ee57836517 by INADA Naoki in branch '3.6': bpo-28331: fix impl-detail label is removed when content is translated. (GH-769) https://github.com/python/cpython/commit/906118d8c68160ed4a3d15cec803d1ee578... ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue28331> _______________________________________

INADA Naoki added the comment: New changeset c351ce6a2c923c5016e48ecbf7b1e4833031d154 by INADA Naoki in branch 'master': bpo-28331: fix impl-detail label is removed when content is translated. (GH-195) https://github.com/python/cpython/commit/c351ce6a2c923c5016e48ecbf7b1e483303... ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue28331> _______________________________________
participants (4)
-
Berker Peksag
-
INADA Naoki
-
Ned Deily
-
Terry J. Reedy