'How can I use translations in my data tags
I have installed i18n into my Nuxt project, I have created the json files for the languages and the translations are working fine for normal content tags:
<li class="font-bold">
{{ $t('ScholarshipPage.scholBullet3.data') }}
</li>
However, I am trying to translate data tags, but they are not working:
Originally I tried
pageNavigation: [
{
link: '/information',
title: {{ $t('InfoPage.infoLink1.data') }},
},
],
But it throws an error - property assignment expected, so I removed the double braces
pageNavigation: [
{
link: '/information',
title: $t('InfoPage.infoLink1.data'),
},
],
This throws an error - can't access property "_normalized", next is undefined
Is it possible to use translations in data tags, or will I need to rewrite the tags using standard markup?
thanks
Ok I have updated my menu to o use compute
},
computed:
mainMenu [
{
title: this.$t('MainMenu.aboutMenu.data'),
link: '#',
subMenu: [
{
title: this.$t('MainMenu.aboutSubMenu1.data'),
link: '/about',}, ],
data() {
return {
SeDB,
searchToggle: false,
mobileMenu: false,
searchInput: null,
}
},
But my page doesn't render at all now
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
