From 4f7f5674ece03c5a2a77b91213ca75ff9ce0b78b Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Tue, 4 Feb 2025 10:25:48 -0800 Subject: [PATCH] Fix up procedure for extracting strings to .pot, and add newly-found messages (#6793) * update .pot again * Update CRAN_Release procedure * Add 'notranslate' in R files, add a mark new strings for translation * More R-side notranslate * Mark many src* strings for non-translation * Caught a few more untranslated messages * sloppy find-and-replace * Un-translate internal error * oops, this is C * nocov hard-to-cover regions * Double-Pl_ for row(s), thread(s) * Make the full message plural for better translator context * Superfluous ')' * rm ws --- .dev/CRAN_Release.cmd | 24 ++- R/between.R | 2 +- R/bmerge.R | 2 +- R/data.table.R | 10 +- R/print.data.table.R | 4 +- R/test.data.table.R | 21 +- po/R-data.table.pot | 478 ++++++++++++++++++++++++++++++++++++++++-- po/data.table.pot | 145 ++++++++++--- src/assign.c | 6 +- src/bmerge.c | 4 +- src/dogroups.c | 10 +- src/fmelt.c | 6 +- src/forder.c | 44 ++-- src/fread.c | 22 +- src/freadR.c | 12 +- src/fwrite.c | 21 +- src/nafill.c | 4 +- src/negate.c | 2 +- src/rbindlist.c | 10 +- src/snprintf.c | 20 +- src/subset.c | 2 +- src/types.c | 10 +- src/utils.c | 2 +- src/wrappers.c | 2 +- 24 files changed, 714 insertions(+), 149 deletions(-) diff --git a/.dev/CRAN_Release.cmd b/.dev/CRAN_Release.cmd index d85b5b047..84101e40e 100644 --- a/.dev/CRAN_Release.cmd +++ b/.dev/CRAN_Release.cmd @@ -3,17 +3,19 @@ ############################################### # 1) Update messages for new release -## (a) Update C template file: src/data.table.pot -## ideally, we are including _() wrapping in -## new PRs throughout dev cycle, and this step -## becomes about tying up loose ends -## Check the output here for translatable messages -xgettext -o /dev/stdout ./*.c \ - --keyword=Rprintf --keyword=error --keyword=warning --keyword=STOP --keyword=DTWARN --keyword=Error --keyword=DTPRINT --keyword=snprintf:3 - -## (b) Update R template file: src/R-data.table.pot -## NB: this relies on R >= 4.0 to remove a bug in update_pkg_po -Rscript -e "tools::update_pkg_po('.')" +dt_custom_translators = list( + R = 'catf:fmt|1', + # TODO(MichaelChirico/potools#318): restore snprintf:3 here too + src = c('STOP:1', 'DTWARN:1', 'DTPRINT:1') +) +message_db = + potools::get_message_data(custom_translation_functions = dt_custom_translators) +potools::check_cracked_messages(message_db) +potools::check_untranslated_cat(message_db) +potools::check_untranslated_src(message_db) + +## (b) Update R template files (po/*.pot) +potools::po_extract(custom_translation_functions = dt_custom_translators) # 2) Open a PR with the new templates & contact the translators # * zh_CN: @hongyuanjia diff --git a/R/between.R b/R/between.R index 0aed2a150..e35459f0d 100644 --- a/R/between.R +++ b/R/between.R @@ -75,7 +75,7 @@ inrange = function(x,lower,upper,incbounds=TRUE) { ops = if (incbounds) c(4L, 2L) else c(5L, 3L) # >=,<= and >,< verbose = isTRUE(getOption("datatable.verbose")) if (verbose) {last.started.at=proc.time();catf("forderv(query) took ... ");flush.console()} - if (verbose) {cat(timetaken(last.started.at),"\n"); flush.console()} + if (verbose) {cat(timetaken(last.started.at),"\n"); flush.console()} # notranslate ans = bmerge( shallow(subject), query, icols=1L:2L, xcols=c(1L, 1L), diff --git a/R/bmerge.R b/R/bmerge.R index fbf15f14f..dffca5e44 100644 --- a/R/bmerge.R +++ b/R/bmerge.R @@ -188,7 +188,7 @@ bmerge = function(i, x, icols, xcols, roll, rollends, nomatch, mult, ops, verbos if (verbose) {last.started.at=proc.time();catf(" forder took ... ");flush.console()} # TODO: could check/reuse secondary indices, but we need 'starts' attribute as well! xo = forderv(x, xcols, retGrp=TRUE) - if (verbose) {cat(timetaken(last.started.at),"\n"); flush.console()} + if (verbose) {cat(timetaken(last.started.at),"\n"); flush.console()} # notranslate xg = attr(xo, 'starts', exact=TRUE) resetcols = head(xcols, non_equi-1L) if (length(resetcols)) { diff --git a/R/data.table.R b/R/data.table.R index eeb9a1ca2..81ebd014c 100644 --- a/R/data.table.R +++ b/R/data.table.R @@ -577,7 +577,7 @@ replace_dot_alias = function(e) { } else { irows = as.integer(fsort(as.numeric(irows))) ## nocov; parallelized for numeric, but overhead of type conversion } - if (verbose) {cat(timetaken(last.started.at), "\n");flush.console()} + if (verbose) {cat(timetaken(last.started.at), "\n");flush.console()} # notranslate } ## make sure, all columns are taken from x and not from i. ## This is done by simply telling data.table to continue as if there was a simple subset @@ -634,7 +634,7 @@ replace_dot_alias = function(e) { irows = irows[irows!=0L] if (verbose) {last.started.at=proc.time();catf("Inverting irows for notjoin done in ... ");flush.console()} i = irows = if (length(irows)) seq_len(nrow(x))[-irows] else NULL # NULL meaning all rows i.e. seq_len(nrow(x)) - if (verbose) cat(timetaken(last.started.at), "\n") + if (verbose) cat(timetaken(last.started.at), "\n") # notranslate leftcols = integer() # proceed as if row subset from now on, length(leftcols) is switched on later rightcols = integer() # Doing this once here, helps speed later when repeatedly subsetting each column. R's [irows] would do this for each @@ -892,8 +892,10 @@ replace_dot_alias = function(e) { } tt = lengths(byval) if (any(tt!=xnrow)) { - plural_part <- sprintf(ngettext(length(tt), "The item in the 'by' or 'keyby' list is length %s.", "The items in the 'by' or 'keyby' list have lengths %s."), brackify(tt)) - stopf("%s Each must be length %d; the same length as there are rows in x (after subsetting if i is provided).", plural_part, xnrow) + stopf(ngettext(length(tt), + "The item in the 'by' or 'keyby' list is length %s. Each must be length %d; the same length as there are rows in x (after subsetting if i is provided).", + "The items in the 'by' or 'keyby' list have lengths %s. Each must be length %d; the same length as there are rows in x (after subsetting if i is provided)."), + brackify(tt), xnrow, domain=NA) } if (is.null(bynames)) bynames = rep.int("",length(byval)) if (length(idx <- which(!nzchar(bynames))) && !bynull) { diff --git a/R/print.data.table.R b/R/print.data.table.R index a75b96004..ad99fbaab 100644 --- a/R/print.data.table.R +++ b/R/print.data.table.R @@ -57,8 +57,8 @@ print.data.table = function(x, topn=getOption("datatable.print.topn"), catf("Null data.%s (0 rows and 0 cols)\n", class) # See FAQ 2.5 and NEWS item in v1.8.9 } else { catf("Empty data.%s (%d rows and %d cols)", class, NROW(x), NCOL(x)) - if (length(x)>0L) cat(": ",paste(head(names(x),6L),collapse=","),if(length(x)>6L)"...",sep="") - cat("\n") + if (length(x)>0L) cat(": ",paste(head(names(x),6L),collapse=","),if(length(x)>6L)"...",sep="") # notranslate + cat("\n") # notranslate } return(invisible(x)) } diff --git a/R/test.data.table.R b/R/test.data.table.R index 14fe7f3d9..1f3b8ebfe 100644 --- a/R/test.data.table.R +++ b/R/test.data.table.R @@ -39,7 +39,7 @@ test.data.table = function(script="tests.Rraw", verbose=FALSE, pkg=".", silent=F scripts = gsub("[.]bz2$","",scripts) return(sapply(scripts, function(fn) { err = try(test.data.table(script=fn, verbose=verbose, pkg=pkg, silent=silent, showProgress=showProgress, testPattern=testPattern)) - cat("\n"); + cat("\n"); # notranslate isTRUE(err) })) # nocov end @@ -110,7 +110,7 @@ test.data.table = function(script="tests.Rraw", verbose=FALSE, pkg=".", silent=F datatable.old.fread.datetime.character = FALSE ) - cat("getDTthreads(verbose=TRUE):\n") # for tracing on CRAN; output to log before anything is attempted + cat("getDTthreads(verbose=TRUE):\n") # notranslate: for tracing on CRAN; output to log before anything is attempted getDTthreads(verbose=TRUE) # includes the returned value in the verbose output (rather than dangling '[1] 4'); e.g. "data.table is using 4 threads" catf("test.data.table() running: %s\n", fn) # print fn to log before attempting anything on it (in case it is missing); on same line for slightly easier grep assign("testDir", function(x) file.path(fulldir, x), envir=env) @@ -226,6 +226,7 @@ test.data.table = function(script="tests.Rraw", verbose=FALSE, pkg=".", silent=F # does show the full file output these days, so the 13 line limit no longer bites so much. It still bit recently # when receiving output of R CMD check sent over email, though. tz = Sys.getenv("TZ", unset=NA) + # notranslate start cat("\n", date(), # so we can tell exactly when these tests ran on CRAN to double-check the result is up to date " endian==", .Platform$endian, ", sizeof(long double)==", .Machine$sizeof.longdouble, @@ -239,6 +240,7 @@ test.data.table = function(script="tests.Rraw", verbose=FALSE, pkg=".", silent=F ", .libPaths()==", paste0("'", .libPaths(), "'", collapse = ","), ", ", .Call(Cdt_zlib_version), "\n", sep="") + # notranslate end if (inherits(err,"try-error")) { # nocov start @@ -303,7 +305,7 @@ compactprint = function(DT, topn=2L) { print(copy(DT)[,(cn):="",verbose=FALSE], topn=topn, class=FALSE) } else { print(DT, class=FALSE) # "Empty data.table (0 rows) of columns ... - if (ncol(DT)) cat(cn,"\n") + if (ncol(DT)) cat(cn,"\n") # notranslate } invisible() } @@ -376,14 +378,15 @@ test = function(num,x,y=TRUE,error=NULL,warning=NULL,message=NULL,output=NULL,no if (memtest==1L) gc() # see #5515 for before/after inum = as.integer(num) timings[inum, RSS:=max(rss(),RSS), verbose=FALSE] # TODO prefix inum with .. for clarity when that works - if (length(memtest.id) && memtest.id[1L]<=inum && inum<=memtest.id[2L]) cat(rss(),"\n") # after 'testing id ...' output; not using between() as it has verbose output when getOption(datatable.verbose) + if (length(memtest.id) && memtest.id[1L]<=inum && inum<=memtest.id[2L]) cat(rss(),"\n") # notranslate. after 'testing id ...' output; not using between() as it has verbose output when getOption(datatable.verbose) if (memtest==2L) gc() } assign("lasttime", proc.time()[3L], parent.frame(), inherits=TRUE) # after gc() to exclude gc() time from next test when memtest }, add=TRUE ) - if (showProgress) - # \r can't be in gettextf msg - cat("\rRunning test id", numStr, " ") # nocov. + if (showProgress) { + cat("\r") # notranslate: \r can't be in gettextf msg + catf("Running test id", numStr, " ") # nocov. + } # See PR #4090 for comments about change here in Dec 2019. # If a segfault error occurs in future and we'd like to know after which test, then arrange for the # try(sys.source()) in test.data.table() to be run in a separate R process. That process could write out @@ -534,7 +537,7 @@ test = function(num,x,y=TRUE,error=NULL,warning=NULL,message=NULL,output=NULL,no if (!fail) { catf("Test %s ran without errors but failed check that x equals y:\n", numStr) failPrint = function(x, xsub) { - cat(">", substitute(x), "=", xsub, "\n") + cat(">", substitute(x), "=", xsub, "\n") # notranslate if (is.data.table(x)) compactprint(x) else { nn = length(x) catf("First %d of %d (type '%s'): \n", min(nn, 6L), length(x), typeof(x)) @@ -542,7 +545,7 @@ test = function(num,x,y=TRUE,error=NULL,warning=NULL,message=NULL,output=NULL,no if (length(d <- dim(x))) do.call(`[`, c(list(x, drop = FALSE), lapply(pmin(d, 6L), seq_len))) else print(head(x)) if (typeof(x) == 'character' && anyNonAscii(x)) { - cat("Non-ASCII string detected, raw representation:\n") + catf("Non-ASCII string detected, raw representation:\n") print(lapply(head(x), charToRaw)) } } diff --git a/po/R-data.table.pot b/po/R-data.table.pot index 73ef0b712..6628ffd95 100644 --- a/po/R-data.table.pot +++ b/po/R-data.table.pot @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: data.table 1.16.99\n" -"POT-Creation-Date: 2025-01-29 23:31-0800\n" +"POT-Creation-Date: 2025-02-02 23:58-0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -124,6 +124,12 @@ msgstr "" msgid "trying to use integer64 class when 'bit64' package is not installed" msgstr "" +#: between.R:47 +msgid "" +"optimised between not available for this data type, fallback to slow R " +"routine" +msgstr "" + #: between.R:48 #, c-format msgid "" @@ -147,6 +153,22 @@ msgid "" "lower bound(s); the second element should be the upper bound(s)." msgstr "" +#: between.R:77 +msgid "forderv(query) took ..." +msgstr "" + +#: between.R:90 +msgid "Generating final logical vector ..." +msgstr "" + +#: between.R:92 bmerge.R:200 bmerge.R:204 bmerge.R:211 data.table.R:496 +msgid "done in %s" +msgstr "" + +#: bmerge.R:21 +msgid "Coercing %s column %s%s to type %s to match type of %s%s." +msgstr "" + #: bmerge.R:65 bmerge.R:66 #, c-format msgid "%s is type %s which is not supported by data.table join" @@ -159,6 +181,14 @@ msgid "" "double or character columns may be roll joined." msgstr "" +#: bmerge.R:71 +msgid "Matching %s factor levels to %s factor levels." +msgstr "" + +#: bmerge.R:80 +msgid "Matching character column %s to factor levels in %s." +msgstr "" + #: bmerge.R:87 #, c-format msgid "" @@ -166,6 +196,10 @@ msgid "" "factor or character columns." msgstr "" +#: bmerge.R:91 +msgid "%s has same type (%s) as %s. No coercion needed." +msgstr "" + #: bmerge.R:97 bmerge.R:101 msgid "(all-NA)" msgstr "" @@ -198,16 +232,62 @@ msgstr "" msgid "(for join)" msgstr "" +#: bmerge.R:165 +msgid "on= matches existing key, using key" +msgstr "" + +#: bmerge.R:170 +msgid "on= matches existing index, using index" +msgstr "" + +#: bmerge.R:175 +msgid "Calculated ad hoc index in %s" +msgstr "" + +#: bmerge.R:186 +msgid "Non-equi join operators detected ..." +msgstr "" + #: bmerge.R:187 #, c-format msgid "roll is not implemented for non-equi joins yet." msgstr "" +#: bmerge.R:188 +msgid "forder took ..." +msgstr "" + +#: bmerge.R:197 +msgid "Generating group lengths ..." +msgstr "" + +#: bmerge.R:202 +msgid "Generating non-equi group ids ..." +msgstr "" + #: bmerge.R:207 #, c-format msgid "Column name '_nqgrp_' is reserved for non-equi joins." msgstr "" +#: bmerge.R:208 +msgid "Recomputing forder with non-equi ids ..." +msgstr "" + +#: bmerge.R:217 +msgid "Starting bmerge ..." +msgstr "" + +#: bmerge.R:219 +msgid "bmerge done in %s" +msgstr "" + +#: cedta.R:67 +msgid "" +"cedta decided '%s' wasn't data.table aware. Here is call stack with [[1L]] " +"applied:" +msgstr "" + #: data.table.R:55 #, c-format msgid "key argument of data.table() must be character" @@ -252,6 +332,10 @@ msgstr "" msgid "When by and keyby are both provided, keyby must be TRUE or FALSE" msgstr "" +#: data.table.R:177 data.table.R:242 data.table.R:331 +msgid "Argument '%s' after substitute: %s" +msgstr "" + #: data.table.R:186 #, c-format msgid "" @@ -450,6 +534,30 @@ msgstr "" msgid "Attempting to do natural join but no common columns in provided tables" msgstr "" +#: data.table.R:462 +msgid "Joining but 'x' has no key, natural join using all 'x' columns" +msgstr "" + +#: data.table.R:464 +msgid "Joining but 'x' has no key, natural join using: %s" +msgstr "" + +#: data.table.R:493 +msgid "not-join called with 'by=.EACHI'; Replacing !i with i=setdiff_(x,i) ..." +msgstr "" + +#: data.table.R:523 +msgid "Constructing irows for '!byjoin || nqbyjoin' ..." +msgstr "" + +#: data.table.R:562 +msgid "Reorder irows for 'mult==\"all\" && !allGrp1' ..." +msgstr "" + +#: data.table.R:574 +msgid "Reordering %d rows after bmerge done in ..." +msgstr "" + #: data.table.R:591 #, c-format msgid "logical error. i is not a data.table, but 'on' argument is provided." @@ -476,6 +584,10 @@ msgid "" "(Jan 2019)" msgstr "" +#: data.table.R:635 +msgid "Inverting irows for notjoin done in ..." +msgstr "" + #: data.table.R:691 #, c-format msgid "" @@ -528,6 +640,20 @@ msgstr "" msgid "At least one entry of by is empty" msgstr "" +#: data.table.R:827 +msgid "by index '%s' but that index has 0 length. Ignoring." +msgstr "" + +#: data.table.R:850 +msgid "i clause present and columns used in by detected, only these subset: %s" +msgstr "" + +#: data.table.R:853 +msgid "" +"i clause present but columns used in by not detected. Having to subset all " +"columns before evaluating 'by': '%s'" +msgstr "" + #: data.table.R:875 #, c-format msgid "" @@ -553,11 +679,10 @@ msgid "" "toString), whilst taking care to maintain distinctness in the process." msgstr "" -#: data.table.R:896 -#, c-format +#: data.table.R:916 msgid "" -"%s Each must be length %d; the same length as there are rows in x (after " -"subsetting if i is provided)." +"by-expression '%s' is not named, and the auto-generated name '%s' clashed " +"with variable(s) in j. Therefore assigning the entire by-expression as name." msgstr "" #: data.table.R:950 @@ -622,6 +747,18 @@ msgstr "" msgid "Some items of .SDcols are not column names: %s" msgstr "" +#: data.table.R:1063 +msgid "" +"'(m)get' found in j. ansvars being set to all columns. Use .SDcols or a " +"single j=eval(macro) instead. Both will detect the columns used which is " +"important for efficiency.\n" +"Old ansvars: %s" +msgstr "" + +#: data.table.R:1083 +msgid "New ansvars: %s" +msgstr "" + #: data.table.R:1092 #, c-format msgid "" @@ -629,6 +766,10 @@ msgid "" "data.table." msgstr "" +#: data.table.R:1095 +msgid "Detected that j uses these columns: %s" +msgstr "" + #: data.table.R:1108 #, c-format msgid "" @@ -676,6 +817,12 @@ msgid "" "'numeric')" msgstr "" +#: data.table.R:1175 +msgid "" +"No rows match i. No new columns to add so not evaluating RHS of :=\n" +"Assigning to 0 row subset of %d rows" +msgstr "" + #: data.table.R:1190 #, c-format msgid "" @@ -690,6 +837,23 @@ msgid "" "improved." msgstr "" +#: data.table.R:1198 +msgid "" +"Growing vector of column pointers from truelength %d to %d. A shallow copy " +"has been taken, see ?setalloccol. Only a potential issue if two variables " +"point to the same data (we can't yet detect that well) and if not you can " +"safely ignore this. To avoid this message you could setalloccol() first, " +"deep copy first using copy(), wrap with suppressWarnings() or increase the " +"'datatable.alloccol' option." +msgstr "" + +#: data.table.R:1200 +msgid "" +"Note that the shallow copy will assign to the environment from which := was " +"called. That means for example that if := was called within a function, the " +"original table may be unaffected." +msgstr "" + #: data.table.R:1221 #, c-format msgid "" @@ -727,11 +891,55 @@ msgid "" "variable. Try setnames(DT,'.I','I') first." msgstr "" +#: data.table.R:1486 +msgid "" +"Note: forcing units=\"secs\" on implicit difftime by group; call difftime " +"explicitly to choose custom units" +msgstr "" + #: data.table.R:1495 #, c-format msgid "logical error. i is not a data.table, but mult='all' and 'by'=.EACHI" msgstr "" +#: data.table.R:1522 +msgid "Finding groups using forderv ..." +msgstr "" + +#: data.table.R:1536 data.table.R:1568 +msgid "Finding group sizes from the positions (can be avoided to save RAM) ..." +msgstr "" + +#: data.table.R:1544 +msgid "Getting back original order ..." +msgstr "" + +#: data.table.R:1556 +msgid "Finding groups using uniqlist on key ..." +msgstr "" + +#: data.table.R:1560 +msgid "Finding groups using uniqlist on index '%s' ..." +msgstr "" + +#: data.table.R:1779 +msgid "lapply optimization changed j from '%s' to '%s'" +msgstr "" + +#: data.table.R:1781 +msgid "lapply optimization is on, j unchanged as '%s'" +msgstr "" + +#: data.table.R:1790 data.table.R:1814 +msgid "GForce optimized j to '%s' (see ?GForce)" +msgstr "" + +#: data.table.R:1815 +msgid "" +"GForce is on, but not activated for this query; left j unchanged (see ?" +"GForce)" +msgstr "" + #: data.table.R:1834 #, c-format msgid "" @@ -740,6 +948,30 @@ msgid "" "'trim' which is the 2nd argument of mean. 'trim' is not yet optimized." msgstr "" +#: data.table.R:1838 +msgid "Old mean optimization changed j from '%s' to '%s'" +msgstr "" + +#: data.table.R:1840 +msgid "Old mean optimization is on, left j unchanged." +msgstr "" + +#: data.table.R:1850 +msgid "All optimizations are turned off" +msgstr "" + +#: data.table.R:1851 +msgid "Optimization is on but left j unchanged (single plain symbol): '%s'" +msgstr "" + +#: data.table.R:1880 +msgid "Making each group and running j (GForce %s) ..." +msgstr "" + +#: data.table.R:1976 +msgid "setkey() after the := with keyby= ..." +msgstr "" + #: data.table.R:1980 #, c-format msgid "" @@ -749,6 +981,10 @@ msgid "" "existing column names to keyby=." msgstr "" +#: data.table.R:2006 +msgid "setkey() afterwards for keyby=.EACHI ..." +msgstr "" + #: data.table.R:2072 #, c-format msgid "rownames and rownames.value cannot both be used at the same time" @@ -896,6 +1132,10 @@ msgid "" "columns are non-atomic: %s" msgstr "" +#: data.table.R:2511 +msgid "Processing split.data.table with: %s" +msgstr "" + #: data.table.R:2596 #, c-format msgid "" @@ -1095,6 +1335,28 @@ msgid "" "recycling is allowed (other than of length 1 RHS). Consider %%in%% instead." msgstr "" +#: data.table.R:3288 +msgid "" +"Subsetting optimization disabled because the cross-product of RHS values " +"exceeds 1e4, causing memory problems." +msgstr "" + +#: data.table.R:3306 +msgid "Optimized subsetting with key %s" +msgstr "" + +#: data.table.R:3325 data.table.R:3337 +msgid "Optimized subsetting with index '%s'" +msgstr "" + +#: data.table.R:3332 +msgid "Creating new index '%s'" +msgstr "" + +#: data.table.R:3333 +msgid "Creating index %s done in ..." +msgstr "" + #: data.table.R:3371 #, c-format msgid "" @@ -1133,6 +1395,14 @@ msgstr "" msgid "There is no package %s in provided repository." msgstr "" +#: devel.R:30 +msgid "" +"No revision information found in DESCRIPTION file for %s package. Make sure " +"that '%s' is correct field in PACKAGES file in your package repository '%s'. " +"Otherwise package will be re-installed every time, proceeding to " +"installation." +msgstr "" + #: devel.R:39 msgid "R %s package has been updated to %s (%s)" msgstr "" @@ -1141,6 +1411,15 @@ msgstr "" msgid "R %s package is up-to-date at %s (%s)" msgstr "" +#: devel.R:53 +msgid "" +"Git revision is not available. Most likely data.table was installed from " +"CRAN or local archive.\n" +"Git revision is available when installing from our repositories 'https://" +"Rdatatable.gitlab.io/data.table' and 'https://Rdatatable.github.io/data." +"table'." +msgstr "" + #: duplicated.R:7 #, c-format msgid "'fromLast' must be TRUE or FALSE" @@ -1424,6 +1703,12 @@ msgstr "" msgid "Please provide a name to each element of 'measure.vars'." msgstr "" +#: fmelt.R:217 +msgid "" +"Duplicate column names found in molten data.table. Setting unique names " +"using 'make.names'" +msgstr "" + #: foverlaps.R:3 #, c-format msgid "" @@ -1574,6 +1859,14 @@ msgid "" "type interval cols have identical 'tzone' attributes to avoid confusion." msgstr "" +#: foverlaps.R:132 +msgid "unique() + setkey() operations done in ..." +msgstr "" + +#: foverlaps.R:158 +msgid "binary search(es) done in ..." +msgstr "" + #: foverlaps.R:165 foverlaps.R:167 foverlaps.R:171 #, c-format msgid "Not yet implemented" @@ -1781,6 +2074,11 @@ msgid "" "double check the input file is a valid csvy." msgstr "" +#: fread.R:203 +msgid "" +"Processed %d lines of YAML metadata with the following top-level fields: %s" +msgstr "" + #: fread.R:206 #, c-format msgid "User-supplied 'header' will override that found in metadata." @@ -1868,6 +2166,10 @@ msgstr "" msgid "x being coerced from class: matrix to data.table" msgstr "" +#: fwrite.R:70 +msgid "Appending to existing file so setting bom=FALSE and yaml=FALSE" +msgstr "" + #: fwrite.R:83 #, c-format msgid "" @@ -2055,6 +2357,10 @@ msgid "" "Using integer64 class columns require to have 'bit64' package installed." msgstr "" +#: last.R:11 last.R:16 last.R:24 last.R:29 last.R:33 last.R:41 last.R:52 last.R:57 last.R:65 last.R:70 last.R:74 last.R:82 +msgid "%s: using %s: %s" +msgstr "" + #: last.R:39 last.R:80 #, c-format msgid "" @@ -2293,6 +2599,18 @@ msgstr "" msgid "Column classes will be suppressed when col.names is 'none'" msgstr "" +#: print.data.table.R:47 +msgid "Key: <%s>" +msgstr "" + +#: print.data.table.R:57 +msgid "Null data.%s (0 rows and 0 cols)" +msgstr "" + +#: print.data.table.R:59 +msgid "Empty data.%s (%d rows and %d cols)" +msgstr "" + #: print.data.table.R:153 #, c-format msgid "" @@ -2425,6 +2743,18 @@ msgid "" "currently." msgstr "" +#: setkey.R:65 +msgid "forder took %.03f sec" +msgstr "" + +#: setkey.R:77 +msgid "reorder took %s" +msgstr "" + +#: setkey.R:79 +msgid "x is already ordered by these columns, no need to call reorder" +msgstr "" + #: setkey.R:132 #, c-format msgid "x is vector but 'by' is supplied" @@ -2640,11 +2970,19 @@ msgstr "" msgid "Provided argument fill=%s will be ignored since type='cyclic'." msgstr "" +#: tables.R:31 +msgid "No objects of class data.table exist in %s" +msgstr "" + #: tables.R:46 #, c-format msgid "order.col='%s' not a column name of info" msgstr "" +#: tables.R:59 +msgid "Total: %sMB using %s" +msgstr "" + #: test.data.table.R:17 #, c-format msgid "data.table package is loaded. Unload or start a fresh R session." @@ -2662,39 +3000,149 @@ msgstr "" msgid "Neither %s nor %s exist in %s" msgstr "" -#: test.data.table.R:118 +#: test.data.table.R:115 +msgid "test.data.table() running: %s" +msgstr "" + +#: test.data.table.R:119 msgid "object '%s' not found" msgstr "" +#: test.data.table.R:122 +msgid "" +"**** This R session's language is not English. Each test will still check " +"that the correct number of errors and/or\n" +"**** warnings are produced. However, to test the text of each error/warning " +"too, please restart R with LANGUAGE=en" +msgstr "" + #: test.data.table.R:142 +msgid "" +"***\n" +"*** memtest=%d. This should be the first call in a fresh R_GC_MEM_GROW=0 R " +"session for best results. Ctrl-C now if not.\n" +"***" +msgstr "" + +#: test.data.table.R:143 #, c-format msgid "" "memtest intended for Linux. Step through data.table:::rss() to see what went " "wrong." msgstr "" -#: test.data.table.R:196 +#: test.data.table.R:197 #, c-format msgid "Attempt to subset to %d tests matching '%s' failed, running full suite." msgstr "" -#: test.data.table.R:245 +#: test.data.table.R:202 +msgid "Running %d of %d tests matching '%s'" +msgstr "" + +#: test.data.table.R:248 #, c-format msgid "Failed in %s after test %s before the next test() call in %s" msgstr "" -#: test.data.table.R:268 +#: test.data.table.R:271 #, c-format msgid "Timings count mismatch: %d vs %d" msgstr "" -#: test.data.table.R:400 +#: test.data.table.R:273 +msgid "10 longest running tests took %ds (%d%% of %ds)" +msgstr "" + +#: test.data.table.R:279 +msgid "10 largest RAM increases (MB); see plot for cumulative effect (if any)" +msgstr "" + +#: test.data.table.R:289 +msgid "All %d tests (last %.8g) in %s completed ok in %s" +msgstr "" + +#: test.data.table.R:388 +msgid "Running test id" +msgstr "" + +#: test.data.table.R:404 #, c-format msgid "" "Test %s is invalid: when error= is provided it does not make sense to pass y " "as well" msgstr "" +#: test.data.table.R:439 +msgid "Test id %s is not in increasing order" +msgstr "" + +#: test.data.table.R:456 +msgid "" +"Test %s produced %d %ss but expected %d\n" +"%s\n" +"%s" +msgstr "" + +#: test.data.table.R:464 +msgid "" +"Test %s didn't produce the correct %s:\n" +"Expected: %s\n" +"Observed: %s" +msgstr "" + +#: test.data.table.R:473 +msgid "Output captured before unexpected warning/error/message:" +msgstr "" + +#: test.data.table.R:483 +msgid "Test %s did not produce correct output:" +msgstr "" + +#: test.data.table.R:484 +msgid "Expected: <<%s>>" +msgstr "" + +#: test.data.table.R:485 test.data.table.R:497 +msgid "Observed: <<%s>>" +msgstr "" + +#: test.data.table.R:487 +msgid "Expected (raw): <<%s>>" +msgstr "" + +#: test.data.table.R:488 test.data.table.R:500 +msgid "Observed (raw): <<%s>>" +msgstr "" + +#: test.data.table.R:495 +msgid "Test %s produced output but should not have:" +msgstr "" + +#: test.data.table.R:496 +msgid "Expected absent (case insensitive): <<%s>>" +msgstr "" + +#: test.data.table.R:499 +msgid "Expected absent (raw): <<%s>>" +msgstr "" + +#: test.data.table.R:513 +msgid "Test %s ran without errors but selfrefok(%s) is FALSE" +msgstr "" + +#: test.data.table.R:538 +msgid "Test %s ran without errors but failed check that x equals y:" +msgstr "" + +#: test.data.table.R:543 +msgid "First %d of %d (type '%s'):" +msgstr "" + +#: test.data.table.R:548 +msgid "Non-ASCII string detected, raw representation:" +msgstr "" + #: timetaken.R:3 #, c-format msgid "Use started.at=proc.time() not Sys.time() (POSIXt and slow)" @@ -2860,8 +3308,12 @@ msgstr[0] "" msgstr[1] "" #: data.table.R:895 -msgid "The item in the 'by' or 'keyby' list is length %s." -msgid_plural "The items in the 'by' or 'keyby' list have lengths %s." +msgid "The item in the 'by' or 'keyby' list is length %s. Each must be length " +"%d; the same length as there are rows in x (after subsetting if i is " +"provided)." +msgid_plural "The items in the 'by' or 'keyby' list have lengths %s. Each " +"must be length %d; the same length as there are rows in x (after subsetting " +"if i is provided)." msgstr[0] "" msgstr[1] "" @@ -2895,7 +3347,7 @@ msgid_plural "unsupported column types found in x or y: %s" msgstr[0] "" msgstr[1] "" -#: test.data.table.R:255 +#: test.data.table.R:258 msgid "%d error out of %d. Search %s for test number %s. Duration: %s." msgid_plural "%d errors out of %d. Search %s for test numbers %s. Duration: %s." msgstr[0] "" diff --git a/po/data.table.pot b/po/data.table.pot index cf3f0750e..acf72d6ac 100644 --- a/po/data.table.pot +++ b/po/data.table.pot @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: data.table 1.16.99\n" -"POT-Creation-Date: 2025-01-29 23:31-0800\n" +"POT-Creation-Date: 2025-02-02 23:58-0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -330,7 +330,7 @@ msgstr "" msgid "" "RHS for item %d has been duplicated because MAYBE_REFERENCED==%d " "MAYBE_SHARED==%d, but then is being plonked. length(values)==%d; " -"length(cols)==%d)\n" +"length(cols)==%d\n" msgstr "" #: assign.c:569 @@ -536,11 +536,6 @@ msgstr "" msgid "Unsupported column type in assign.c:memrecycle '%s'" msgstr "" -#: assign.c:1279 -#, c-format -msgid "savetl_init checks failed (%d %d %p %p)" -msgstr "" - #: assign.c:1288 #, c-format msgid "Failed to allocate initial %d items in savetl_init" @@ -677,6 +672,16 @@ msgstr "" msgid "Only '==' operator is supported for columns of type character." msgstr "" +#: bmerge.c:190 +#, c-format +msgid "bmerge: looping bmerge_r took %.3fs\n" +msgstr "" + +#: bmerge.c:222 +#, c-format +msgid "bmerge: took %.3fs\n" +msgstr "" + #: chmatch.c:5 #, c-format msgid "table is type '%s' (must be 'character' or NULL)" @@ -893,37 +898,37 @@ msgstr "" msgid "\n" msgstr "" -#: dogroups.c:454 dogroups.c:468 +#: dogroups.c:455 dogroups.c:470 #, c-format msgid "" "Processed %d groups out of %d. %.0f%% done. Time elapsed: %ds. ETA: %ds." msgstr "" -#: dogroups.c:473 +#: dogroups.c:475 #, c-format msgid "Wrote less rows (%d) than allocated (%d).\n" msgstr "" -#: dogroups.c:497 +#: dogroups.c:499 #, c-format msgid "" "\n" " collecting discontiguous groups took %.3fs for %d groups\n" msgstr "" -#: dogroups.c:498 +#: dogroups.c:500 #, c-format msgid "" "\n" " memcpy contiguous groups took %.3fs for %d groups\n" msgstr "" -#: dogroups.c:500 +#: dogroups.c:502 #, c-format msgid " eval(j) took %.3fs for %d calls\n" msgstr "" -#: dogroups.c:529 +#: dogroups.c:531 msgid "growVector passed NULL" msgstr "" @@ -1218,6 +1223,17 @@ msgstr "" msgid "Unknown column type '%s' for column '%s'." msgstr "" +#: fmelt.c:600 +msgid "" +"measure.vars is a list with length=1, which as long documented should return " +"integer indices in the 'variable' column, but currently returns character " +"column names. To increase consistency in the next release, we plan to change " +"'variable' to integer, so users who were relying on this behavior should " +"change measure.vars=list('col_name') (output variable is column name now, " +"but will become column index/integer) to measure.vars='col_name' (variable " +"is column name before and after the planned change)." +msgstr "" + #: fmelt.c:686 #, c-format msgid "variable_table does not support column type '%s' for column '%s'." @@ -1342,15 +1358,19 @@ msgid "" "attempting to order by a list column?\n" msgstr "" -#: forder.c:508 +#: forder.c:508 forder.c:1654 msgid "retGrp must be TRUE or FALSE" msgstr "" -#: forder.c:511 +#: forder.c:511 forder.c:1657 msgid "retStats must be TRUE or FALSE" msgstr "" -#: forder.c:516 +#: forder.c:514 forder.c:1660 +msgid "retStats must be TRUE whenever retGrp is TRUE" +msgstr "" + +#: forder.c:516 forder.c:1662 msgid "sort must be TRUE or FALSE" msgstr "" @@ -1358,7 +1378,7 @@ msgstr "" msgid "At least one of retGrp= or sort= must be TRUE" msgstr "" -#: forder.c:521 +#: forder.c:521 forder.c:1665 msgid "na.last must be logical TRUE, FALSE or NA of length 1" msgstr "" @@ -1452,6 +1472,79 @@ msgstr "" msgid "x must be type 'double'" msgstr "" +#: forder.c:1622 +msgid "'datatable.use.index' option must be TRUE or FALSE" +msgstr "" + +#: forder.c:1635 +msgid "'datatable.forder.auto.index' option must be TRUE or FALSE" +msgstr "" + +#: forder.c:1652 +msgid "DT is NULL" +msgstr "" + +#: forder.c:1668 +msgid "order must be integer" +msgstr "" + +#: forder.c:1670 +msgid "reuseSorting must be logical TRUE, FALSE or NA of length 1" +msgstr "" + +#: forder.c:1682 +#, c-format +msgid "" +"forderReuseSorting: opt not possible: is.data.table(DT)=%d, sortGroups=%d, " +"all1(ascArg)=%d\n" +msgstr "" + +#: forder.c:1701 +#, c-format +msgid "forderReuseSorting: using key: %s\n" +msgstr "" + +#: forder.c:1736 +#, c-format +msgid "forderReuseSorting: index found but not for retGrp and retStats: %s\n" +msgstr "" + +#: forder.c:1739 +#, c-format +msgid "forderReuseSorting: index found but not for retGrp: %s\n" +msgstr "" + +#: forder.c:1742 +#, c-format +msgid "forderReuseSorting: index found but not for retStats: %s\n" +msgstr "" + +#: forder.c:1749 +#, c-format +msgid "" +"forderReuseSorting: index found but na.last=TRUE and no stats available: %s\n" +msgstr "" + +#: forder.c:1752 +#, c-format +msgid "forderReuseSorting: index found but na.last=TRUE and NAs present: %s\n" +msgstr "" + +#: forder.c:1760 +#, c-format +msgid "forderReuseSorting: using existing index: %s\n" +msgstr "" + +#: forder.c:1772 +#, c-format +msgid "forderReuseSorting: setting index (retGrp=%d, retStats=%d) on DT: %s\n" +msgstr "" + +#: forder.c:1776 +#, c-format +msgid "forderReuseSorting: opt=%d, took %.3fs\n" +msgstr "" + #: frank.c:14 frank.c:192 #, c-format msgid "Item %d of 'cols' is %d which is outside 1-based range [1,ncol(x)=%d]" @@ -1701,6 +1794,11 @@ msgid "" "in RAM. %s.\n" msgstr "" +#: fread.c:1566 fread.c:1850 +#, c-format +msgid "%s. Attempt to copy file in RAM failed." +msgstr "" + #: fread.c:1567 fread.c:1851 #, c-format msgid "Unable to allocate %s of contiguous virtual RAM." @@ -2166,11 +2264,6 @@ msgstr "" msgid "%8.3fs (%3.0f%%) Memory map %.3fGB file\n" msgstr "" -#: fread.c:2775 -#, c-format -msgid "%8.3fs (%3.0f%%) sep=" -msgstr "" - #: fread.c:2777 #, c-format msgid " ncol=%d and header detection\n" @@ -2437,7 +2530,7 @@ msgstr "" msgid "%s: results from provided FUN are not of type double" msgstr "" -#: froll.c:472 nafill.c:87 +#: froll.c:472 nafill.c:43 nafill.c:65 nafill.c:87 #, c-format msgid "%s: took %.3fs\n" msgstr "" @@ -2484,7 +2577,7 @@ msgid "" "implemented" msgstr "" -#: frollR.c:117 frollR.c:267 types.c:71 +#: frollR.c:117 frollR.c:267 #, c-format msgid "%s: allocating memory for results %dx%d\n" msgstr "" @@ -3126,6 +3219,10 @@ msgstr "" msgid "fill must be a vector of length 1 or a list of length of x" msgstr "" +#: negate.c:5 +msgid "not logical or integer vector" +msgstr "" + #: openmp-utils.c:23 #, c-format msgid "" diff --git a/src/assign.c b/src/assign.c index 187ba6b61..0ce93d5a7 100644 --- a/src/assign.c +++ b/src/assign.c @@ -561,7 +561,7 @@ SEXP assign(SEXP dt, SEXP rows, SEXP cols, SEXP newcolnames, SEXP values) (TYPEOF(values)!=VECSXP && i>0) // assigning the same values to a second column. Have to ensure a copy #2540 ) { if (verbose) { - Rprintf(_("RHS for item %d has been duplicated because MAYBE_REFERENCED==%d MAYBE_SHARED==%d, but then is being plonked. length(values)==%d; length(cols)==%d)\n"), + Rprintf(_("RHS for item %d has been duplicated because MAYBE_REFERENCED==%d MAYBE_SHARED==%d, but then is being plonked. length(values)==%d; length(cols)==%d\n"), i+1, MAYBE_REFERENCED(thisvalue), MAYBE_SHARED(thisvalue), length(values), length(cols)); } thisvalue = copyAsPlain(thisvalue); // PROTECT not needed as assigned as element to protected list below. @@ -587,7 +587,7 @@ SEXP assign(SEXP dt, SEXP rows, SEXP cols, SEXP newcolnames, SEXP values) targetcol = VECTOR_ELT(dt,coln); } const char *ret = memrecycle(targetcol, rows, 0, targetlen, thisvalue, 0, -1, coln+1, CHAR(STRING_ELT(names, coln))); - if (ret) warning("%s", ret); + if (ret) warning("%s", ret); // # notranslate } *_Last_updated = numToDo; // the updates have taken place with no error, so update .Last.updated now @@ -1276,7 +1276,7 @@ static R_len_t *savedtl=NULL, nalloc=0, nsaved=0; void savetl_init(void) { if (nsaved || nalloc || saveds || savedtl) { - internal_error(__func__, _("savetl_init checks failed (%d %d %p %p)"), nsaved, nalloc, (void *)saveds, (void *)savedtl); // # nocov + internal_error(__func__, "savetl_init checks failed (%d %d %p %p)", nsaved, nalloc, (void *)saveds, (void *)savedtl); // # nocov } nsaved = 0; nalloc = 100; diff --git a/src/bmerge.c b/src/bmerge.c index f6f640e71..886e3edd5 100644 --- a/src/bmerge.c +++ b/src/bmerge.c @@ -187,7 +187,7 @@ SEXP bmerge(SEXP idt, SEXP xdt, SEXP icolsArg, SEXP xcolsArg, SEXP xoArg, SEXP r bmerge_r(-1,xN,-1,iN,scols,kk+1,1,1); } if (verbose) - Rprintf("bmerge: looping bmerge_r took %.3fs\n", omp_get_wtime()-tic0); + Rprintf(_("bmerge: looping bmerge_r took %.3fs\n"), omp_get_wtime()-tic0); } ctr += iN; if (nqmaxgrp > 1 && mult == ALL) { @@ -219,7 +219,7 @@ SEXP bmerge(SEXP idt, SEXP xdt, SEXP icolsArg, SEXP xcolsArg, SEXP xoArg, SEXP r R_Free(retIndex); } if (verbose) - Rprintf("bmerge: took %.3fs\n", omp_get_wtime()-tic); + Rprintf(_("bmerge: took %.3fs\n"), omp_get_wtime()-tic); UNPROTECT(protecti); return (ans); } diff --git a/src/dogroups.c b/src/dogroups.c index acc2d3482..944cb315d 100644 --- a/src/dogroups.c +++ b/src/dogroups.c @@ -450,9 +450,11 @@ SEXP dogroups(SEXP dt, SEXP dtcols, SEXP groups, SEXP grpcols, SEXP jiscols, SEX double avgTimePerGroup = (now-startTime)/(i+1); int ETA = (int)(avgTimePerGroup*(ngrp-i-1)); if (hasPrinted || ETA >= 0) { + // # nocov start. Requires long-running test case if (verbose && !hasPrinted) Rprintf(_("\n")); - Rprintf("\r"); // \r is not internationalizable + Rprintf("\r"); // # notranslate. \r is not internationalizable Rprintf(_("Processed %d groups out of %d. %.0f%% done. Time elapsed: %ds. ETA: %ds."), i+1, ngrp, 100.0*(i+1)/ngrp, (int)(now-startTime), ETA); + // # nocov end } nextTime = now+1; hasPrinted = true; @@ -466,9 +468,11 @@ SEXP dogroups(SEXP dt, SEXP dtcols, SEXP groups, SEXP grpcols, SEXP jiscols, SEX else UNPROTECT(1); // the jval. Don't want them to build up. The first jval can stay protected till the end ok. } if (showProgress && hasPrinted) { - Rprintf("\r"); // \r is not internationalizable + // # nocov start. Requires long-running test case + Rprintf("\r"); // # notranslate. \r is not internationalizable Rprintf(_("Processed %d groups out of %d. %.0f%% done. Time elapsed: %ds. ETA: %ds."), ngrp, ngrp, 100.0, (int)(wallclock()-startTime), 0); - Rprintf("\n"); // separated so this & the earlier message are identical for translation purposes. + Rprintf("\n"); // # notranslate. separated so this & the earlier message are identical for translation purposes. + // # nocov end } if (isNull(lhs) && ans!=NULL) { if (ansloc < LENGTH(VECTOR_ELT(ans,0))) { diff --git a/src/fmelt.c b/src/fmelt.c index 59e82455b..a778f48b7 100644 --- a/src/fmelt.c +++ b/src/fmelt.c @@ -597,7 +597,7 @@ SEXP getvarcols(SEXP DT, SEXP dtnames, Rboolean varfactor, Rboolean verbose, str internal_error(__func__, "getvarcols %d %d", length(VECTOR_ELT(data->valuecols, 0)), data->lmax); // # nocov if (isNull(data->variable_table)) { if ((data->lvalues == 1) & data->measure_is_list) { - warning("measure.vars is a list with length=1, which as long documented should return integer indices in the 'variable' column, but currently returns character column names. To increase consistency in the next release, we plan to change 'variable' to integer, so users who were relying on this behavior should change measure.vars=list('col_name') (output variable is column name now, but will become column index/integer) to measure.vars='col_name' (variable is column name before and after the planned change)."); + warning(_("measure.vars is a list with length=1, which as long documented should return integer indices in the 'variable' column, but currently returns character column names. To increase consistency in the next release, we plan to change 'variable' to integer, so users who were relying on this behavior should change measure.vars=list('col_name') (output variable is column name now, but will become column index/integer) to measure.vars='col_name' (variable is column name before and after the planned change).")); } if (!varfactor) { SET_VECTOR_ELT(ansvars, 0, target=allocVector(STRSXP, data->totlen)); @@ -612,7 +612,7 @@ SEXP getvarcols(SEXP DT, SEXP dtnames, Rboolean varfactor, Rboolean verbose, str for (int j=0, ansloc=0, level=1; jlmax; ++j) { const int thislen = data->narm ? length(VECTOR_ELT(data->not_NA_indices, j)) : data->nrow; char buff[20]; - snprintf(buff, 20, "%d", level++); + snprintf(buff, 20, "%d", level++); // # notranslate for (int k=0; klmax; ++j) { const int thislen = data->narm ? length(VECTOR_ELT(data->not_NA_indices, j)) : data->nrow; char buff[20]; - snprintf(buff, 20, "%d", nlevel+1); + snprintf(buff, 20, "%d", nlevel+1); // # notranslate SET_STRING_ELT(levels, nlevel++, mkChar(buff)); // generate levels = 1:nlevels for (int k=0; k> shift << shift))) { if (i < NSUFFIXES) { - snprintf(output, BUFFSIZE, "%"PRIu64"%cB (%"PRIu64" bytes)", + snprintf(output, BUFFSIZE, "%"PRIu64"%cB (%"PRIu64" bytes)", // # notranslate (uint64_t)(lsize >> shift), suffixes[i], (uint64_t)lsize); return output; } } else { - snprintf(output, BUFFSIZE, "%.*f%cB (%"PRIu64" bytes)", + snprintf(output, BUFFSIZE, "%.*f%cB (%"PRIu64" bytes)", // # notranslate ndigits, (double)fsize / (1LL << shift), suffixes[i], (uint64_t)lsize); return output; } } if (fsize == 1) return one_byte; - snprintf(output, BUFFSIZE, "%"PRIu64" bytes", (uint64_t)lsize); + snprintf(output, BUFFSIZE, "%"PRIu64" bytes", (uint64_t)lsize); // # notranslate return output; } double copyFile(size_t fileSize) // only called in very very rare cases @@ -1563,7 +1563,7 @@ int freadMain(freadMainArgs _args) { if (time_taken == -1.0) { // # nocov start if (!verbose) - DTPRINT("%s. Attempt to copy file in RAM failed.", msg); + DTPRINT(_("%s. Attempt to copy file in RAM failed."), msg); STOP(_("Unable to allocate %s of contiguous virtual RAM."), filesize_to_str(fileSize)); // # nocov end } @@ -1730,7 +1730,7 @@ int freadMain(freadMainArgs _args) { topQuoteRule = quoteRule; firstJumpEnd = ch; // to know how many bytes jump 0 is, for nrow estimate later (a less-good estimate when fill=true since line lengths vary more) if (verbose) { - DTPRINT((unsigned)sep<32 ? " sep=%#02x" : " sep='%c'", sep); + DTPRINT((unsigned)sep<32 ? " sep=%#02x" : " sep='%c'", sep); // # notranslate DTPRINT(_(" with %d fields using quote rule %d\n"), topNumFields, quoteRule); } } @@ -1780,7 +1780,7 @@ int freadMain(freadMainArgs _args) { topSkip = thisRow-thisBlockLines; if (topSkip<0) topSkip=0; // inelegant but will do for now to pass single row input such as test 890 if (verbose) { - DTPRINT((unsigned)sep<32 ? " sep=%#02x" : " sep='%c'", sep); + DTPRINT((unsigned)sep<32 ? " sep=%#02x" : " sep='%c'", sep); // # notranslate DTPRINT(_(" with %d lines of %d fields using quote rule %d\n"), topNumLines, topNumFields, topQuoteRule); } } @@ -1847,7 +1847,7 @@ int freadMain(freadMainArgs _args) { if (time_taken == -1.0) { // # nocov start if (!verbose) - DTPRINT("%s. Attempt to copy file in RAM failed.", msg); + DTPRINT(_("%s. Attempt to copy file in RAM failed."), msg); STOP(_("Unable to allocate %s of contiguous virtual RAM."), filesize_to_str(fileSize)); // # nocov end } @@ -2303,7 +2303,7 @@ int freadMain(freadMainArgs _args) { nth = omp_get_num_threads(); if (me!=0) { // # nocov start - snprintf(internalErr, internalErrSize, "Master thread is not thread 0 but thread %d.\n", me); + snprintf(internalErr, internalErrSize, "Master thread is not thread 0 but thread %d.\n", me); // # notranslate stopTeam = true; // # nocov end } @@ -2567,7 +2567,7 @@ int freadMain(freadMainArgs _args) { } else if (headPos!=thisJumpStart && nrowLimit>0) { // do not care for dirty jumps since we do not read data and only want to know types // # nocov start - snprintf(internalErr, internalErrSize, "invalid head position. jump=%d, headPos=%p, thisJumpStart=%p, sof=%p", jump, (void*)headPos, (void*)thisJumpStart, (void*)sof); + snprintf(internalErr, internalErrSize, "invalid head position. jump=%d, headPos=%p, thisJumpStart=%p, sof=%p", jump, (void*)headPos, (void*)thisJumpStart, (void*)sof); // # notranslate stopTeam = true; // # nocov end } @@ -2773,7 +2773,7 @@ int freadMain(freadMainArgs _args) { if (tTot<0.000001) tTot=0.000001; // to avoid nan% output in some trivially small tests where tot==0.000s DTPRINT(_("%8.3fs (%3.0f%%) Memory map %.3fGB file\n"), tMap-t0, 100.0*(tMap-t0)/tTot, 1.0*fileSize/(1024*1024*1024)); DTPRINT(_("%8.3fs (%3.0f%%) sep="), tLayout-tMap, 100.0*(tLayout-tMap)/tTot); - DTPRINT(sep=='\t' ? "'\\t'" : (sep=='\n' ? "'\\n'" : "'%c'"), sep); + DTPRINT(sep=='\t' ? "'\\t'" : (sep=='\n' ? "'\\n'" : "'%c'"), sep); // # notranslate DTPRINT(_(" ncol=%d and header detection\n"), ncol); DTPRINT(_("%8.3fs (%3.0f%%) Column type detection using %"PRIu64" sample rows\n"), tColType-tLayout, 100.0*(tColType-tLayout)/tTot, (uint64_t)sampleLines); @@ -2793,7 +2793,7 @@ int freadMain(freadMainArgs _args) { // if type bumps happened, it's useful to see them at the end after the timing 2 lines up showing the reread time // TODO - construct and output the copy and pastable colClasses argument so user can avoid the reread time if they are // reading this file or files formatted like it many times (say in a production environment). - DTPRINT("%s", typeBumpMsg); + DTPRINT("%s", typeBumpMsg); // # notranslate free(typeBumpMsg); // local scope and only populated in verbose mode } } diff --git a/src/freadR.c b/src/freadR.c index 8f49b5d4e..9c885ef03 100644 --- a/src/freadR.c +++ b/src/freadR.c @@ -232,8 +232,8 @@ static void applyDrop(SEXP items, int8_t *type, int ncol, int dropSource) { int k = itemsD[j]; if (k==NA_INTEGER || k<1 || k>ncol) { static char buff[51]; - if (dropSource==-1) snprintf(buff, 50, "drop[%d]", j+1); - else snprintf(buff, 50, "colClasses[[%d]][%d]", dropSource+1, j+1); + if (dropSource==-1) snprintf(buff, 50, "drop[%d]", j+1); // # notranslate + else snprintf(buff, 50, "colClasses[[%d]][%d]", dropSource+1, j+1); // # notranslate if (k==NA_INTEGER) { if (isString(items)) DTWARN(_("Column name '%s' (%s) not found"), CHAR(STRING_ELT(items, j)), buff); @@ -262,7 +262,7 @@ bool userOverride(int8_t *type, lenOff *colNames, const char *anchor, const int SEXP elem; if (colNames==NULL || colNames[i].len<=0) { char buff[12]; - snprintf(buff,12,"V%d",i+1); + snprintf(buff,12,"V%d",i+1); // # notranslate elem = mkChar(buff); // no PROTECT as passed immediately to SET_STRING_ELT } else { elem = mkCharLenCE(anchor+colNames[i].off, colNames[i].len, ienc); // no PROTECT as passed immediately to SET_STRING_ELT @@ -685,7 +685,7 @@ void progress(int p, int eta) { if (eta<3 || p>50) return; #pragma omp critical { - REprintf("|--------------------------------------------------|\n|"); + REprintf("|--------------------------------------------------|\n|"); // # notranslate R_FlushConsole(); } displayed = 0; @@ -696,11 +696,11 @@ void progress(int p, int eta) { bar[toPrint] = '\0'; #pragma omp critical { - REprintf("%s", bar); + REprintf("%s", bar); // # notranslate bar[toPrint] = '='; displayed = p; if (p==50) { - REprintf("|\n"); + REprintf("|\n"); // # notranslate displayed = -1; } R_FlushConsole(); diff --git a/src/fwrite.c b/src/fwrite.c index d00b6517b..5b0191626 100644 --- a/src/fwrite.c +++ b/src/fwrite.c @@ -871,7 +871,7 @@ void fwriteMain(fwriteMainArgs args) } if (f == -1) { *ch = '\0'; - DTPRINT("%s", buff); + DTPRINT("%s", buff); // # notranslate } else { int ret0=0, ret1=0, ret2=0; #ifndef NOZLIB @@ -1025,7 +1025,7 @@ void fwriteMain(fwriteMainArgs args) int ret = 0; if (f == -1) { *ch='\0'; // standard C string end marker so DTPRINT knows where to stop - DTPRINT("%s", myBuff); + DTPRINT("%s", myBuff); // # notranslate } else #ifndef NOZLIB if (args.is_gzip) { @@ -1060,7 +1060,7 @@ void fwriteMain(fwriteMainArgs args) int ETA = (int)((args.nrow - end) * (now-startTime) /end); if (hasPrinted || ETA >= 2) { // # nocov start - if (verbose && !hasPrinted) DTPRINT("\n"); + if (verbose && !hasPrinted) DTPRINT("\n"); // # notranslate DTPRINT(Pl_(nth, "\rWritten %.1f%% of %"PRId64" rows in %d secs using %d thread. maxBuffUsed=%d%%. ETA %d secs. ", "\rWritten %.1f%% of %"PRId64" rows in %d secs using %d threads. maxBuffUsed=%d%%. ETA %d secs. "), @@ -1101,10 +1101,10 @@ void fwriteMain(fwriteMainArgs args) if (hasPrinted) { // # nocov start if (!failed) { // clear the progress meter - DTPRINT("\r " + DTPRINT("\r " // # notranslate " \r\n"); } else { // don't clear any potentially helpful output before error - DTPRINT("\n"); + DTPRINT("\n"); // # notranslate } // # nocov end } @@ -1116,12 +1116,15 @@ void fwriteMain(fwriteMainArgs args) len, len / MEGA, compress_len, compress_len / MEGA, len != 0 ? (100.0 * compress_len) / len : 0, crc); } #endif - DTPRINT(_("Written %"PRId64" rows in %.3f secs using %d thread%s. MaxBuffUsed=%d%%\n"), - args.nrow, 1.0*(wallclock()-t0), nth, nth ==1 ? "" : "s", maxBuffUsedPC); + DTPRINT(Pl_(nth, Pl_(args.nrow, "Wrote %"PRId64" row in %.3f secs using %d thread. MaxBuffUsed=%d%%\n", + "Wrote %"PRId64" rows in %.3f secs using %d thread. MaxBuffUsed=%d%%\n"), + Pl_(args.nrow, "Wrote %"PRId64" row in %.3f secs using %d threads. MaxBuffUsed=%d%%\n", + "Wrote %"PRId64" rows in %.3f secs using %d threads. MaxBuffUsed=%d%%\n")), + args.nrow, 1.0*(wallclock()-t0), nth, maxBuffUsedPC); } if (f != -1 && CLOSE(f) && !failed) - STOP("%s: '%s'", strerror(errno), args.filename); // # nocov + STOP("%s: '%s'", strerror(errno), args.filename); // # nocov, # notranslate // quoted '%s' in case of trailing spaces in the filename // If a write failed, the line above tries close() to clean up, but that might fail as well. So the // '&& !failed' is to not report the error as just 'closing file' but the next line for more detail @@ -1136,7 +1139,7 @@ void fwriteMain(fwriteMainArgs args) : _("Please retry fwrite() with verbose=TRUE and include the full output with your data.table bug report.")); #endif if (failed_write) - STOP("%s: '%s'", strerror(failed_write), args.filename); + STOP("%s: '%s'", strerror(failed_write), args.filename); // # notranslate // # nocov end } } diff --git a/src/nafill.c b/src/nafill.c index b37e668cd..55843fa10 100644 --- a/src/nafill.c +++ b/src/nafill.c @@ -40,7 +40,7 @@ void nafillDouble(double *x, uint_fast64_t nx, unsigned int type, double fill, b } } if (verbose) - snprintf(ans->message[0], 500, "%s: took %.3fs\n", __func__, omp_get_wtime()-tic); + snprintf(ans->message[0], 500, _("%s: took %.3fs\n"), __func__, omp_get_wtime()-tic); } void nafillInteger(int32_t *x, uint_fast64_t nx, unsigned int type, int32_t fill, ans_t *ans, bool verbose) { double tic=0.0; @@ -62,7 +62,7 @@ void nafillInteger(int32_t *x, uint_fast64_t nx, unsigned int type, int32_t fill } } if (verbose) - snprintf(ans->message[0], 500, "%s: took %.3fs\n", __func__, omp_get_wtime()-tic); + snprintf(ans->message[0], 500, _("%s: took %.3fs\n"), __func__, omp_get_wtime()-tic); } void nafillInteger64(int64_t *x, uint_fast64_t nx, unsigned int type, int64_t fill, ans_t *ans, bool verbose) { double tic=0.0; diff --git a/src/negate.c b/src/negate.c index 280307da7..161db0ec3 100644 --- a/src/negate.c +++ b/src/negate.c @@ -2,7 +2,7 @@ void negateByRef(SEXP x) { if(TYPEOF(x) != LGLSXP) { - error("not logical or integer vector"); // # nocov + error(_("not logical or integer vector")); // # nocov } const int n = length(x); int *ansd = LOGICAL(x); diff --git a/src/rbindlist.c b/src/rbindlist.c index d1a90a7a6..7dde5ab1d 100644 --- a/src/rbindlist.c +++ b/src/rbindlist.c @@ -214,7 +214,7 @@ SEXP rbindlist(SEXP l, SEXP usenamesArg, SEXP fillArg, SEXP idcolArg, SEXP ignor const char *str = isString(s) ? CHAR(STRING_ELT(s,w2)) : ""; snprintf(buff, 1000, _("Column %d ['%s'] of item %d is missing in item %d. Use fill=TRUE to fill with NA (NULL for list columns), or use.names=FALSE to ignore column names.%s"), w2+1, str, i+1, missi+1, extra ); - if (usenames==TRUE) error("%s", buff); + if (usenames==TRUE) error("%s", buff); // # notranslate i = LENGTH(l); // break from outer i loop break; // break from inner j loop } @@ -235,8 +235,8 @@ SEXP rbindlist(SEXP l, SEXP usenamesArg, SEXP fillArg, SEXP idcolArg, SEXP ignor } const char *o = isNull(opt) ? "message" : CHAR(STRING_ELT(opt,0)); if (strcmp(o,"message")==0) { eval(PROTECT(lang2(install("message"),PROTECT(ScalarString(mkChar(buff))))), R_GlobalEnv); UNPROTECT(2); } - else if (strcmp(o,"warning")==0) warning("%s", buff); - else if (strcmp(o,"error")==0) error("%s", buff); + else if (strcmp(o,"warning")==0) warning("%s", buff); // # notranslate + else if (strcmp(o,"error")==0) error("%s", buff); // # notranslate else if (strcmp(o,"none")!=0) warning(_("options()$datatable.rbindlist.check=='%s' which is not 'message'|'warning'|'error'|'none'. See news item 5 in v1.12.2."), o); } } @@ -336,7 +336,7 @@ SEXP rbindlist(SEXP l, SEXP usenamesArg, SEXP fillArg, SEXP idcolArg, SEXP ignor } } - if (!foundName) { static char buff[12]; snprintf(buff,12,"V%d",j+1), SET_STRING_ELT(ansNames, idcol+j, mkChar(buff)); foundName=buff; } + if (!foundName) { static char buff[12]; snprintf(buff,12,"V%d",j+1), SET_STRING_ELT(ansNames, idcol+j, mkChar(buff)); foundName=buff; } // # notranslate if (factor) maxType=INTSXP; // if any items are factors then a factor is created (could be an option) if (int64 && !(maxType==REALSXP || maxType==STRSXP || maxType==VECSXP || maxType==CPLXSXP)) internal_error(__func__, "column %d of result is determined to be integer64 but maxType=='%s' != REALSXP", j+1, type2char(maxType)); // # nocov @@ -514,7 +514,7 @@ SEXP rbindlist(SEXP l, SEXP usenamesArg, SEXP fillArg, SEXP idcolArg, SEXP ignor } for (int k=0; k99) { // up to 99 supported here; should not need more than 99 in a message - snprintf(dest, n, "1 %.*s outside range [1,99]", (int)(d-ch+1), ch); + snprintf(dest, n, "1 %.*s outside range [1,99]", (int)(d-ch+1), ch); // # notranslate return -1; } if (pos>narg) narg=pos; if (strp[pos-1]) { // no dups allowed because it's reasonable to not support dups, but this wrapper // could not cope with the same argument formatted differently; e.g. "%1$d %1$5d" - snprintf(dest, n, "2 %%%d$ appears twice", pos); + snprintf(dest, n, "2 %%%d$ appears twice", pos); // # notranslate return -1; } strp[pos-1] = strchr(ch, '$')+1; @@ -79,7 +79,7 @@ int dt_win_snprintf(char *dest, const size_t n, const char *fmt, ...) } if (posSpec && nonPosSpec) { // Standards state that if one specifier uses position, they all must; good. - snprintf(dest, n, "3 some %%n$ but not all"); + snprintf(dest, n, "3 some %%n$ but not all"); // # notranslate return -1; } if (!posSpec) { @@ -94,7 +94,7 @@ int dt_win_snprintf(char *dest, const size_t n, const char *fmt, ...) char *spec = (char *)malloc(specAlloc); // not R_alloc as we need to be thread-safe if (!spec) { // # nocov start - snprintf(dest, n, "4 %d byte spec alloc failed", (int)specAlloc); + snprintf(dest, n, "4 %d byte spec alloc failed", (int)specAlloc); // # notranslate return -1; // # nocov end } @@ -102,7 +102,7 @@ int dt_win_snprintf(char *dest, const size_t n, const char *fmt, ...) for (int i=0; imessage[0]), 500, "%s: stdout 1 message\n", __func__); @@ -87,3 +88,4 @@ SEXP testMsgR(SEXP status, SEXP x, SEXP k) { UNPROTECT(protecti); return ans; } +// # notranslate end diff --git a/src/utils.c b/src/utils.c index 539329734..37bae07f3 100644 --- a/src/utils.c +++ b/src/utils.c @@ -409,7 +409,7 @@ SEXP coerceAs(SEXP x, SEXP as, SEXP copyArg) { SEXP dt_zlib_version(void) { char out[71]; #ifndef NOZLIB - snprintf(out, 70, "zlibVersion()==%s ZLIB_VERSION==%s", zlibVersion(), ZLIB_VERSION); + snprintf(out, 70, "zlibVersion()==%s ZLIB_VERSION==%s", zlibVersion(), ZLIB_VERSION); // # notranslate #else snprintf(out, 70, _("zlib header files were not found when data.table was compiled")); #endif diff --git a/src/wrappers.c b/src/wrappers.c index 2cf46d9cf..d8e361c9d 100644 --- a/src/wrappers.c +++ b/src/wrappers.c @@ -83,7 +83,7 @@ SEXP address(SEXP x) { // A better way than : http://stackoverflow.com/a/10913296/403310 char buffer[32]; - snprintf(buffer, 32, "%p", (void *)x); + snprintf(buffer, 32, "%p", (void *)x); // # notranslate return(mkString(buffer)); }