File: with_language.Rd

package info (click to toggle)
r-cran-withr 3.0.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 620 kB
  • sloc: sh: 13; makefile: 2
file content (30 lines) | stat: -rw-r--r-- 982 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/language.R
\name{with_language}
\alias{with_language}
\alias{local_language}
\title{Language}
\usage{
with_language(lang, code)

local_language(lang, .local_envir = parent.frame())
}
\arguments{
\item{lang}{A BCP47 language code like "en" (English), "fr" (French),
"fr_CA" (French Canadian). Formally, this is a lower case two letter
\href{https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes}{ISO 639 country code},
optionally followed by "_" or "-" and an upper case two letter
\href{https://en.wikipedia.org/wiki/ISO_3166-2}{ISO 3166 region code}.}

\item{code}{\code{[any]}\cr Code to execute in the temporary environment}

\item{.local_envir}{\verb{[environment]}\cr The environment to use for scoping.}
}
\description{
Temporarily change the language used for translations.
}
\examples{
with_language("en", try(mean[[1]]))
with_language("fr", try(mean[[1]]))
with_language("es", try(mean[[1]]))
}