Create a new translator object
i18n(resources, ..., options = NULL)
Path to a json file containing translation
resources. If given in this way, then on-demand translation
loading (via resource_pattern
) is disabled unless a
currently unexposed i18next option is used.
Named options passed to traduire_options
Options object passed to traduire_options
Note that the argument list here will change. The only part of this that we consider stable is that the first argument will represent a resource bundle.
path <- system.file("examples/simple.json", package = "traduire")
obj <- traduire::i18n(path)
obj$t("hello", language = "fr")
#> [1] "bonjour le monde"