HenrikBengtsson / parallelly

R package: parallelly - Enhancing the 'parallel' Package
https://parallelly.futureverse.org
128 stars 7 forks source link

I18N: potools issues #69

Closed HenrikBengtsson closed 2 years ago

HenrikBengtsson commented 2 years ago
> potools::translate_package()
Found 17 R messaging calls that might be better suited for gettextf for ease of translation:

Problematic call:
warning("Failed to parse 'SLURM_JOB_CPUS_PER_NODE' or 'SLURM_TASKS_PER_NODE': ", sQuote(nodecounts))
< File:availableWorkers.R, Line:206 >
Potential replacement:
warning(domain=NA, gettextf("Failed to parse 'SLURM_JOB_CPUS_PER_NODE' or 'SLURM_TASKS_PER_NODE': %s", sQuote(nodecounts)))

Problematic call:
warning("Failed to parse Slurm node counts specification: ", nodecounts)
< File:availableWorkers.R, Line:561 >
Potential replacement:
warning(domain=NA, gettextf("Failed to parse Slurm node counts specification: %s", nodecounts))

Problematic call:
stop("When numeric, argument 'workers' must be a single value: ", length(workers))
< File:makeClusterMPI.R, Line:46 >
Potential replacement:
stop(domain=NA, gettextf("When numeric, argument 'workers' must be a single value: %s", length(workers)))

Problematic call:
stop("Number of 'workers' must be one or greater: ", workers)
< File:makeClusterMPI.R, Line:50 >
Potential replacement:
stop(domain=NA, gettextf("Number of 'workers' must be one or greater: %s", workers))

Problematic call:
stop("Argument 'workers' must be an integer: ", mode(workers))
< File:makeClusterMPI.R, Line:53 >
Potential replacement:
stop(domain=NA, gettextf("Argument 'workers' must be an integer: %s", mode(workers)))

Problematic call:
stop("Syntax error in argument 'rscript_startup': ", conditionMessage(ex))
< File:makeClusterPSOCK.R, Line:798 >
Potential replacement:
stop(domain=NA, gettextf("Syntax error in argument 'rscript_startup': %s", conditionMessage(ex)))

Problematic call:
warning("Did not pass down non-set environment variables to cluster node: ", paste(sQuote(unset), collapse = ", "))
< File:makeClusterPSOCK.R, Line:899 >
Potential replacement:
warning(domain=NA, gettextf("Did not pass down non-set environment variables to cluster node: %s", paste(sQuote(unset), collapse = ", ")))

Problematic call:
stop("Argument 'rscript_envs' appears to contain invalid values: ", paste(sprintf("%s=%s", sQuote(names), sQuote(rscript_envs)), collapse = ", "))
< File:makeClusterPSOCK.R, Line:913 >
Potential replacement:
stop(domain=NA, gettextf("Argument 'rscript_envs' appears to contain invalid values: %s", paste(sprintf("%s=%s", sQuote(names), sQuote(rscript_envs)), collapse = ", ")))

Problematic call:
stop("Argument 'rscript_libs' appears to contain invalid values: ", paste(sQuote(rscript_libs), collapse = ", "))
< File:makeClusterPSOCK.R, Line:927 >
Potential replacement:
stop(domain=NA, gettextf("Argument 'rscript_libs' appears to contain invalid values: %s", paste(sQuote(rscript_libs), collapse = ", ")))

Problematic call:
stop("Unknown 'rshcmd' type: ", sQuote(name))
< File:makeClusterPSOCK.R, Line:1456 >
Potential replacement:
stop(domain=NA, gettextf("Unknown 'rshcmd' type: %s", sQuote(name)))

Problematic call:
message("Testing if worker's PID can be inferred: ", sQuote(test_cmd))
< File:makeClusterPSOCK.R, Line:1580 >
Potential replacement:
message(domain=NA, gettextf("Testing if worker's PID can be inferred: %s", sQuote(test_cmd)))

Problematic call:
message("- Possible to infer worker's PID: ", .cache[[key]])
< File:makeClusterPSOCK.R, Line:1595 >
Potential replacement:
message(domain=NA, gettextf("- Possible to infer worker's PID: %s", .cache[[key]]))

Problematic call:
message(" - pid: ", pid)
< File:makeClusterPSOCK.R, Line:1628 >
Potential replacement:
message(domain=NA, gettextf(" - pid: %s", pid))

Problematic call:
warning("Will use a random port because environment variable 'R_PARALLEL_PORT' coerced to NA_integer_: ", sQuote(Sys.getenv("R_PARALLEL_PORT")))
< File:ports.R, Line:42 >
Potential replacement:
warning(domain=NA, gettextf("Will use a random port because environment variable 'R_PARALLEL_PORT' coerced to NA_integer_: %s", sQuote(Sys.getenv("R_PARALLEL_PORT"))))

Problematic call:
stop("Invalid port: ", port)
< File:ports.R, Line:121 >
Potential replacement:
stop(domain=NA, gettextf("Invalid port: %s", port))

Problematic call:
warning("Value of environment variable 'R_PARALLELLY_RANDOM_PORTS' coerced to NA_integer_: ", sQuote(random))
< File:ports.R, Line:140 >
Potential replacement:
warning(domain=NA, gettextf("Value of environment variable 'R_PARALLELLY_RANDOM_PORTS' coerced to NA_integer_: %s", sQuote(random)))

Problematic call:
warning("Value of environment variable 'R_PARALLELLY_RANDOM_PORTS' does not specify ports in [0,65535]: ", sQuote(random))
< File:ports.R, Line:144 >
Potential replacement:
warning(domain=NA, gettextf("Value of environment variable 'R_PARALLELLY_RANDOM_PORTS' does not specify ports in [0,65535]: %s", sQuote(random)))
Exit now to repair any of these? [y/N]