Skip to content

Commit 1175df7

Browse files
Make the full message plural for better translator context
1 parent 65eefd7 commit 1175df7

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

R/data.table.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -892,8 +892,10 @@ replace_dot_alias = function(e) {
892892
}
893893
tt = lengths(byval)
894894
if (any(tt!=xnrow)) {
895-
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))
896-
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)
895+
stopf(ngettext(length(tt),
896+
"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).",
897+
"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)."),
898+
brackify(tt), xnrow, domain=NA)
897899
}
898900
if (is.null(bynames)) bynames = rep.int("",length(byval))
899901
if (length(idx <- which(!nzchar(bynames))) && !bynull) {

po/R-data.table.pot

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -679,13 +679,6 @@ msgid ""
679679
"toString), whilst taking care to maintain distinctness in the process."
680680
msgstr ""
681681

682-
#: data.table.R:896
683-
#, c-format
684-
msgid ""
685-
"%s Each must be length %d; the same length as there are rows in x (after "
686-
"subsetting if i is provided)."
687-
msgstr ""
688-
689682
#: data.table.R:916
690683
msgid ""
691684
"by-expression '%s' is not named, and the auto-generated name '%s' clashed "
@@ -3315,8 +3308,12 @@ msgstr[0] ""
33153308
msgstr[1] ""
33163309

33173310
#: data.table.R:895
3318-
msgid "The item in the 'by' or 'keyby' list is length %s."
3319-
msgid_plural "The items in the 'by' or 'keyby' list have lengths %s."
3311+
msgid "The item in the 'by' or 'keyby' list is length %s. Each must be length "
3312+
"%d; the same length as there are rows in x (after subsetting if i is "
3313+
"provided)."
3314+
msgid_plural "The items in the 'by' or 'keyby' list have lengths %s. Each "
3315+
"must be length %d; the same length as there are rows in x (after subsetting "
3316+
"if i is provided)."
33203317
msgstr[0] ""
33213318
msgstr[1] ""
33223319

0 commit comments

Comments
 (0)