-
Notifications
You must be signed in to change notification settings - Fork 473
-
Notifications
You must be signed in to change notification settings - Fork 473
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
setLocale, setLocaleCookie functions undefined in useI18n composable when using per-component translations #1857
Comments
me too, these function is not import in useI18n()! my nuxt info here
|
Thank you for your reporting! issue guideline said:
Could you give us it please? 🙏 |
Hello there @kazupon Thank you for maintaining nuxt/i18n. https://stackblitz.com/edit/nuxt-starter-fk8w4s?file=pages/with_translation.vue I managed to narrow down the issue. When per-component translations are provided, the value of setLocale and setLocaleCookie are undefined. When there are no per-component translations, you can find setLocale and setLocaleCookie. I added two pages /with_translation and /without_translation Hopefully this helps. |
when it will release? can i use now? :) |
You can use the edge channel version |
@kazupon Thank you ❤️ !! |
Hello @kazupon, I have the same issue, even if I use the edge version. I forked the @borghol stackbliz sample to reproduce the issue with latest Nuxt and i18n versions. With latest versions:
With edge versions:
With these version it's working well:
But after the next version (8.0.0-beta.11) the issue came back. Thanks |
Thanks! |
Environment
Darwin
v16.17.1
3.2.0
2.2.1
yarn@1.22.10
vite
typescript
,runtimeConfig
,ignore
,build
,css
,modules
,vite
,i18n
@pinia/nuxt@0.4.6
,@nuxtjs/i18n@8.0.0-beta.9
,()
-
Reproduction
An error will be generated:
Uncaught TypeError: i18n.setLocale is not a function
Describe the bug
The i18n composable should be returning:
as they are defined in the type declaration.
However, they do not exist in the object returned by useI18n().
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: