Skip to content

Commit 7217a25

Browse files
authored
fix: cannot resolve linked refer message that has hypen (#1550)
1 parent 272555e commit 7217a25

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

packages/vue-i18n-core/test/issues.test.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -987,6 +987,34 @@ test('issue #1392', async () => {
987987
expect(wrapper.html()).toEqual(`<div> component: works<br> t: works</div>`)
988988
})
989989

990+
test('issue #1538', async () => {
991+
const i18n = createI18n({
992+
legacy: false,
993+
locale: 'en',
994+
fallbackLocale: 'en',
995+
messages: {
996+
en: {
997+
'my-message': {
998+
the_world: 'the world',
999+
dio: 'DIO:',
1000+
linked: '@:my-message.dio @:my-message.the_world !!!!'
1001+
}
1002+
}
1003+
}
1004+
})
1005+
1006+
const App = defineComponent({
1007+
setup() {
1008+
const { t } = useI18n()
1009+
return { t }
1010+
},
1011+
template: `<div>{{ t('my-message.linked') }}</div>`
1012+
})
1013+
const wrapper = await mount(App, i18n)
1014+
1015+
expect(wrapper.html()).toEqual('<div>DIO: the world !!!!</div>')
1016+
})
1017+
9901018
test('issue #1547', async () => {
9911019
const i18n = createI18n({
9921020
legacy: false,

0 commit comments

Comments
 (0)