i18n_load: Load translation dictionary

View source: R/i18n.R

i18n_loadR Documentation

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")

Arguments

lang

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

Value

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

Examples

# 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")
}

examly documentation built on Nov. 19, 2026, 5:11 p.m.