You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How to write in the template a conditional block to display a plural or singular label? Say, my json is something like this:
{ "title": "...", "responses": 4 }
I want my template to be something like this:
{title}, {responses} responses.
But for that, if there's 1 response (in this example) I have to determine in the template if the value {responses} is 0, 1, or many. For multilingual purposes, I need all three labels "no responses", "one response" and "X responses" to be in the template.
But how?
The text was updated successfully, but these errors were encountered:
However the best way would be to create a helper that calls out to something like FormatJS and uses real MessageFormat syntax, because different languages have different pluralization needs. FormatJS even supports Dust templates :)
How to write in the template a conditional block to display a plural or singular label? Say, my json is something like this:
{ "title": "...", "responses": 4 }
I want my template to be something like this:
{title}, {responses} responses.
But for that, if there's 1 response (in this example) I have to determine in the template if the value {responses} is 0, 1, or many. For multilingual purposes, I need all three labels "no responses", "one response" and "X responses" to be in the template.
But how?
The text was updated successfully, but these errors were encountered: