Skip to contents

Function that returns the short language code currently set if it is in the list of valid options. If the current language isn't in the list of valid options, the first element of the valid elements is returned.

Usage

gtl_opt_short_language(valid = c("en", "fr"))

Arguments

valid

A vector with valid language options

Value

A string

Examples

gtl_opt_set_i18n("fr_CH")
gtl_opt_short_language(valid = c("de", "fr"))
#> [1] "fr"

# With the current local not among the valid options
gtl_opt_set_i18n("en_US")
gtl_opt_short_language(valid = c("de", "fr"))
#> [1] "de"