Skip to content

Commit 9b5f7a7

Browse files
committed
Long path help msg in non-en locales
The error string is different in this case. Improves #84.
1 parent deebb19 commit 9b5f7a7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

R/install.R

+7-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ safe_build_package <- function(pkgdir, build_opts, dest_path, quiet, use_pkgbuil
115115

116116
msg_for_long_paths <- function(output) {
117117
if (sys_type() == "windows" &&
118-
any(grepl("over-long path length", output$stderr))) {
118+
(r_error_matches("over-long path", output$stderr) ||
119+
r_error_matches("over-long path length", output$stderr))) {
119120
message(
120121
"\nIt seems that this package contains files with very long paths.\n",
121122
"This is not supported on most Windows versions. Please contact the\n",
@@ -124,6 +125,11 @@ msg_for_long_paths <- function(output) {
124125
}
125126
}
126127

128+
r_error_matches <- function(msg, str) {
129+
any(grepl(msg, str)) ||
130+
any(grepl(gettext(msg, domain = "R"), str))
131+
}
132+
127133
#' Install package dependencies if needed.
128134
#'
129135
#' @inheritParams package_deps

0 commit comments

Comments
 (0)