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
this.$i18n.locales is undefined when using yaml-loader #205
Comments
On second inspection, it seems that enabling Edit: |
@jovanmaric, I watched your code and library code, it's hard to say why this happens, try asking a question in their repository. |
The same problem occurs when using Component based localization with vue-i18n. I don't think it's related to YAML. |
I just came back to this issue and this time it works. I could be totally off here, but in my code I am no longer using the |
I'm unable to test this unfortunately, as I switched to app wide localization, to improve reusability. This issue can be closed as both @iliyaZelenko and @sambrezo are referring to the vue-i18n as the major culprit. Edit: Hope github delegates the closing of an issue to cmty...... it does |
I'm facing the same issue:
It does not matter if it's YAML or JSON. I don't know if this bug should be nuxt-i18n responsability or vue-i18n responsability, but there is a bug. |
When I remove the custom i18n block from the component it works again... magic isn't it? ;) |
As a temporary workaround I add these lines in a
|
Thanks for the workaround. |
Thanks for the workaround! Just for future reference, if you're using SSR, you should put those two lines in the |
Version
v5.3.0
Reproduction link
https://github.com/jovanmaric/nuxti18n-yaml
Steps to reproduce
yarn dev
.this.$i18n.locales
outputting an arrayyarn dev
undefined
What is expected ?
That
this.$i18n.locales
returns the locales array even when using component tags.What is actually happening?
It seems like either vue-i18n-loader or yaml-loader are polluting the
this.$i18n
namespaceAdditional comments?
I've looked at the src, but im not sure how to fix this without side effects.
this.i18n
seems to be where Vue-i18n is bound to by default, and nuxt-i18n extends on this behaviour.The text was updated successfully, but these errors were encountered: