From 687f3a39c603622aea3bc54c3decbb379972b0f3 Mon Sep 17 00:00:00 2001 From: Lionel Henry Date: Tue, 19 Sep 2023 09:31:36 +0200 Subject: [PATCH] Warn with `C.UTF-8` too See these glibc changes: ******************************************************************** commit 2897b231a6b71ee17d47d3d63f1112b2641a476c Author: Bruno Haible Date: Mon Sep 4 15:31:36 2023 +0200 intl: Treat C.UTF-8 locale like C locale (BZ# 16621) The wiki page https://sourceware.org/glibc/wiki/Proposals/C.UTF-8 says that "Setting LC_ALL=C.UTF-8 will ignore LANGUAGE just like it does with LC_ALL=C." This patch implements it. * intl/dcigettext.c (guess_category_value): Treat C. locale like the C locale. Reviewed-by: Florian Weimer ********************************************************************* via ********************************************************************* * debian/patches/any/git-c-utf-8-language.diff: backport support from upstream to treat C. locale like C locale. Closes: #874160. ********************************************************************* --- R/language.R | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/R/language.R b/R/language.R index 55623408..737ee3b9 100644 --- a/R/language.R +++ b/R/language.R @@ -36,8 +36,11 @@ local_language <- function(lang, .local_envir = parent.frame()) { # > (or LC_ALL) to a value other than ā€˜Cā€™, before you can use a language # > priority list through the LANGUAGE variable. # --- https://www.gnu.org/software/gettext/manual/html_node/The-LANGUAGE-variable.html - if (identical(Sys.getenv("LANG"), "C")) { - warning("Changing language has no effect when envvar LANG='C'") + if (Sys.getenv("LANG") %in% c("C", "C.UTF-8")) { + warning(sprintf( + "Changing language has no effect when envvar LANG='%s'", + Sys.getenv("LANG") + )) } local_envvar(LANGUAGE = lang, .local_envir = .local_envir)