A.A
A.A

Reputation: 4161

Flutter advanced l10n

{
    "helloWorldOn": "Hello World on {date}",
    "@helloWorldOn": {
      "description": "A message with a date parameter",
      "placeholders": {
        "date": {
          "type": "DateTime",
          "format": "yMd"
        }
      }
    }
}

I have two question

1- How can I extend formatter to add additional calendar and formats, like jyjMjd for jalaali calendar, Consider that I want to add additional formatter, I passed an DateTime as argument and the formatter decides about calendar

2- How can I support additional type, i.e. my own defined classes

Upvotes: 0

Views: 418

Answers (1)

lsaudon
lsaudon

Reputation: 1468

I find the solution:

{
  "helloWorldOn": "Hello World on {date}",
  "@helloWorldOn": {
    "description": "A message with a date parameter",
    "placeholders": {
      "date": {
        "type": "DateTime",
        "format": "yMd",
        "isCustomDateFormat": "true"
      }
    }
  }
}

Upvotes: 2

Related Questions