1

I want to get translations from locally saved .arb files. I have the below code in a loop. So if the dynamic value matches the value in the .arb files, I get the translation.

 Text(Translation.of(context).!filterTitle ),

Unfortunately, I can't find how to do that. Any help is appreciated. Thank you

Jestin
  • 578
  • 5
  • 10

1 Answers1

2

After 2 days I got the answer. Hopefully will help someone. You need to use the select feature of .arb files

"facetTitle": "{facetTitle, select, age_group{Age Group} product_type{Product Type} collection{Collection} gender{Gender} other {{facetTitle}}

and in dart file use below

S.of(context).facetTitle(text1) 

text1 is the dynamic value which will match with select in .arb file.

Jestin
  • 578
  • 5
  • 10