When trying to interpolate values in my translation string using vue-i18n I keep getting this error:
Detect 'unknown' type of token
My messages.json
looks as follows:
{ test:
{ "at_location": "At { name }" }
}
Usage:
<p>
{{ $t('test.at_location', { name: location.name }) }}
</p>
Here location.name
is defined perfectly fine, so I wonder what's going wrong...
Interpolations in translation messages should not contain spaces.
Change your messages to:
{ test:
{ "at_location": "At {name}" } // No spaces!
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With