Joel
Joel

Reputation: 210

Flutter Localization with ARB files

Actually I was using Arb files for localization in that I don't know how to make and access array type value in .arb files with flutter

Upvotes: 4

Views: 2816

Answers (1)

Petar Bivolarski
Petar Bivolarski

Reputation: 1767

You can simply define your object as a String separated by some common separator:

  "months": "january:february:march:april:may:june:july:august:september:october:november:december",
  "@months": {
    "description": "months"
  },

Then, split the String into an array:

String monthsString = AppLocalizations.of(context)!.months;
List<String> months = monthsString.split(':');

Upvotes: 8

Related Questions