I'm developing a mobile application using flutter / dart. The app needs to be localized using JSON files.
I need to handle the plural / gender in strings. Actually i'm using sprintf library, with some placeholder in the JSON code like:
{
...
"vehiclelabelKmTraveledReadable": "In %s Km",
...
}
so I replaced the '%s' placeholder with a variable value.
The problem is how to handle plurals, like
{
"vehiclePeriod": "Every %s month(s?)"
}
But if %s is 1, it's wrong. Does anybody knows how to manage this kind of cases?
I managed this kind of case using intl package from flutter, but it uses .arb files instead of .json.
Here an example how to handle it with intl package
Hope this can help you get started.