Skip to contents

hc_set_language() sets the highcharter.lang option for charts created afterwards in the current R process. hc_language() builds a language list with the same arguments and leaves the current option unchanged.

Usage

hc_language(locale = "en", ...)

hc_set_language(locale, ...)

Arguments

locale

Use a language code: "en" (English), "es" (Spanish), "pt" (Portuguese), "fr" (French), "nb" (Norwegian Bokmål), "ja" (Japanese), "ko" (Korean), or "zh-CN" (Simplified Chinese). A region is optional: "es-MX" uses the same Spanish labels as "es" with Mexican date and number formatting. Other languages use English labels and their own formatting.

...

Named Highcharts lang options to override, including nested lists such as exportData = list(categoryHeader = "Product").

Value

hc_language() returns a Highcharts lang list. hc_set_language() invisibly returns the previous option.

Details

The Spanish and Portuguese presets cover common chart controls, downloads, Stock range selection and basic accessibility labels. Highcharts supplies the English defaults and the French, Norwegian Bokmål and Simplified Chinese language packs. Japanese and Korean interface labels are AI-generated translations maintained in highcharter, not official Highcharts translations. Untranslated controls fall back to English. Dates use the browser's built-in Intl formatting via lang.locale; those date translations are not generated by AI. Chart titles and series names are supplied by the author and are not translated. Traditional Chinese locales currently use English interface labels. See https://www.highcharts.com/docs/advanced-chart-features/internationalization.

Examples

hc_language("es-CL")$locale
#> [1] "es-CL"
old <- hc_set_language("es-CL")
hchart(AirPassengers) |> hc_exporting(enabled = TRUE)
options(old)