create_text_getter: Create a get_text() Function

View source: R/get_text.R

create_text_getterR Documentation

Create a get_text() Function

Description

Create a get_text() Function

Usage

create_text_getter(raw_strings = NULL, FUN = NULL)

Arguments

raw_strings

list of string definitions (key = value) pairs

FUN

function to be called to get the string definitions

Value

a function that can be used to lookup the string constant(s)

Examples

get_text <- create_text_getter(
  list(hello_en = "good morning", hello_de = "sch<oe>ne Gr<ue><ss>e")
)

get_text("hello_en")
get_text("hello_de")
#get_text("no_such_key") # error with clear error message


KWB-R/kwb.prep documentation built on June 11, 2022, 1:29 p.m.