flutter_sheet_localization icon indicating copy to clipboard operation
flutter_sheet_localization copied to clipboard

Can't use dynamic labels together with pluralization

Open marcjoha opened this issue 2 years ago • 1 comments

Dynamic labels in a plural value are not replaced. If i have the below definitions then {{count}} will not be expanded in the second translation.

key: selected(Plural.one)
en: 1 item selected 

key: selected(Plural.multiple)
en: {{count}} items selected

Not mentioned in the docs so unsure whether a bug or just not yet implemented.

marcjoha avatar Jul 21 '21 06:07 marcjoha

The way I use it is, that for the Plural.one version I also use the exact same dynamic label as for the Plural.multiple. So you'd have "{{count}} item selected". Of course you always put the number 1 into it.

Looking at the how the code generation works, I think you need to do it that way in order for it to function correctly. So when you have a key using a dynamic label, I think every pluralized form needs this dynamic label. Even if it's Plural.zero or Plural.one

NikoBoerger avatar Oct 23 '21 11:10 NikoBoerger