Skip to content

Commit b6c68c7

Browse files
committed
Make GB English the default
1 parent 8d434f6 commit b6c68c7

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

R/check-files.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#' files <- list.files(system.file("examples", package = "knitr"),
1313
#' pattern = "\\.(Rnw|Rmd|html)$", full.names = TRUE)
1414
#' spell_check_files(files)
15-
spell_check_files <- function(path, ignore = character(), lang = "en_US"){
15+
spell_check_files <- function(path, ignore = character(), lang = "en_GB"){
1616
dict <- hunspell::dictionary(lang, add_words = ignore)
1717
path <- normalizePath(path, mustWork = TRUE)
1818
lines <- lapply(sort(path), spell_check_file_one, dict = dict)
@@ -36,7 +36,7 @@ spell_check_file_one <- function(path, dict){
3636
#' @rdname spell_check_files
3737
#' @export
3838
#' @param text character vector with plain text
39-
spell_check_text <- function(text, ignore = character(), lang = "en_US"){
39+
spell_check_text <- function(text, ignore = character(), lang = "en_GB"){
4040
dict <- hunspell::dictionary(lang, add_words = ignore)
4141
bad_words <- hunspell::hunspell(text, dict = dict)
4242
words <- sort(unique(unlist(bad_words)))

R/spell-check.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#' @param lang dictionary string for [hunspell][hunspell::dictionary],
2424
#' usually either `"en_US"` or `"en_GB"`.
2525
#' @param use_wordlist ignore words in the package [WORDLIST][get_wordlist] file
26-
spell_check_package <- function(pkg = ".", vignettes = TRUE, lang = "en_US", use_wordlist = TRUE){
26+
spell_check_package <- function(pkg = ".", vignettes = TRUE, lang = "en_GB", use_wordlist = TRUE){
2727
# Get package info
2828
pkg <- as_package(pkg)
2929

@@ -116,7 +116,7 @@ print.summary_spellcheck <- function(x, ...){
116116
#' @rdname spell_check_package
117117
#' @param error make `R CMD check` fail when spelling errors are found.
118118
#' Default behavior only prints spelling errors to the console at the end of `CMD check`.
119-
spell_check_setup <- function(pkg = ".", vignettes = TRUE, lang = "en_US", error = FALSE){
119+
spell_check_setup <- function(pkg = ".", vignettes = TRUE, lang = "en_GB", error = FALSE){
120120
# Get package info
121121
pkg <- as_package(pkg)
122122
update_wordlist(pkg$path, vignettes = vignettes, lang = lang)
@@ -128,7 +128,7 @@ spell_check_setup <- function(pkg = ".", vignettes = TRUE, lang = "en_US", error
128128
}
129129

130130
#' @export
131-
spell_check_test <- function(vignettes = TRUE, lang = "en_US", error = FALSE){
131+
spell_check_test <- function(vignettes = TRUE, lang = "en_GB", error = FALSE){
132132
out_save <- readLines(system.file("templates/spelling.Rout.save", package = 'spelling'))
133133
code <- paste(">", readLines("spelling.R"), collapse = "\n")
134134
out_save <- sub("@INPUT@", code, out_save, fixed = TRUE)

R/wordlist.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#' @export
1717
#' @param confirm show changes and ask confirmation before adding new words to the list
1818
#' @inheritParams spell_check_package
19-
update_wordlist <- function(pkg = ".", vignettes = TRUE, lang = "en_US", confirm = TRUE){
19+
update_wordlist <- function(pkg = ".", vignettes = TRUE, lang = "en_GB", confirm = TRUE){
2020
pkg <- as_package(pkg)
2121
wordfile <- get_wordfile(pkg$path)
2222
old_words <- sort(get_wordlist(pkg$path))

man/spell_check_files.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/spell_check_package.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/wordlist.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)