Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter Localization with ARB files

Tags:

flutter

dart

arb

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

like image 936
Joel Avatar asked Sep 19 '25 22:09

Joel


1 Answers

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(':');
like image 136
Petar Bivolarski Avatar answered Sep 23 '25 09:09

Petar Bivolarski