Skip to content

Commit

Permalink
consistency (*same* string) for translation
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.r-project.org/R/trunk@87510 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information
maechler committed Jan 2, 2025
1 parent 933aa97 commit e6452c4
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
3 changes: 1 addition & 2 deletions src/library/base/R/files.R
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,7 @@ system.file <- function(..., package = "base", lib.loc = NULL, mustWork = FALSE)
{
if(nargs() == 0L)
return(file.path(.Library, "base"))
if(length(package) != 1L)
stop("'package' must be of length 1")
if (length(package) != 1L) stop(gettextf("'%s' must be of length 1", "package"), domain=NA)
packagePath <- find.package(package, lib.loc, quiet = TRUE)
ans <- if(length(packagePath)) {
FILES <- file.path(packagePath, ...)
Expand Down
4 changes: 2 additions & 2 deletions src/library/base/R/library.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# File src/library/base/R/library.R
# Part of the R package, https://www.R-project.org
#
# Copyright (C) 1995-2024 The R Core Team
# Copyright (C) 1995-2025 The R Core Team
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -281,7 +281,7 @@ function(package, help, pos = 2, lib.loc = NULL, character.only = FALSE,
if(!character.only)
package <- as.character(substitute(package))
if(length(package) != 1L)
stop("'package' must be of length 1")
stop(gettextf("'%s' must be of length 1", "package"), domain=NA)
if(is.na(package) || (package == ""))
stop("invalid package name")

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

## handle each element of arg separately
Expand Down
10 changes: 5 additions & 5 deletions src/library/base/R/seq.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# File src/library/base/R/seq.R
# Part of the R package, https://www.R-project.org
#
# Copyright (C) 1995-2021 The R Core Team
# Copyright (C) 1995-2025 The R Core Team
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -37,7 +37,7 @@ seq.default <-
}
else if(!missing(length.out)) {
len <- length(length.out)
if(!len) stop("argument 'length.out' must be of length 1")
if(!len) stop(gettextf("'%s' must be of length 1", "length.out"), domain=NA)
if(len > 1L) {
warning("first element used of 'length.out' argument")
length.out <- length.out[1L]
Expand All @@ -46,8 +46,8 @@ seq.default <-
length.out <- as.numeric(ceiling(length.out))
}
chkDots(...)
if (!missing(from) && length(from) != 1L) stop("'from' must be of length 1")
if (!missing(to) && length(to) != 1L) stop("'to' must be of length 1")
if (!missing(from) && length(from) != 1L) stop(gettextf("'%s' must be of length 1", "from"), domain=NA)
if (!missing( to ) && length( to ) != 1L) stop(gettextf("'%s' must be of length 1", "to" ), domain=NA)
if (!missing(from) && # For seq("2","5") but not breaking seq(to=1, from=as.Date(.)):
!is.finite(if(is.character(from)) from <- as.numeric(from) else from))
stop("'from' must be a finite number")
Expand All @@ -61,7 +61,7 @@ seq.default <-
int <- is.logint(from) && is.logint(to)
del <- to - if(int) as.double(from) else from
if(del == 0 && to == 0) return(to)
if (length(by) != 1L) stop("'by' must be of length 1")
if (length(by) != 1L) stop(gettextf("'%s' must be of length 1", "by"), domain=NA)
if(!is.logint(by))
int <- FALSE
else if(!int)
Expand Down
2 changes: 1 addition & 1 deletion src/library/base/R/taskCallback.R
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ function(handlers = list(), registered = FALSE, verbose = FALSE)
remove <- function(which)
{
if (length(which) != 1L)
stop("'which' must be of length 1")
stop(gettextf("'%s' must be of length 1", "which"), domain=NA)
if(is.character(which)) {
tmp <- match(which, names(handlers))
if(is.na(tmp))
Expand Down

0 comments on commit e6452c4

Please sign in to comment.