Flutter / l10n with dynamic parameters?
988
You can do it by providing a placeholder in the .arb file like so:
"weekTitle": "Week {weekNumber}",
"@weekTitle": {
"placeholders": {
"weekNumber": {
"type": "int"
}
}
}
Then in your code you can call it like this:
AppLocalizations.of(context).weekTitle(_calendarWeek)
Author by
MrPistoul
Updated on January 01, 2023Comments
-
MrPistoul over 1 year
How to use l10n with dynamic parameters? like this.
AppLocalizations.of(context)!['dynamic_string']; => Try defining the operator '[]'.
But the class is generated automatically so overwrite with each build. Thx , If anyone has a solution.
Have a good day !
-
MrPistoul over 2 yearsThank you ,but Sadness... :)