Learn R Programming

examly (version 0.2.0)

i18n_t: Translate a UI/message key

Description

Returns the value for key from a dictionary produced by i18n_load(). If the key is missing, returns default when provided, otherwise the key itself.

Usage

i18n_t(dict, key, default = NULL)

Value

Character scalar.

Arguments

dict

Named list produced by i18n_load().

key

Character scalar; lookup key.

default

Optional fallback value if the key is not present.

Examples

Run this code
# A quick, fully automatic check:
p <- system.file("shinyapp", "i18n", "en.json", package = "examly")
if (nzchar(p) && file.exists(p)) {
  d <- i18n_load("en")
  i18n_t(d, "buttons.download", "Download")
}

Run the code above in your browser using DataLab