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

Make copybutton messages translatable#27

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletionspython_docs_theme/layout.html
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -57,4 +57,11 @@

{% trans sphinx_version=sphinx_version|e %}Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %}
</div>
{# Translated messages used by copybutton #}
{% if builder != "htmlhelp" and not embedded %}
<div class="copybutton-msg" style="display: none">
<p id="copybutton-hide-text">{% trans %}Hide the prompts and output{% endtrans %}</p>
<p id="copybutton-show-text">{% trans %}Show the prompts and output{% endtrans %}</p>
</div>
{% endif %}
{% endblock %}
8 changes: 6 additions & 2 deletionspython_docs_theme/static/copybutton.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,10 +8,14 @@ $(document).ready(function() {
'.highlight-default .highlight');
var pre = div.find('pre');

// search for the translated prompt strings and fallback to use English if not found
var hide_text_p = $('#copybutton-hide-text');
var hide_text = hide_text_p.length > 0 ? hide_text_p.text() : "Hide the prompts and output";
var show_text_p = $('#copybutton-show-text');
var show_text = show_text_p.length > 0 ? show_text_p.text() : "Show the prompts and output";

// get the styles from the current theme
pre.parent().parent().css('position', 'relative');
var hide_text = 'Hide the prompts and output';
var show_text = 'Show the prompts and output';
var border_width = pre.css('border-top-width');
var border_style = pre.css('border-top-style');
var border_color = pre.css('border-top-color');
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp