set_language | R Documentation |
Changes the value of the LANGUAGE
environment variable.
Returns the value of the LANGUAGE
environment variable before it
was changed.
This allows you to use the following structure to temporarily change
the language:
old_language <- set_language("es") on.exit(set_language(old_language))
set_language(language)
language |
A language code. Codes should should be two or three lowercase letters representing the
language, optionally followed by an underscore and two uppercase letters
representing a territory.
For example, If a territory is specified but there is no specific translation for that
territory, translations fall back to the general language.
For example, if there are no specific translations for Canadian French,
If a language is specified but there is no translation for that language, translations generally fall back to English. If |
Returns the pre-existing value of the LANGUAGE
environment variable
# Change language to Korean
set_language("ko")
# Change language to Mexican Spanish, which may fall back to "es"
set_language("es_MX")
# Temporarily set the language to Cantonese
old_language <- set_language("yue")
set_language(old_language)
# Change to an invalid language, which generally falls back to English
set_language("zxx")
# Unset the language environment variable
set_language(NULL)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.