Linked messages cannot support non-nested syntax
fuping685 opened this issue · 1 comments
fuping685 commented
Reporting a bug?
It works fine when I use nested syntax
const messages = {
en: {
message: {
hello: 'Hello',
hello_link: '@:message.hello'
}
}
}
<div>{{ $t('message.hello_link') }}</div> // Hello
It shows nothing when I use non-nested syntax
const messages = {
en: {
'message.hello': 'Hello',
'message.hello_link': '@:message.hello'
}
}
<div>{{ $t('message.hello_link') }}</div> // Nothing is shown
Expected behavior
It works normally in version 8.x
Reproduction
N/A
System Info
N/A
Screenshot
No response
Additional context
No response
Validations
- Read the Contributing Guidelines
- Read the Documentation
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussions
kazupon commented
Thank you for your reporting!
when you use the key of object path, you need to put flatJson: true
to createI18n
.
Then vue-i18n will flatten the message
.
Thanks!