Please help. I am trying i18n with Nuxt 3 using @nuxtjs/i18n package and hit a road block retrieving arrays form translation documents as is. The value comes as abstract syntax tree using $tm, as below:
Whats expected is
[
{
"title": "Title 1",
"description": "Description 1",
"price": "Price 1"
},
{
"title": "Title 2",
"description": "Description 2",
"price": "Price 2"
}
]
but what i receive is
[
{
"title": {
"type": 0,
"start": 0,
"end": 7,
"loc": {
"start": {
"line": 1,
"column": 1,
"offset": 0
},
"end": {
"line": 1,
"column": 8,
"offset": 7
},
"source": "Title 1"
},
...
...
..
here is the sample code of the test page, with the issue
<i18n lang="json">
{
"en": {
"summary": [
{
"title": "Title 1",
"description": "Description 1",
"price": "Price 1"
},
{
"title": "Title 2",
"description": "Description 2",
"price": "Price 2"
}
]
}
}
</i18n>
<template>
<div>
<div>
<pre>{{ $tm('summary') }}</pre>
</div>
</div>
</template>
<script setup>
const { t, tm, rt } = useI18n()
</script>
Codesandbox reproduction
Can someone help how to properly retrive arrays and objects as is from translation messages? It used to work as expected in previous version of i18n with Nuxt 2 and $t
Thank you