Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
f89c370
initial exploration of adding a chinese translation of messages
Oct 3, 2019
e7208a4
adding another .mo file that was untracked
Oct 5, 2019
12a169f
trying to get the .pot for src/ files
Oct 13, 2019
e10a714
adding warning()s from C
Oct 15, 2019
b987a1d
C messages with DTPRINT or Rprintf
Oct 15, 2019
4d950a2
adding STOP messages
Oct 15, 2019
f64d93a
DTWARN messages
Oct 15, 2019
a30930d
Error in forder
Oct 15, 2019
57eeace
odds&ends more messages
Oct 15, 2019
9d596ac
cannot use _() with \r
Oct 15, 2019
710400a
update .pot for src files
Oct 15, 2019
6ac71e4
moving pot file to po/
Oct 15, 2019
1c98859
update header metadata for src .pot
Oct 15, 2019
856f723
Merge branch 'translation' of https://github.com/Rdatatable/data.tabl…
Oct 15, 2019
0832f48
run update_pkg_po on the src to get mo files
Oct 16, 2019
bd4f60b
Merge branch 'master' into translation
Oct 16, 2019
9a46ed3
update_pkg_po after merge
Oct 16, 2019
a0139bb
add template message in onAttach() & clear typos/PYDT issue along the…
Oct 16, 2019
a37bde3
remove some strings
Oct 17, 2019
e37d43b
Merge branch 'master' into translation
Oct 18, 2019
0543e44
improve arg checking&message in groupingsets; add some messages
Oct 21, 2019
8f45182
Merge branch 'master' into translation
Oct 21, 2019
48e3b1a
get tests working (fix some bad quotes, adjust to new messages)
Oct 21, 2019
03d3395
update po with latest message edits
Oct 21, 2019
fad9524
Finished the translation assigned to Chun-Hui Gao (#3983)
gaospecial Oct 21, 2019
526a38b
done some translation!
KingdaShi Nov 10, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion R/between.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# is x[i] in between lower[i] and upper[i] ?
between = function(x, lower, upper, incbounds=TRUE, NAbounds=TRUE, check=FALSE) {
if (is.logical(x)) stop("between has been x of type logical")
if (is.logical(x)) stop("between has been passed an argument x of type logical")
if (is.logical(lower)) lower = as.integer(lower) # typically NA (which is logical type)
if (is.logical(upper)) upper = as.integer(upper) # typically NA (which is logical type)
is.px = function(x) inherits(x, "POSIXct")
Expand Down
2 changes: 1 addition & 1 deletion R/data.table.R
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ replace_dot_alias = function(e) {
}
return(x)
}
if (!mult %chin% c("first","last","all")) stop("mult argument can only be 'first','last' or 'all'")
if (!mult %chin% c("first","last","all")) stop("mult argument can only be 'first', 'last' or 'all'")
missingroll = missing(roll)
if (length(roll)!=1L || is.na(roll)) stop("roll must be a single TRUE, FALSE, positive/negative integer/double including +Inf and -Inf or 'nearest'")
if (is.character(roll)) {
Expand Down
6 changes: 3 additions & 3 deletions R/groupingsets.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ groupingsets.data.table = function(x, j, by, sets, .SDcols, id = FALSE, jj, ...)
stop("All columns used in 'sets' argument must be in 'by' too. Columns used in 'sets' but not present in 'by': ", brackify(setdiff(sets.all.by, by)))
if (id && "grouping" %chin% names(x))
stop("When using `id=TRUE` the 'x' data.table must not have a column named 'grouping'.")
if (!all(sapply(sets, function(x) length(x)==uniqueN(x))))
if (any(sapply(sets, anyDuplicated)))
stop("Character vectors in 'sets' list must not have duplicated column names within a single grouping set.")
if (!identical(lapply(sets, sort), unique(lapply(sets, sort))))
warning("Double counting is going to happen. Argument 'sets' should be unique without taking order into account, unless you really want double counting, then get used to that warning. Otherwise `sets=unique(lapply(sets, sort))` will do the trick.")
if (length(sets) > 1L && (idx<-anyDuplicated(lapply(sets, sort))))
warning("'sets' contains a duplicate (i.e., equivalent up to sorting) element at index ", idx, "; as such, there will be duplicate rows in the output -- note that grouping by A,B and B,A will produce the same aggregations. Use `sets=unique(lapply(sets, sort))` to eliminate duplicates.")
# input arguments handling
jj = if (!missing(jj)) jj else substitute(j)
av = all.vars(jj, TRUE)
Expand Down
2 changes: 2 additions & 0 deletions R/onAttach.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
if (!isTRUE(getOption("datatable.quiet"))) { # new option in v1.12.4, #3489
packageStartupMessage("data.table ", v, if(dev)paste0(" IN DEVELOPMENT built ",d,g),
" using ", getDTthreads(verbose=FALSE), " threads (see ?getDTthreads). Latest news: r-datatable.com")
if (gettext("TRANSLATION CHECK", domain='R-data.table') != "TRANSLATION CHECK")
packageStartupMessage(gettext("**********\n", "Running data.table in English; package support is available in English only. When searching for online help, be sure to also check for the English error message. This can be obtained by looking at the po/R-<locale>.po and po/<locale>.po files in the package source, where the native language and English error messages can be found side-by-side"))
if (dev && (Sys.Date() - as.Date(d))>28L)
packageStartupMessage("**********\nThis development version of data.table was built more than 4 weeks ago. Please update: data.table::update.dev.pkg()\n**********")
if (!.Call(ChasOpenMP))
Expand Down
1 change: 0 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,3 @@ fi
version=`pkg-config --modversion zlib`
echo "zlib ${version} is available ok"
exit 0

Binary file added inst/po/en@quot/LC_MESSAGES/R-data.table.mo
Binary file not shown.
Binary file added inst/po/en@quot/LC_MESSAGES/data.table.mo
Binary file not shown.
Binary file added inst/po/zh_CN/LC_MESSAGES/R-data.table.mo
Binary file not shown.
Binary file added inst/po/zh_CN/LC_MESSAGES/data.table.mo
Binary file not shown.
10 changes: 5 additions & 5 deletions inst/tests/tests.Rraw
Original file line number Diff line number Diff line change
Expand Up @@ -10059,7 +10059,7 @@ test(1695.14, x %between% c(3, NA), rep(NA, 3L))
test(1695.15, x %between% c(NA, NA), rep(NA, 3L))
x = integer(0)
test(1695.16, x %between% c(3, 7), logical(0))
test(1695.17, TRUE %between% c(3, 7), error="between has been x of type logical")
test(1695.17, TRUE %between% c(3, 7), error="between has been passed an argument x of type logical")
x = c("foo","bar","paz")
test(1695.18, between(x, "bag", "fog"), c(FALSE, TRUE, FALSE))
test(1695.19, between(x, c("b","f","a"), "q"), c(TRUE, FALSE, TRUE))
Expand Down Expand Up @@ -10902,14 +10902,14 @@ test(1750.18, uniqueN({
r <- groupingsets(dt, j = c(list(cnt=.N), lapply(.SD, sum)), by = c("color","year","status"), sets=sets, id=TRUE)
r[, lapply(.SD, sum), by = .(double_counting = grouping==5L, double_counting = grouping!=5L), .SDcols = c("cnt","amount","value")]
}, by = c("cnt","amount","value")
), 1L, warning = "Double counting is going to happen")
), 1L, warning = "'sets' contains a duplicate")
# duplicate entries in `sets` but reorderd - double counting on `grouping==1L`
sets = list(c("color","year"), "year", c("year","color"), character())
test(1750.19, uniqueN({
r <- groupingsets(dt, j = c(list(cnt=.N), lapply(.SD, sum)), by = c("color","year","status"), sets=sets, id=TRUE)
r[, lapply(.SD, sum), by = .(double_counting = grouping==1L, double_counting = grouping!=1L), .SDcols = c("cnt","amount","value")]
}, by = c("cnt","amount","value")
), 1L, warning = "Double counting is going to happen")
), 1L, warning = "'sets' contains a duplicate")
# entries in `by` / `sets` not exists in data.table
test(1750.20, exists("notexist"), FALSE) # https://github.com/Rdatatable/data.table/issues/3055#issuecomment-423364960
test(1750.21, groupingsets(dt, j = c(list(cnt=.N), lapply(.SD, sum)), by = c("color","year","notexist"), sets=list(c("color"), character()), id=TRUE), error = "object 'notexist' not found")
Expand Down Expand Up @@ -13278,8 +13278,8 @@ test(1962.039, is.sorted(3:1, by = 'x'),

DT = data.table(a = 3:1)
test(1962.0401, forderv(DT, sort=FALSE, retGrp=FALSE), error='At least one of retGrp= or sort= must be TRUE')
test(1962.0402, forderv(DT, sort=0), error='sort= must be TRUE or FALSE')
test(1962.0403, forderv(DT, retGrp=0), error='retGrp= must be TRUE or FALSE')
test(1962.0402, forderv(DT, sort=0), error='sort must be TRUE or FALSE')
test(1962.0403, forderv(DT, retGrp=0), error='retGrp must be TRUE or FALSE')
test(1962.041, forderv(DT, na.last = logical(0L)), error='na.last must be logical TRUE, FALSE or NA of length 1')
test(1962.042, forderv(DT, na.last = c(TRUE, FALSE)), error='na.last must be logical TRUE, FALSE or NA of length 1')
test(1962.043, forderv(DT$a, by = 'a'), error='x is a single vector, non-NULL')
Expand Down
Loading