Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

infuse fails when a directory shares a name with a component at the same level #235

Open
allanlewis opened this issue Mar 3, 2022 · 1 comment

Comments

@allanlewis
Copy link

allanlewis commented Mar 3, 2022

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.

@allanlewis allanlewis changed the title infuse fails when a directory shares a nam with a component at the same level infuse fails when a directory shares a name with a component at the same level Mar 3, 2022
@stephenhebert
Copy link

I've encountered this also. The workaround I use is to move widgets.vue to widgets/index.vue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants