Skip to content

Commit bc448a9

Browse files
committed
Set LANGUAGE to "C"
1 parent 43d13d5 commit bc448a9

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# testthat (development version)
22

3+
* `LANGUAGE` is now set to `"C"` in reprocucible environments (i.e.
4+
`test_that()` blocks) to disable translations. This fixes warnings
5+
about being unable to set the language to `"en"` (#1925).
6+
37
# testthat 3.2.1
48

59
* Fix incorrect format string detected by latest R-devel. Fix thanks to

R/local.R

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ local_reproducible_output <- function(width = 80,
9898
unicode = FALSE,
9999
rstudio = FALSE,
100100
hyperlinks = FALSE,
101-
lang = "en",
101+
lang = "C",
102102
.env = parent.frame()) {
103103

104104
if (unicode) {
@@ -133,12 +133,7 @@ local_reproducible_output <- function(width = 80,
133133
.local_envir = .env
134134
)
135135

136-
if (isTRUE(capabilities("NLS"))) {
137-
suppressWarnings(
138-
withr::local_language(lang, .local_envir = .env)
139-
)
140-
}
141-
136+
withr::local_language(lang, .local_envir = .env)
142137
withr::local_collate("C", .local_envir = .env)
143138
}
144139

0 commit comments

Comments
 (0)