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
{{ message }}
Repository navigation
Make FluentMessage::attributes() return ExactSizeIterator #263
changed the title [-][Feature Request] Make FluentMessage::Atributes return ExactSizeIterator[/-][+][Feature Request] Make FluentMessage::attributes() return ExactSizeIterator[/+]on Jul 26, 2022
If those are actually variants of the same message, as in same message but varied by tone etc. then maybe it's ok.
But generally, I'd advise you to create them as separate messages and store a Vec of message ids in your code to select from.
Well, reading this link, I would say "yes" to both.
Use variants only if the default variant makes sense for all possible values of the selector.
When using variants, keep in mind that other languages may collapse them into a single variant due to their grammar.
changed the title [-][Feature Request] Make FluentMessage::attributes() return ExactSizeIterator[/-][+]Make FluentMessage::attributes() return ExactSizeIterator[/+]on Nov 7, 2022
Activity
[-][Feature Request] Make FluentMessage::Atributes return ExactSizeIterator[/-][+][Feature Request] Make FluentMessage::attributes() return ExactSizeIterator[/+]juliancoffee commentedon Aug 7, 2022
@zbraniecki do you foresee any problems with this?
zbraniecki commentedon Aug 7, 2022
It may be a case of an explicit antipattern in Fluent - https://github.com/projectfluent/fluent/wiki/Good-Practices-for-Developers#prefer-separate-messages-over-variants-for-ui-logic
If those are actually variants of the same message, as in same message but varied by tone etc. then maybe it's ok.
But generally, I'd advise you to create them as separate messages and store a Vec of message ids in your code to select from.
juliancoffee commentedon Aug 25, 2022
Well, reading this link, I would say "yes" to both.
Otherwise, we wouldn't have them random :)
juliancoffee commentedon Aug 25, 2022
Also to add to this, having it random makes it possible to have a different number of variants in different languages.
[-][Feature Request] Make FluentMessage::attributes() return ExactSizeIterator[/-][+]Make FluentMessage::attributes() return ExactSizeIterator[/+]