aloisdeniel / flutter_sheet_localization

Generate Flutter localization from a simple online Google Sheets.
282 stars 81 forks source link

Can't use dynamic labels together with pluralization #54

Open marcjoha opened 3 years ago

marcjoha commented 3 years ago

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.

NikoBoerger commented 2 years ago

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