nuxt3
nuxt3 copied to clipboard
[Question] Does this module support route prefixes?
Does this module support route prefixes as described here in nuxt/i18n documentation.
None of these strategies work in my nuxt.config.ts
My nuxt.config.ts
file.
import { defineNuxtConfig } from "nuxt";
// https://v3.nuxtjs.org/api/configuration/nuxt.config
export default defineNuxtConfig({
modules: ["@nuxtjs/prismic", "@intlify/nuxt3", "@nuxtjs/color-mode"],
prismic: {
endpoint: "https://studio-022.prismic.io/api/v2",
},
intlify: {
localeDir: "locales",
strategy: "prefix_except_default",
vueI18n: {
defaultLocale: "en",
locale: "sr-latn",
fallbackLocale: "en",
},
},
});
Does this feature require additional option configuration or is it not supported at all?
@belegisanin Nuxt community create i18 branch for Nuxt3 https://github.com/nuxt-community/i18n-module/tree/next
packege.json
"devDependencies": {
"@nuxtjs/i18n": "npm:@nuxtjs/i18n-edge",
"nuxt": "^3.0.0-rc.5"
},
Im using it, basic function work properly. Prefix works too)) /en/profile /uk/profile etc
@belegisanin Nuxt community create i18 branch for Nuxt3 https://github.com/nuxt-community/i18n-module/tree/next
packege.json
"devDependencies": { "@nuxtjs/i18n": "npm:@nuxtjs/i18n-edge", "nuxt": "^3.0.0-rc.5" },
Im using it, basic function work properly. Prefix works too)) /en/profile /uk/profile etc
Is RC5 compatible with the i18n-edge? for some reason I am getting an error after upgrading from RC3 to RC5
@CatalinGheorghiu
No problem
![Снимок экрана 2022-07-18 в 12 00 12](https://user-images.githubusercontent.com/48009651/179478382-65d4f02a-e773-4d9f-b33c-50d819786254.png)
![Снимок экрана 2022-07-18 в 12 00 33](https://user-images.githubusercontent.com/48009651/179478410-ca7988c2-47af-4f86-97ad-73f5c093e561.png)
![Снимок экрана 2022-07-18 в 12 00 56](https://user-images.githubusercontent.com/48009651/179478424-794e55af-a339-4add-a0e1-89d10a98623c.png)
@CatalinGheorghiu Received same trouble after upgrading (yarn upgrade) But yesterday was new commit on community-i18n, with the last one work perfectly in dev and in production versions.
Try now!
@SVV-team works well except one thing. For me, whenever I change the language within language switcher, the translations are empty, but if i refresh the page, they are shown. Have you tried this?
@Catalin-G With config in this message - work perfectly I am already have site in production with translations
Switcher
<NuxtLink v-for="locale in availableLocales"
:to="switchLocalePath(locale.code)"
:key="locale.code" class="dropdown-item">{{ locale.name }}
</NuxtLink>
Maybe trouble with your page / component. Must be only one root "div", if no, behavior is unpredictable
@CatalinGheorghiu
No problem
![]()
![]()
![]()
Yeah, it's running normally. Thank you
@Catalin-G With config in this message - work perfectly I am already have site in production with translations
Switcher
<NuxtLink v-for="locale in availableLocales" :to="switchLocalePath(locale.code)" :key="locale.code" class="dropdown-item">{{ locale.name }} </NuxtLink>
Maybe trouble with your page / component. Must be only one root "div", if no, behavior is unpredictable
Hello, I have a problem. How can I access the $I18N instance in script setup
@Catalin-G With config in this message - work perfectly I am already have site in production with translations Switcher
<NuxtLink v-for="locale in availableLocales" :to="switchLocalePath(locale.code)" :key="locale.code" class="dropdown-item">{{ locale.name }} </NuxtLink>
Maybe trouble with your page / component. Must be only one root "div", if no, behavior is unpredictable
Hello, I have a problem. How can I access the $I18N instance in script setup
I found a solution to the problem
in the can use
const {vueApp} = useNuxtApp(); const i18n = vueApp.i18n;