From c8eb768c7e6a35a1bea51157a150cc7b5836980b Mon Sep 17 00:00:00 2001 From: olivroy Date: Thu, 9 May 2024 08:01:02 -0400 Subject: [PATCH] Set language to english --- NEWS.md | 2 +- R/rd-eval.R | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 2d1ac342..adbd3eb3 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,6 @@ # roxygen2 (development version) -* `@includeRmd` now additionally sets `options(cli.hyperlink = FALSE)` to make +* `@includeRmd` now additionally sets `options(cli.hyperlink = FALSE)` and language = English to make code run in included `.Rmd`s even more consistent across sessions (#1620). # roxygen2 7.3.1 diff --git a/R/rd-eval.R b/R/rd-eval.R index c902df3b..a333fac6 100644 --- a/R/rd-eval.R +++ b/R/rd-eval.R @@ -23,5 +23,9 @@ local_reproducible_output <- function(.envir = parent.frame()) { .local_envir = .envir ) withr::local_envvar(RSTUDIO = NA, .local_envir = .envir) + if (isTRUE(capabilities("NLS")) && Sys.getenv("LANG") != + "C") { + withr::local_language("en", .local_envir = .envir) + } withr::local_collate("C", .local_envir = .envir) }