quetzio_txt | R Documentation |
Get texts for given language and supports getting them in context of quetzio_server
quetzio_txt(lang, x = NULL, private = NULL)
lang |
character to identify the language |
x |
character to identify the txt to get. If NULL, all labels are recovered |
private |
private element of R6 class in which context it is used to get the specific element. Used only internally. Recommended to leave at NULL default. |
'quetzio_txt' outside of internal usage should be used only for getting the structure of all texts generated by 'quetzio_server'. You then call it in your console without specifying the 'private' argument.
To customize texts used by questionnaire module, provide within its init call named list to the 'custom_txts' argument. Its elements should be named in the same way as the default text you are willing to replace: so to replace only the Submit button label for the state when the questionnaire is valid for submission and not, the list should look like that:
custom_txts = list(submit_enabled = "Do it!", submit_disabled = "Can't do!)
quetzio_server
#### Usage during development #### # Get all values for given language quetzio_txt("en") # Get specific text quetzio_txt("en", "submit_done") #### How to use 'custom_txts' during initialization of quetzio #### ## Only run example in interactive R sessions if (interactive()) { # load libraries library(shiny) library(shiny.quetzio) # create ui ui <- fluidPage(Quetzio_UI("my_quetzio")) server <- function(input, output, session) { # initialize new quetzio questionnaire <- Quetzio_create( source_method = "raw", source_object = quetzio_examples$questions_lists$simple_quetzio, module_id = "my_quetzio", # specify some custom texts to show up custom_txts = list( modal_title = "Something is not right!", modal_content = "Please correct your answers:", submit_enabled = "Do it!", submit_disabled = "Can't do!" ) ) } shinyApp(ui, server) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.