slang
slang copied to clipboard
Support plurals in enums
Describe the bug Im not able to generate translations using enums as params and pluralization.
"assetTypePlural(param=assetType)": {
"stock": {
"one": "{count} ação",
"other": "{count} ações"
},
"stockIndex": {
"one": "{count} índice",
"other": "{count} índices"
}
}
Throws exception in this line:
digestedMap[entry.key] = entry.value as StringTextNode;
type 'PluralNode' is not a subtype of type 'StringTextNode' in type cast
package:slang/builder/builder/translation_model_builder.dart 328:52
This would be a great feature to add ! Looking forward to it :)
The generated code will look quite complicated and I don't know a clean solution for that.
This technically implies, that you can nest any leaf with any other leaf. (Leaves are: String
, RichText
, Plural
, Context (Enum)
)