Skip to content

How to achieve a "generic plural"? #1605

Answered by MichalBryxi
MichalBryxi asked this question in Q&A
Discussion options

You must be logged in to vote

// Extracted from a discussion above:

The generic plural doesn't really exist since it depends on the default plural AND gender form of words in a language (e.g some lang by default assume gender/plurality of things to be male/plural while other female/singular depending on what that thing is).

You just declare emails, names, phone numbers as is with that context and translators take care of that. And join them w/ ListFormat.

// this.args.types = ['emails', 'names', 'phone numbers];
get typesString() {
  const typesTranslated = this.args.types.map((type) => this.intl.t(type));
  return new Intl.ListFormat('en', { style: 'long', type: 'conjunction' }).format(typesTranslated);
}
{{t "Th…

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
7 replies
@gnclmorais
Comment options

@longlho
Comment options

@MichalBryxi
Comment options

@longlho
Comment options

@MichalBryxi
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by MichalBryxi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants