Learn R Programming

examly (version 0.2.0)

i18n_load: Load translation dictionary

Description

Finds <lang>.json under the installed package's i18n/ folder and, if not found (during development), falls back to inst/i18n/<lang>.json.

Usage

i18n_load(lang = "tr")

Value

A named list (key -> string) parsed from the JSON file.

Arguments

lang

Character scalar language code. Currently "tr" or "en".

Examples

Run this code
# Always-fast: locate the installed TR dictionary (empty string if not installed)
system.file("shinyapp", "i18n", "tr.json", package = "examly")

# Safe example that runs only if the file actually exists
p <- system.file("shinyapp", "i18n", "tr.json", package = "examly")
if (nzchar(p) && file.exists(p)) {
  d <- i18n_load("tr")
  i18n_t(d, "ui.title", "Baslik")
}

Run the code above in your browser using DataLab