diff --git a/inst/rmd/h/default.html b/inst/rmd/h/default.html index 4361ccde34..49d343e0e3 100644 --- a/inst/rmd/h/default.html +++ b/inst/rmd/h/default.html @@ -247,6 +247,18 @@ window.initializeCodeFolding("$code_folding$" === "show"); $endif$ }); +// Show/Hide button names internationalization. +// Variables used in codefolding.js. +$if(code_folding_show_btn)$ +var ShowCode = $code_folding_show_btn$; +$else$ +var ShowCode = 'Show'; +$endif$ +$if(code_folding_hide_btn)$ +var HideCode = $code_folding_hide_btn$; +$else$ +var HideCode = 'Hide'; +$endif$ $endif$ @@ -386,11 +398,18 @@ $if(code_menu)$
- +
- $endif$ - $endif$ - $if(title)$

$title$

$if(subtitle)$ diff --git a/inst/rmd/h/navigation-1.1/codefolding.js b/inst/rmd/h/navigation-1.1/codefolding.js index 4938425052..1112a361c1 100644 --- a/inst/rmd/h/navigation-1.1/codefolding.js +++ b/inst/rmd/h/navigation-1.1/codefolding.js @@ -1,3 +1,6 @@ +// Variables defined in default.html. +// var ShowCode = 'Show'; +// var HideCode = 'Hide'; window.initializeCodeFolding = function(show) { @@ -30,7 +33,7 @@ window.initializeCodeFolding = function(show) { $(this).detach().appendTo(div); // add a show code button right above - var showCodeText = $('' + (show ? 'Hide' : 'Code') + ''); + var showCodeText = $('' + (show ? HideCode : ShowCode) + ''); var showCodeButton = $(''); showCodeButton.append(showCodeText); showCodeButton @@ -49,10 +52,10 @@ window.initializeCodeFolding = function(show) { // update state of button on show/hide div.on('hidden.bs.collapse', function () { - showCodeText.text('Code'); + showCodeText.text(ShowCode); }); div.on('show.bs.collapse', function () { - showCodeText.text('Hide'); + showCodeText.text(HideCode); }); });