Comments (5)
Hi @BobbieGoede. I have made a minimal reproduction at https://github.com/MikeBellika/nuxti18nrepro/. Let me know if there's more I can do to help.
Note that the bug doesn't seem to reproduce on stackblitz. I had to run it on my machine to get it to fail.
PS. As @AliakseiMatsuk said 3.1.1 seems to work and 3.2.0 also works
from i18n-module.
I think I've found a fix. Setting the locales
option in nuxt.config
seems to be required. I've made a branch on my reproduction repo, where you can see the fix: https://github.com/MikeBellika/nuxti18nrepro/blob/3d4615be16322a356e8d6f86fae5e1e4d8682338/nuxt.config.ts#L8
export default defineNuxtConfig({
devtools: { enabled: true },
modules: ["@nuxtjs/i18n"],
i18n: {
vueI18n: "./i18n.config.ts",
strategy: "no_prefix",
locales: ["en", "fr"], // <--- Important
},
});
I think it's probably caused by this line:
Line 132 in 6223696
There's mention in the docs about setting the locales
option, but it's "hidden" under link localizing, so I missed it. There's also no mention in the changelog that I can see.
@BobbieGoede is this a bug or a docs issue? And let me know if there's something I can do :)
from i18n-module.
I can confirm that it is not working on 8.3.0 and on 8.1.1 it works just fine, this issue took me like 2 hours to solve before I found this.
from i18n-module.
Would you be able to provide a reproduction? 🙏
More info
Why do I need to provide a reproduction?
Reproductions make it possible for us to triage and fix issues quickly with a relatively small team. It helps us discover the source of the problem, and also can reveal assumptions you or we might be making.
What will happen?
If you've provided a reproduction, we'll remove the label and try to reproduce the issue. If we can, we'll mark it as a bug and prioritise it based on its severity and how many people we think it might affect.
If needs reproduction
labeled issues don't receive any substantial activity (e.g., new comments featuring a reproduction link), we'll close them. That's not because we don't care! At any point, feel free to comment with a reproduction and we'll reopen it.
How can I create a reproduction?
We have a couple of templates for starting with a minimal reproduction:
👉 Reproduction starter (v8 and higher)
👉 Reproduction starter (edge)
A public GitHub repository is also perfect. 👌
Please ensure that the reproduction is as minimal as possible. See more details in our guide.
You might also find these other articles interesting and/or helpful:
from i18n-module.
Started a new project still not working
from i18n-module.
Related Issues (20)
- page alias no have prefix
- Can not use custom path with i18n in nuxt.config.ts HOT 2
- docs: Add note/link about i18n-t,… on components api page HOT 1
- Mobile adaptation problem of nuxt/i18n in nuxt3 HOT 1
- I18n configured the pages option and set customRoutes to true. The file path is also present, but the terminal reported an error stating that the route does not exist HOT 2
- Regression: Retrieve object nodes HOT 1
- how can I support returning objects or arrays from the language file? HOT 1
- Content with github source driver HOT 1
- useLocalePath() and then <NuxtLinkLocale> wrongly encoding paths for some uris HOT 1
- Can't match types i18n nuxt.config.ts
- useCookieLocale() does not work in server context (SSR)
- useRoute('login') does not work, it expects useRoute('login__LOCALE') HOT 11
- When override locales from Layer, I get an error: When using the langDir option the locales must be a list of objects. How to override Layer configuration from project layer? HOT 3
- Multi-Domain Website configuration with partial shared domains
- Cannot set headers after they are sent to the client - i18n cookie + redirect from auth middleware HOT 1
- Locale is back to default upon navigating HOT 1
- [BUG?]: Locale resolver scans `srcDir` instead of `rootDir` HOT 2
- detectBrowserLanguage does not work in production HOT 3
- undefined title in google SERP? HOT 3
- Unexpected token 'pages' HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from i18n-module.