Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Plugin options namespaced doesn't works with enableInSFC #15

Closed
ivomarsan opened this issue Jul 22, 2018 · 4 comments
Closed

Plugin options namespaced doesn't works with enableInSFC #15

ivomarsan opened this issue Jul 22, 2018 · 4 comments
Labels
Type: Bug Bug or Bug fixes

Comments

@ivomarsan
Copy link

Can you add enableInSFC support inside i18n: {} options?
I guess that this option dont recognize inside i18n options object. To solve I go back to outside, like this in my vue.config.js:

module.exports = {
  // ...
  pluginOptions: {
    i18n: {
      locale: 'en', 
      fallbackLocale: 'en', 
      localeDir: 'i18n/locales/messages',
      enableInSFC: true // This Doesn't works!
    },
    enableInSFC: true // This Works!
  }
}
@kazupon
Copy link
Member

kazupon commented Jul 22, 2018

Thank you for your reporting!

Could you provide minimum reproduction repo please?

@ivomarsan
Copy link
Author

Ok, passing in vue.config.js only:

i18n: {
  locale: 'en', 
  fallbackLocale: 'en', 
  localeDir: 'i18n/locales/messages',
  enableInSFC: true
}

And HelloI18n.vue...

<template>
  <p>{{ $t('hello') }}</p>
</template>

<script>
export default {
  name: 'HelloI18n'
}
</script>

<i18n>
{
  "en": {
    "hello": "Hello i18n in SFC!"
  },
  "pt-BR": {
    "hello": "Olá i18n em SFC :)"
  }
}
</i18n>

So, I run npm run serve and receive this error message.
image
When I change my vue.config.js and put enableInSFC outside from i18n, I receive:
image

Everything is ok, now?

@kazupon kazupon added Type: Bug Bug or Bug fixes and removed cannot reproduce labels Jul 23, 2018
@kazupon
Copy link
Member

kazupon commented Jul 23, 2018

I've fixed in v0.4.1
You can try it! :)

@ivomarsan
Copy link
Author

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: Bug Bug or Bug fixes
Projects
None yet
Development

No branches or pull requests

2 participants