Skip to content

Commit f77f952

Browse files
committed
only add 'main' locale if it makes sense to
1 parent 568a614 commit f77f952

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

R/layout.R

+4-2
Original file line numberDiff line numberDiff line change
@@ -103,16 +103,18 @@ rangeslider <- function(p, start = NULL, end = NULL, ...) {
103103
#' # remove the plotly logo and collaborate button from modebar
104104
#' config(p, displaylogo = FALSE, collaborate = FALSE)
105105
#'
106-
#' #' # japanese
106+
#' # japanese
107107
#' config(p, locale = "ja")
108-
#' #' # german
108+
#' # german
109109
#' config(p, locale = "de")
110110
#' # swiss-german
111111
#' config(p, locale = "de-CH")
112112
#' # spanish
113113
#' config(p, locale = "es")
114114
#' # french
115115
#' config(p, locale = "fr")
116+
#' # chinese
117+
#' config(p, locale = "zh-CN")
116118
#'
117119

118120
config <- function(p, ..., collaborate = TRUE, cloud = FALSE, locale = NULL) {

R/plotly.R

+3-1
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,9 @@ locale_dependency <- function(locale) {
461461
scripts <- paste0(locale, ".js")
462462
if (grepl("-", locale)) {
463463
locale_main <- strsplit(locale, "-")[[1]][1]
464-
scripts <- c(scripts, paste0(locale_main, ".js"))
464+
if (locale_main %in% locales_all) {
465+
scripts <- c(scripts, paste0(locale_main, ".js"))
466+
}
465467
}
466468

467469
htmltools::htmlDependency(

man/config.Rd

+4-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)