-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show source shows english source #65
Comments
@rffontenelle @JulienPalard What do you think? |
Well, if the English source reST file is shown, one doesn't see the translation. If we change this so the translation file (.po) is shown, one will not see the reST document structure (roles, directives, paragraphs, etc.). The best would be to show a translated reST file combining both documents, but last time I checked, this is not possible. |
It would definitely be helpful. Sphinx doesn't produce localized rst files, HTML builder takes rsts and builds directly with gettext. I envision this as a second link next to "Show source" titled "Show translation source". @StanFromIreland could you open a discussion or feature request in Sphinx? |
Now that's a great idea! |
Let's track it upstream. |
Draft of a patch in CPython repo. Figuring out the language in template context would be needed. Plus a local test. Index: Doc/tools/templates/customsourcelink.html
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/Doc/tools/templates/customsourcelink.html b/Doc/tools/templates/customsourcelink.html
--- a/Doc/tools/templates/customsourcelink.html (revision 9e23e0ad2cc4267829388bc29688ac0c2bfb3604)
+++ b/Doc/tools/templates/customsourcelink.html (date 1740052456655)
@@ -8,6 +8,13 @@
rel="nofollow">{{ _('Show Source') }}
</a>
</li>
+ {%- if TODO %}
+ <li>
+ <a href="https://github.com/python/python-docs-{{ TODO }}/blob/{{ version }}/{{ pagename }}.po"
+ rel="nofollow">{{ _('Show translation source') }}
+ </a>
+ </li>
+ {%- endif %}
</ul>
</div>
{%- endif %} |
This is simple enough and works for me:
|
Would it be better to redirect to translation .po files? I would be for a redirect as generally when I use it it is to fix a typo or something like that and I would like to see the raw content.
This would have to be done elsewhere but this issue is more for discussion rather than implementation.
The text was updated successfully, but these errors were encountered: