1
4

1 回答 1

2

I'm not used to work with the AppLocalizations itself, but it seems to work the same way as intl.

If so, just edit your arb files to receive the desired parameters:

"placed_for": "placed for {date}", 
"placed_for": "{date}  का लागि राखिएको",

then you should be able to use it in the following way:

AppLocalizations.of(context).placed_for(date.toString())

Edit:

You also need to add the placeholder definition to your arb template. Example:

{
  "helloWorld": "Hello {name}!",
  "@helloWorld": {
    "description": "The conventional newborn programmer greeting",
    "placeholders": {
      "name": {}
    }
  }
}

Then, after adding the placeholders, you can use the generated string using:

AppLocalizations.of(context).helloWorld('Leandro'),

PS. You can also add multiples placeholders

于 2021-03-07T19:16:06.077 回答