vue-i18n-locale-message
vue-i18n-locale-message copied to clipboard
cannot work multiple i18n custom blocks
Codes
src/Greeting.vue
:
<template>
...
</template>
<script>
...
</script>
<style>
...
</style>
<i18n>
{
"ja": {
"good_morning": "おはよう"
}
}
</i18n>
<i18n>
{
"ja": {
"good_evening": "こんばんわ"
}
}
</i18n>
reproduction step
vue-i18n-locale-message squeeze -t=./src
vue-i18n-locale-message infuse -t=./src -m=./messages.json
What is expected?
<template>
...
</template>
<script>
...
</script>
<style>
...
</style>
<i18n>
{
"ja": {
"good_morning": "おはよう"
}
}
</i18n>
<i18n>
{
"ja": {
"good_evening": "こんばんわ"
}
}
</i18n>
What is actually happening?
<template>
...
</template>
<script>
...
</script>
<style>
...
</style>
<i18n>
{
"ja": {
"good_evening": "こんばんわ"
}
}
</i18n>
<i18n>
{
"ja": {
"good_evening": "こんばんわ"
}
}
</i18n>
I've patched at https://github.com/kazupon/vue-i18n-locale-message/commit/b226c65ea64afe2a8d83d531dbb4349d17dad416
We need to address #13 in order to solve it fundamentally.
We need to hoist unnecessary i18n blocks when it infused.
e.g. https://github.com/kazupon/vue-i18n-locale-message/commit/b226c65ea64afe2a8d83d531dbb4349d17dad416#diff-0b1e335025c42460aeb948c219e9fb8bR89-R105