30 Language support

The locale argument of the config() function allows one to render on-graph text using another language. Figure 30.1 shows how setting locale='ja' will render text in Japanese.

today <- Sys.Date()
x <- seq.Date(today, today + 360, by = "day")
plot_ly(x = x, y = rnorm(length(x))) %>%
  add_lines() %>%
  config(locale = "ja")
Using the locale argument of the config() function to render on-graph text in another language.

FIGURE 30.1: Using the locale argument of the config() function to render on-graph text in another language.

Table 30.1 contains a list of all the supported locale codes and the language they correspond to:

TABLE 30.1: Language support in plotly. To use one of these languages, supply the locale code to the locale argument in the config() function.