vue-i18n-locale-message
vue-i18n-locale-message copied to clipboard
`infuse` fails when a directory shares a name with a component at the same level
I have a directory structure something like this:
pages/
├── widgets.vue
└── widgets/
├── create.vue
└── list.vue
When I run infuse
, I get garbled i18n
blocks in widgets.vue
, something like this:
<i18n lang="yaml">
en-GB:
foo: bar
create:
foo: bar
list:
foo: bar
It seems to be taking the messages from the sub-components - create
and list
- and putting them into widgets.vue
. Presumably it's getting confused between widgets.vue
and the widgets
directory.
Here are the commands I'm using:
"i18n:squeeze": "vue-i18n-locale-message squeeze --target src --split --output messages",
"i18n:infuse": "vue-i18n-locale-message infuse --target src --locales messages --match '^([\\w-]*)\\.json$'",
Is there some additional option I need to use, or do I need to rename my files? I'm using nuxt
, so the filenames represent paths; renaming them might be difficult.
I've encountered this also. The workaround I use is to move widgets.vue to widgets/index.vue.