classification
Title: "CPython implementation detail:" removed when content translated
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.7, Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Julien.Palard, JulienPalard, berker.peksag, docs@python, georg.brandl, inada.naoki, terry.reedy
Priority: normal Keywords: patch

Created on 2016-10-01 13:29 by inada.naoki, last changed 2017-03-24 22:41 by inada.naoki. This issue is now closed.

Files
File name Uploaded Description Edit
impl-detail.patch inada.naoki, 2016-10-01 13:29 review
impl-detail2.patch inada.naoki, 2016-10-05 07:50 review
Pull Requests
URL Status Linked Edit
PR 195 merged inada.naoki, 2017-02-20 11:20
PR 769 merged inada.naoki, 2017-03-22 11:58
Messages (8)
msg277817 - (view) Author: Inada Naoki (inada.naoki) * (Python committer) Date: 2016-10-01 13:29
"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.
msg278106 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2016-10-05 06:43
Does Sphinx use a dummy HTML file like you did in the patch?
msg278107 - (view) Author: Inada Naoki (inada.naoki) * (Python committer) Date: 2016-10-05 06:50
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#L216-L221
msg278108 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2016-10-05 07:01
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#L204
msg278111 - (view) Author: Inada Naoki (inada.naoki) * (Python committer) Date: 2016-10-05 07:14
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.
msg278272 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2016-10-07 21:47
I abbreviated title to make most of it visible in listings.
msg290098 - (view) Author: Inada Naoki (inada.naoki) * (Python committer) Date: 2017-03-24 16:34
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/906118d8c68160ed4a3d15cec803d1ee57836517
msg290266 - (view) Author: Inada Naoki (inada.naoki) * (Python committer) Date: 2017-03-24 22:41
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/c351ce6a2c923c5016e48ecbf7b1e4833031d154
History
Date User Action Args
2017-03-24 22:41:36inada.naokisetmessages: + msg290266
2017-03-24 16:34:10inada.naokisetmessages: + msg290098
2017-03-22 12:10:05inada.naokisetstatus: open -> closed
stage: patch review -> resolved
resolution: fixed
versions: - Python 2.7, Python 3.5
2017-03-22 11:58:04inada.naokisetpull_requests: + pull_request676
2017-02-20 11:20:06inada.naokisetpull_requests: + pull_request162
2016-12-12 03:03:28inada.naokilinkissue26546 dependencies
2016-12-08 10:45:30inada.naokisetnosy: + JulienPalard, Julien.Palard
2016-10-07 21:47:44terry.reedysetnosy: + terry.reedy

messages: + msg278272
title: "CPython implementation detail:" is removed when contents is translated -> "CPython implementation detail:" removed when content translated
2016-10-05 07:50:38inada.naokisetfiles: + impl-detail2.patch
2016-10-05 07:14:34inada.naokisetmessages: + msg278111
2016-10-05 07:01:26berker.peksagsetmessages: + msg278108
2016-10-05 06:50:42inada.naokisetmessages: + msg278107
2016-10-05 06:43:11berker.peksagsetnosy: + berker.peksag
messages: + msg278106
2016-10-01 17:21:28ned.deilysetnosy: + georg.brandl
2016-10-01 13:29:12inada.naokicreate