vue-i18n-locale-message icon indicating copy to clipboard operation
vue-i18n-locale-message copied to clipboard

cannot work multiple i18n custom blocks

Open kazupon opened this issue 5 years ago • 2 comments

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>

kazupon avatar Aug 30 '19 12:08 kazupon

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.

kazupon avatar Sep 02 '19 10:09 kazupon

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

kazupon avatar Sep 02 '19 10:09 kazupon