Description Usage Arguments Value See Also Examples
Wrappers to Sys.getlocale
and Sys.setlocale
for getting and
setting the system locale.
1 2 3 | sys_get_locale(simplify = FALSE, remove_empty_categories = TRUE)
sys_set_locale(..., l = list())
|
simplify |
If |
remove_empty_categories |
if |
... |
Name-value pairs of locale categories to set. |
l |
A list, as an alternative method of passing local categories to set. |
A named list or vector giving the system locale names.
sys_set_locale
invisibly returns the locale settings *before* making
changes (like setwd
and options
do).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | (current_locale <- sys_get_locale())
# Output simplified to character vector
sys_get_locale(simplify = TRUE)
## Not run:
# Not run since it (temporarily) affects system settings
english <- if(is_windows()) "English.United_Kingdom" else
if(is_mac()) "en_GB" else
if(is_linux()) "en_GB.utf8" else
"en"
sys_set_locale(LC_MONETARY = english)
sys_get_locale()
sys_set_locale(l = current_locale) #restore everything
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.