我有一组不同的单词列表。所有这些都经过翻译,其结构如下:
{
"default_sets": [
{
"title": "Animals",
"elements": [
"Squirrel",
"Dog",
]
},
{
"title": "Cities",
"elements": [
"Madrid",
"London",
]
}
}
要动态获取此翻译集,请执行以下操作:
AppLocalizations.of(context).translate('default_sets')
,但返回的内容如下:
[{title: Animals, elements: [Squirrel, Dog...
我收到此错误:
Unexpected character (at character 3)
[{title: Animals, elements: [Squirrel, Dog...
^
我知道这是因为翻译删除了引号而引起的,但是我可以同时翻译和解码吗?