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

Per-component translations not working with Options API #2514

Closed
TheDutchCoder opened this issue Oct 21, 2023 · 4 comments
Closed

Per-component translations not working with Options API #2514

TheDutchCoder opened this issue Oct 21, 2023 · 4 comments

Comments

@TheDutchCoder
Copy link

Environment


  • Operating System: Darwin
  • Node Version: v20.7.0
  • Nuxt Version: 3.8.0
  • CLI Version: 3.9.1
  • Nitro Version: 2.7.0
  • Package Manager: [email protected]
  • Builder: -
  • User Config: app, modules, i18n, devtools, build, experimental
  • Runtime Modules: @nuxtjs/[email protected]
  • Build Modules: -

Reproduction

No need, there's no way to use per-component translations with the Options API currently.

Describe the bug

Vue3 (and by extension Nuxt3) officially supports both the Options API and Composition API.
This module should provide per-component translations with the Options API, like we had for Nuxt2.

Additional context

No response

Logs

No response

@TheDutchCoder
Copy link
Author

I did find an undocumented component <i18n-t></i18n-t> that actually seems to work, but it's not a good alternative, as it would mean having to change the source code of hundreds of components in a big project.

What I don't fully understand is why the local version of $t is not provided by default? Couldn't we get something like $tl for the locally scoped version of $t?

Copy link
Collaborator

kazupon commented Oct 23, 2023

I seem this is upstream (vue-i18n-next).
Could you try to reproduce the below stackblize template, please? 🙏
https://stackblitz.com/edit/vitejs-vite-gfrx6w

if you will get the issue, please open a new issue at vue-i18n-next repo

@TheDutchCoder
Copy link
Author

TheDutchCoder commented Oct 23, 2023

Okay I'll create an issue there: intlify/vue-i18n#1603

Copy link
Collaborator

kazupon commented Oct 27, 2023

close, so upstream issue.

@kazupon kazupon closed this as not planned Won't fix, can't repro, duplicate, stale Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants