Skip to content

Commit e6452c4

Browse files
author
maechler
committed
consistency (*same* string) for translation
git-svn-id: https://svn.r-project.org/R/trunk@87510 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent 933aa97 commit e6452c4

File tree

5 files changed

+11
-12
lines changed

5 files changed

+11
-12
lines changed

src/library/base/R/files.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,7 @@ system.file <- function(..., package = "base", lib.loc = NULL, mustWork = FALSE)
197197
{
198198
if(nargs() == 0L)
199199
return(file.path(.Library, "base"))
200-
if(length(package) != 1L)
201-
stop("'package' must be of length 1")
200+
if (length(package) != 1L) stop(gettextf("'%s' must be of length 1", "package"), domain=NA)
202201
packagePath <- find.package(package, lib.loc, quiet = TRUE)
203202
ans <- if(length(packagePath)) {
204203
FILES <- file.path(packagePath, ...)

src/library/base/R/library.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# File src/library/base/R/library.R
22
# Part of the R package, https://www.R-project.org
33
#
4-
# Copyright (C) 1995-2024 The R Core Team
4+
# Copyright (C) 1995-2025 The R Core Team
55
#
66
# This program is free software; you can redistribute it and/or modify
77
# it under the terms of the GNU General Public License as published by
@@ -281,7 +281,7 @@ function(package, help, pos = 2, lib.loc = NULL, character.only = FALSE,
281281
if(!character.only)
282282
package <- as.character(substitute(package))
283283
if(length(package) != 1L)
284-
stop("'package' must be of length 1")
284+
stop(gettextf("'%s' must be of length 1", "package"), domain=NA)
285285
if(is.na(package) || (package == ""))
286286
stop("invalid package name")
287287

src/library/base/R/match.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# File src/library/base/R/match.R
22
# Part of the R package, https://www.R-project.org
33
#
4-
# Copyright (C) 1995-2023 The R Core Team
4+
# Copyright (C) 1995-2025 The R Core Team
55
#
66
# This program is free software; you can redistribute it and/or modify
77
# it under the terms of the GNU General Public License as published by
@@ -51,7 +51,7 @@ match.arg <- function (arg, choices, several.ok = FALSE)
5151
if (!several.ok) { # most important (default) case:
5252
## the arg can be the whole of choices as a default argument.
5353
if(identical(arg, choices)) return(arg[1L])
54-
if(length(arg) > 1L) stop("'arg' must be of length 1")
54+
if(length(arg) != 1L) stop(gettextf("'%s' must be of length 1", "arg"), domain=NA)
5555
} else if(length(arg) == 0L) stop("'arg' must be of length >= 1")
5656

5757
## handle each element of arg separately

src/library/base/R/seq.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# File src/library/base/R/seq.R
22
# Part of the R package, https://www.R-project.org
33
#
4-
# Copyright (C) 1995-2021 The R Core Team
4+
# Copyright (C) 1995-2025 The R Core Team
55
#
66
# This program is free software; you can redistribute it and/or modify
77
# it under the terms of the GNU General Public License as published by
@@ -37,7 +37,7 @@ seq.default <-
3737
}
3838
else if(!missing(length.out)) {
3939
len <- length(length.out)
40-
if(!len) stop("argument 'length.out' must be of length 1")
40+
if(!len) stop(gettextf("'%s' must be of length 1", "length.out"), domain=NA)
4141
if(len > 1L) {
4242
warning("first element used of 'length.out' argument")
4343
length.out <- length.out[1L]
@@ -46,8 +46,8 @@ seq.default <-
4646
length.out <- as.numeric(ceiling(length.out))
4747
}
4848
chkDots(...)
49-
if (!missing(from) && length(from) != 1L) stop("'from' must be of length 1")
50-
if (!missing(to) && length(to) != 1L) stop("'to' must be of length 1")
49+
if (!missing(from) && length(from) != 1L) stop(gettextf("'%s' must be of length 1", "from"), domain=NA)
50+
if (!missing( to ) && length( to ) != 1L) stop(gettextf("'%s' must be of length 1", "to" ), domain=NA)
5151
if (!missing(from) && # For seq("2","5") but not breaking seq(to=1, from=as.Date(.)):
5252
!is.finite(if(is.character(from)) from <- as.numeric(from) else from))
5353
stop("'from' must be a finite number")
@@ -61,7 +61,7 @@ seq.default <-
6161
int <- is.logint(from) && is.logint(to)
6262
del <- to - if(int) as.double(from) else from
6363
if(del == 0 && to == 0) return(to)
64-
if (length(by) != 1L) stop("'by' must be of length 1")
64+
if (length(by) != 1L) stop(gettextf("'%s' must be of length 1", "by"), domain=NA)
6565
if(!is.logint(by))
6666
int <- FALSE
6767
else if(!int)

src/library/base/R/taskCallback.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ function(handlers = list(), registered = FALSE, verbose = FALSE)
9494
remove <- function(which)
9595
{
9696
if (length(which) != 1L)
97-
stop("'which' must be of length 1")
97+
stop(gettextf("'%s' must be of length 1", "which"), domain=NA)
9898
if(is.character(which)) {
9999
tmp <- match(which, names(handlers))
100100
if(is.na(tmp))

0 commit comments

Comments
 (0)