code
code copied to clipboard
Misspelling on Reports page
Describe the bug
It should be 1 'message' instead of 'messages'
Steps to reproduce
No response
Expected behavior
No response
Additional context
No response
Can I be assigned this issue?
I'm probably overthinking, but I see three ways we could fix this (in order of least preferred to most preferred):
- Replace "messages" with "message(s)"
- Make a utility function to make words plural as necessary, such as the one below
function pluralize(count: number, singular: string, plural: string = `${singular}s`) {
return `${count} ${count === 1 ? singular : plural}`;
}
console.log(pluralize(0, "message")); // 0 messages
console.log(pluralize(1, "message")); // 1 message
console.log(pluralize(2, "message")); // 2 messages
console.log(pluralize(1, "life", "lives")); // 1 life
console.log(pluralize(2, "life", "lives")); // 2 lives
- Use translations. I'm not sure how well the effort to do localization is going, but this option would be the long-term goal in my mind.
if you localize these messages, vintl has a special syntax for pluralizing things in an i18n-friendly way