% 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
}
