Skip to content
This repository has been archived by the owner on Nov 18, 2024. It is now read-only.

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
# for free to join this conversation on GitHub. Already have an account? # to comment
Category
Q&A
Labels
None yet
2 participants