File: stri_locale_set.Rd

package info (click to toggle)
r-cran-stringi 1.7.12-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 39,772 kB
  • sloc: cpp: 482,349; ansic: 51,900; perl: 471; makefile: 9; sh: 1
file content (62 lines) | stat: -rw-r--r-- 1,975 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/locale_management.R
\name{stri_locale_set}
\alias{stri_locale_set}
\alias{stri_locale_get}
\title{Set or Get Default Locale in \pkg{stringi}}
\usage{
stri_locale_set(locale)

stri_locale_get()
}
\arguments{
\item{locale}{single string of the form \code{Language},
\code{Language_Country}, or \code{Language_Country_Variant}, e.g.,
\code{'en_US'}, see \code{\link{stri_locale_list}}.}
}
\value{
\code{stri_locale_set} returns a string with
previously used locale, invisibly.

\code{stri_locale_get} returns a string of the form \code{Language},
\code{Language_Country}, or \code{Language_Country_Variant},
e.g., \code{'en_US'}.
}
\description{
\code{stri_locale_set} changes the default locale for all the functions
in the \pkg{stringi} package,
i.e., establishes the meaning of the ``\code{NULL} locale'' argument
of locale-sensitive functions.
\code{stri_locale_get}
gives the current default locale.
}
\details{
See \link{stringi-locale} for more information on the effect of
changing the default locale.

\code{stri_locale_get} is the same as \code{\link{stri_locale_info}(NULL)$Name}.
}
\examples{
\dontrun{
oldloc <- stri_locale_set('pt_BR')
# ... some locale-dependent operations
# ... note that you may always modify a locale per-call
# ... changing the default locale is convenient if you perform
# ... many operations
stri_locale_set(oldloc) # restore the previous default locale
}
}
\seealso{
The official online manual of \pkg{stringi} at \url{https://stringi.gagolewski.com/}

Gagolewski M., \pkg{stringi}: Fast and portable character string processing in R, \emph{Journal of Statistical Software} 103(2), 2022, 1-59, \doi{10.18637/jss.v103.i02}

Other locale_management: 
\code{\link{about_locale}},
\code{\link{stri_locale_info}()},
\code{\link{stri_locale_list}()}
}
\concept{locale_management}
\author{
\href{https://www.gagolewski.com/}{Marek Gagolewski} and other contributors
}