Debian Codegraph @

man/with_language.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/language.R
3 \name{with_language}
4 \alias{with_language}
5 \alias{local_language}
6 \title{Language}
7 \usage{
8 with_language(lang, code)
9
10 local_language(lang, .local_envir = parent.frame())
11 }
12 \arguments{
13 \item{lang}{A BCP47 language code like "en" (English), "fr" (French),
14 "fr_CA" (French Canadian). Formally, this is a lower case two letter
15 \href{https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes}{ISO 639 country code},
16 optionally followed by "_" or "-" and an upper case two letter
17 \href{https://en.wikipedia.org/wiki/ISO_3166-2}{ISO 3166 region code}.}
18
19 \item{code}{\code{[any]}\cr Code to execute in the temporary environment}
20
21 \item{.local_envir}{\verb{[environment]}\cr The environment to use for scoping.}
22 }
23 \description{
24 Temporarily change the language used for translations.
25 }
26 \examples{
27 with_language("en", try(mean[[1]]))
28 with_language("fr", try(mean[[1]]))
29 with_language("es", try(mean[[1]]))
30 }