How to achieve a "generic plural"? #1605
-
Problem definitionThinking about cases where for plural forms it's not possible to say what the value for I would say that it makes sense to have a translation record looking like:
Now the question is how to request "a plural" in the code? What would be the value for QuestionSo I guess the questions I have are:
Other optionAlso I could potentially just have a plural form entry in the translation file and request that directly: It just feels off that I have to duplicate these every time and that there would no rule for such case? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
I'm not sure I understand your question. First of all you shouldn't force |
Beta Was this translation helpful? Give feedback.
-
// Extracted from a discussion above:
// 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);
} |
Beta Was this translation helpful? Give feedback.
// Extracted from a discussion above: