vue-i18n
vue-i18n copied to clipboard
tm dont replace linked messages
Reporting a bug?
i18n().tm('key') dont replace linked messages (@:messages.bla.key)
Expected behavior
Key values should be replaced
Reproduction
1:
{
key1: 'key1 value',
key2: 'key2 value',
keys: ['@:my.key1', '@:my.key2', 'v3'],
}
tm('keys')
2: https://stackblitz.com/edit/vitejs-vite-uokaba?file=src%2FApp.vue
3:
test('linked message', async () => {
const i18n = createVueI18n({
locale: 'en',
messages: {
en: {
key1: 'value1',
key2: 'value2',
keys: ['@:key1', '@:key2', 'value3']
}
}
})
const messages = i18n.tm('keys')
expect(messages).toEqual(['value1', 'value2', 'value3'])
})
System Info
System:
OS: macOS 14.2.1
CPU: (8) arm64 Apple M2
Memory: 87.69 MB / 24.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.16.0 - ~/.nvm/versions/node/v18.16.0/bin/node
npm: 9.5.1 - ~/.nvm/versions/node/v18.16.0/bin/npm
pnpm: 8.6.1 - ~/Library/pnpm/pnpm
Browsers:
Chrome: 120.0.6099.129
Safari: 17.2.1
Screenshot
Additional context
No response
Validations
- [X] Read the Contributing Guidelines
- [X] Read the Documentation
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A open a GitHub Discussions