Skip to content

ngettext() shouldn't be used to pluralize formally in some cases #6796

@MichaelChirico

Description

@MichaelChirico

Thank you very much for collecting these!

One more typo (extra ) at the end):

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 would also like to replace the use of ngettext for strings that don't format the count as a number because that prevents proper translation with plurals in some languages, but that can be a separate issue. For your example, that would be

stop_msg = if (length(tt) == 1) {
  gettext("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).")
} else {
  gettext("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).")
}
stopf(stop_msg, brackify(tt),  xnrow, domain = NA)

Originally posted by @aitap in #6787

See this discussion in #6786. There's a proposed patch there but it needs to be paired with some improvements to {potools}, I think. Tabling for now until after release.

Metadata

Metadata

Assignees

No one assigned

    Labels

    translationissues/PRs related to message translation projects

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions