-
Notifications
You must be signed in to change notification settings - Fork 764
feat(module): support i18n in components #2553
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
Conversation
commit: |
There's a way to override. I'm just now in the process of writing documentation to make it clear how to work with this. It's very simple. Nuxt I18n or Vue I18n will work in parallel, that's no problem. Using them internally I consider overkill. But if sometime later you want to migrate to these packages, you can do it very quickly |
Looked |
You want to install |
While making the |
Then leave the current implementation in place? It is universal and will work as it should |
Could we pass a string to the <script setup>
const { locale } = useI18n()
</script>
<template>
<UApp :locale="locale" />
</template> And maybe we could use the App Config to change the locales? π€ |
It will increase the build. Not everyone needs a lot of languages, usually 1-2.
I don't think there's much point to it. Again, not to inflate the build. |
I'll get back to this PR tomorrow, I'll add examples in several languages to the documentation |
@benjamincanac has split the documentation into Nuxt and Vue. The differences are minimal, but they are there |
@hywax I've pushed 4 commits with updated docs and exposed |
Already checked it out, everything looks great! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work! Thanks a lot @hywax π
Would it be a good idea to expose a // uiLocaleOverrides.ts
import type { UILocale} from `@nuxt/ui/locale'`
const myLocaleOverrides: UILocale {
name: 'custom',
ui: {
inputMenu: {
noMatch: 'My custom message',
}
}
}
export default myLocaleOverrides; <script setup>
import uiLocaleOverrides from './uiLocaleOverrides'
</script>
<template>
<UApp :locale="uiLocaleOverrides">
<NuxtPage />
</UApp>
</template> |
Good idea! I think it's very easy to do. I'll add it tonight |
Should I wait to merge this? |
Yes π |
@benjamincanac @hywax |
@malik-jouda Feel free to open a PR that targets this π |
@benjamincanac I added a |
You can just put it inside |
Done! All that's left is to write the documentation |
Let's go to v3 branch π |
Thanks a lot!! π |
@hywax Now that I think of it, is the |
π Linked issue
Resolves #2512
β Type of change
π Description
It's easy to use:
π Checklist