Skip to content

Commit

Permalink
Update utils_formatters.R
Browse files Browse the repository at this point in the history
  • Loading branch information
rich-iannone committed Jul 17, 2023
1 parent 73a3b63 commit e11588e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions R/utils_formatters.R
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,23 @@ get_locale_num_spellout <- function(locale = NULL) {
spelled_num[[locale]]
}

#' Get the `no_table_data_text` value based on a locale
#'
#' @param locale The user-supplied `locale` value, found in several `fmt_*()`
#' functions. This is expected as `NULL` if not supplied by the user.
#' @noRd
get_locale_no_table_data_text <- function(locale = NULL) {

# If `locale` is NULL then use the 'en' locale
if (is.null(locale)) {
locale <- "en"
}

# Get the correct `no_table_data_text` value from the
# `gt:::locales` lookup table
filter_table_to_value(locales, no_table_data_text, locale == {{ locale }})
}

get_locale_segments <- function(locale) {

if (!grepl("-", locale)) {
Expand Down

0 comments on commit e11588e

Please sign in to comment.