Skip to content

Possible to have fbt.param inside fbt.plural? #196

Answered by jrwats
alexandernanberg asked this question in Q&A
Discussion options

You must be logged in to vote

Yeah fbt.plural is limited to static strings. Simplest would be to just use an if/else. Some day... we'll support the parsing of ternaries which would enable you group this into one construct, but I'm not sure it'd be more readable than the below

if (count === 1) {
  return fbt(fbt.param('name', ...) + 'was published', ...);
} else {
  return fbt(fbt.param('count', count) + 'episodes were published', ...);
}

Replies: 1 comment

Comment options

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