As said by @Tschösi these values are hard coded in the function, which leaves you with 2 options:
- You create an own copy of the function, where you replace the hard coded versions.
- You apply some Javascript to change the text dynamically.
Personally, I'd favor option 2.
Here's a working example of how to do that:
library(shiny)
js <- HTML(paste("$(function() {",
"$('body').on('shown.bs.modal', function() {",
"$('.modal-dialog .modal-header > .modal-title').text('Speicher Lesezeichen')",
"$('.modal-dialog .modal-body > span:first').text('Dieser Link speichert den aktuellen Status der Applikation.')",
"$('#shiny-bookmark-copy-text').text('Drücken Sie Ctrl-C um den Link zu kopieren.')",
"$('.modal-dialog .modal-footer > button').text('Schließen')",
"})",
"})",
sep = "\n"))
ui <- function(request) {
fluidPage(
tags$head(tags$script(js, type = "text/javascript")),
tabsetPanel(id = "tabs",
tabPanel("One",
checkboxInput("chk1", "Checkbox 1"),
bookmarkButton(id = "bookmark1")
),
tabPanel("Two",
checkboxInput("chk2", "Checkbox 2"),
bookmarkButton(id = "bookmark2")
)
)
)
}
server <- function(input, output, session) {
# Need to exclude the buttons from themselves being bookmarked
setBookmarkExclude(c("bookmark1", "bookmark2"))
# Trigger bookmarking with either button
observeEvent(input$bookmark1, {
session$doBookmark()
})
observeEvent(input$bookmark2, {
session$doBookmark()
})
}
enableBookmarking(store = "url")
shinyApp(ui, server)
