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
Doesn't read the locales folder #1900
Comments
The directory can be set using the So you probably want to do the following, if you haven't changed the // nuxt.config inside your config
i18n: {
langDir: 'locales',
} The docs doesn't mention this, but Line 67 in 045d7e6
|
Thank you for your reporting! |
Updated the issue with the reproduction link! |
You need to configure which locales and files are to be used by the module as the error message notes, this is done in a list of object on key If you change your i18n config to the following it should all work as expected. i18n: {
langDir: 'locales',
locales: [{ code: 'en', file: 'en.yml' }],
}, Check out the guides in the docs for more info, if anything is unclear perhaps we may be able to improve the docs. |
Thanks a lot, it works! But then I have two observations: All these information are missing in the migration guide from
|
Addressed in #1921. |
Environment
Windows_NT
v16.13.1
3.2.3
2.2.3
[email protected]
vite
extends
,ssr
,routeRules
,runtimeConfig
,typescript
,css
,i18n
,modules
,alias
,vite
nuxt-icon@^0.3.2
,@nuxtjs/[email protected]
,@vueuse/[email protected]
,@nuxt/[email protected]
-
Reproduction
- Create alocales
dir and add a fileen.yml
with a text line used in the app.https://stackblitz.com/edit/github-ev7oxu?file=nuxt.config.ts
Describe the bug
Contrary to what
@intlify/nuxt3
was doing,@nuxtjs/i18n
doesn't read the./locales
folder by default, nor it allows to define alocaleDir
.Possibly related to #1890.
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: