easy_localization icon indicating copy to clipboard operation
easy_localization copied to clipboard

Translate a List

Open musiolmarco opened this issue 3 years ago • 4 comments

Is it somehow possible to translate a List? Because everything is working fine, but if I am trying to translate a List in my JSON file, I get this error message:

Expected a value of type 'String?', but got one of type 'List<Map<String, String>>

Or isn't it even possible with this package to translate Lists?

musiolmarco avatar Jun 09 '21 22:06 musiolmarco

translate the individual elements

cedvdb avatar Jun 12 '21 07:06 cedvdb

I do not know if I have understood you correctly, but the List got over 500 items and expands in the future, so I think it would be that smart to do it that way.

I have already solved it myself, using the localization feature of Flutter itself, I only found this package really good and hoped that it might also be possible here, because it is not so much work as if you were doing it "manually".

But still thank you for your idea👍🏻

musiolmarco avatar Jun 13 '21 00:06 musiolmarco

It's specific problem, use .map fuction on list var newList = oldList.map((String e) => e.tr());

Overman775 avatar Jul 15 '21 15:07 Overman775

Slightly different question than the base issue but is supporting Arrays in the JSON on the table ? Such as in i18n.

guillaumeboehm avatar Aug 25 '22 15:08 guillaumeboehm