Skip to content

Commit

Permalink
Set LANGUAGE to "C"
Browse files Browse the repository at this point in the history
  • Loading branch information
lionel- committed Oct 28, 2024
1 parent 43d13d5 commit bc448a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# testthat (development version)

* `LANGUAGE` is now set to `"C"` in reprocucible environments (i.e.
`test_that()` blocks) to disable translations. This fixes warnings
about being unable to set the language to `"en"` (#1925).

# testthat 3.2.1

* Fix incorrect format string detected by latest R-devel. Fix thanks to
Expand Down
9 changes: 2 additions & 7 deletions R/local.R
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ local_reproducible_output <- function(width = 80,
unicode = FALSE,
rstudio = FALSE,
hyperlinks = FALSE,
lang = "en",
lang = "C",
.env = parent.frame()) {

if (unicode) {
Expand Down Expand Up @@ -133,12 +133,7 @@ local_reproducible_output <- function(width = 80,
.local_envir = .env
)

if (isTRUE(capabilities("NLS"))) {
suppressWarnings(
withr::local_language(lang, .local_envir = .env)
)
}

withr::local_language(lang, .local_envir = .env)
withr::local_collate("C", .local_envir = .env)
}

Expand Down

0 comments on commit bc448a9

Please sign in to comment.