loadMsg {stranslate}R Documentation

loadMsg

Description

Loads translated messages from one (or more) file into package environment. For details read the vignette vignette("stranslate").

Usage

loadMsg(
  files,
  .domain = getOption("stranslate.domain"),
  .lang = "en",
  .silent = TRUE,
  .overwrite = FALSE
)

Arguments

files

character: names of text file(s) with translated messages

.domain

character: domain namesd (default: getOption("stranslate.domain"))

.lang

character: default language (default: 'en')

.silent

logical: should outputs be displayed during the loading process and then listMsg() be called?

.overwrite

logical: should keys be overwritten (default: FALSE)

Value

invisibly the current message environment

Examples

# note "messages/messages.txt" contains only english and german ;)
loadMsg(system.file("messages/messages.txt", package="stranslate"), .overwrite=TRUE) # avoid warning
# english
getMsg(ROUND=0, .lang="en")
getMsg(ROUND=1, .lang="en")
getMsg(ROUND=2, .lang="en")
# english
getMsg(ROUND=0, .lang="de")
getMsg(ROUND=1, .lang="de")
getMsg(ROUND=2, .lang="de")
# default language or if not available then english 
getMsg(ROUND=0)
getMsg(ROUND=1)
getMsg(ROUND=2)

[Package stranslate version 0.1.3 Index]