File tree 2 files changed +13
-2
lines changed
2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 57
57
58
58
{% trans sphinx_version=sphinx_version|e %}Created using < a href ="http://sphinx.pocoo.org/ "> Sphinx</ a > {{ sphinx_version }}.{% endtrans %}
59
59
</ div >
60
+ {# Translated messages used by copybutton #}
61
+ {% if builder != "htmlhelp" and not embedded %}
62
+ < div class ="copybutton-msg " style ="display: none ">
63
+ < p id ="copybutton-hide-text "> {% trans %}Hide the prompts and output{% endtrans %}</ p >
64
+ < p id ="copybutton-show-text "> {% trans %}Show the prompts and output{% endtrans %}</ p >
65
+ </ div >
66
+ {% endif %}
60
67
{% endblock %}
Original file line number Diff line number Diff line change @@ -8,10 +8,14 @@ $(document).ready(function() {
8
8
'.highlight-default .highlight' ) ;
9
9
var pre = div . find ( 'pre' ) ;
10
10
11
+ // search for the translated prompt strings and fallback to use English if not found
12
+ var hide_text_p = $ ( '#copybutton-hide-text' ) ;
13
+ var hide_text = hide_text_p . length > 0 ? hide_text_p . text ( ) : "Hide the prompts and output" ;
14
+ var show_text_p = $ ( '#copybutton-show-text' ) ;
15
+ var show_text = show_text_p . length > 0 ? show_text_p . text ( ) : "Show the prompts and output" ;
16
+
11
17
// get the styles from the current theme
12
18
pre . parent ( ) . parent ( ) . css ( 'position' , 'relative' ) ;
13
- var hide_text = 'Hide the prompts and output' ;
14
- var show_text = 'Show the prompts and output' ;
15
19
var border_width = pre . css ( 'border-top-width' ) ;
16
20
var border_style = pre . css ( 'border-top-style' ) ;
17
21
var border_color = pre . css ( 'border-top-color' ) ;
You can’t perform that action at this time.
0 commit comments