Inès
Inès
NNuxt
Created by Inès on 8/28/2024 in #❓・help
NuxtLink and SSR pages
Well, it seems it was an issue wrt. useAsyncData, data wasn't loaded at the right time. I fixed this and now I don't have this issue anymore. Thanks for following up on it!
6 replies
NNuxt
Created by Inès on 8/28/2024 in #❓・help
NuxtLink and SSR pages
Oh yeah that was a mistake when I pasted the code but indeed in my code it is like that!
6 replies
NNuxt
Created by Inès on 7/16/2024 in #❓・help
CORS error on CSS?
I also use nuxt-security and already checked the https://nuxt-security.vercel.app/documentation/utils/subresource-integrity. Even when disabling the sri option it doesn't work... Moreover I don't think this is something suitable for production so I put it back either way
2 replies
NNuxt
Created by Inès on 7/9/2024 in #❓・help
Have multiple domains use the same locale
Thanks!
20 replies
NNuxt
Created by Inès on 7/9/2024 in #❓・help
Have multiple domains use the same locale
Regarding the initial reason of this post, I will open an issue in the i18n module directly so that one locale can point to several domains
20 replies
NNuxt
Created by Inès on 7/9/2024 in #❓・help
Have multiple domains use the same locale
I only set a fallbackLocale, not a defaultLocale... Thanks a lot @xibman!
20 replies
NNuxt
Created by Inès on 7/9/2024 in #❓・help
Have multiple domains use the same locale
I think that's it
20 replies
NNuxt
Created by Inès on 7/9/2024 in #❓・help
Have multiple domains use the same locale
As per the cookie config I don't think I have something like that set no, I put all my i18n-related config in my first post
20 replies
NNuxt
Created by Inès on 7/9/2024 in #❓・help
Have multiple domains use the same locale
The question that remains, still, is, how to overwrite this en-US default to force it to something else...
20 replies
NNuxt
Created by Inès on 7/9/2024 in #❓・help
Have multiple domains use the same locale
I was hoping I wouldn't be right 😂
20 replies
NNuxt
Created by Inès on 7/9/2024 in #❓・help
Have multiple domains use the same locale
(that's my conclusion after so many hours spent on this issue, but not sure about it)
20 replies
NNuxt
Created by Inès on 7/9/2024 in #❓・help
Have multiple domains use the same locale
I cleared the cookies but still (I didn't find any cookie saying en-US btw)
20 replies
NNuxt
Created by Inès on 7/9/2024 in #❓・help
Have multiple domains use the same locale
I think what the nuxt config does is that it searches for the 1st code occurrence and matches it against its corresponding domain So 2 domains declared for the same code won't work
20 replies
NNuxt
Created by Inès on 7/9/2024 in #❓・help
Have multiple domains use the same locale
But if I do so, it won't work, it will still default to en-US for some reason
20 replies
NNuxt
Created by Inès on 7/9/2024 in #❓・help
Have multiple domains use the same locale
@xibman Actually the locale fallback works well for display, I have all messages displayed in english... BUT the thing is, when I print the value of useI18n().locale it displays en-US if I am on http://localhost:3002 which bothers me because I would really like it to be simply en
20 replies
NNuxt
Created by melanie on 4/30/2024 in #❓・help
i18n runtimeConfig different domains not working
And finally:
// i18n.config.ts
import en from './locales/en.json'
import fr from './locales/fr.json'
import de from './locales/de.json'
import it from './locales/it.json'
import nl from './locales/nl.json'
import es from './locales/es.json'
import pt from './locales/pt.json'

export default defineI18nConfig(() => ({
legacy: false,
globalInjection: true,
fallbackLocale: 'en',
messages: {
en,
fr,
it,
de,
nl,
es,
pt
}
}))
// i18n.config.ts
import en from './locales/en.json'
import fr from './locales/fr.json'
import de from './locales/de.json'
import it from './locales/it.json'
import nl from './locales/nl.json'
import es from './locales/es.json'
import pt from './locales/pt.json'

export default defineI18nConfig(() => ({
legacy: false,
globalInjection: true,
fallbackLocale: 'en',
messages: {
en,
fr,
it,
de,
nl,
es,
pt
}
}))
Using the npm run dev command (bound to nuxt dev --port=3002 --host in my package.json) I can run it locally and my server is served through it.localhost:3002, de.localhost:3002.... NB: It also worked when I declared several env variables with NUXT_PUBLIC_I18N_LOCALES_UK_DOMAIN and so on, but I didn't want too many env variables so I managed the locale subdomain directly in the nuxt.config.ts Hope it helps
22 replies
NNuxt
Created by melanie on 4/30/2024 in #❓・help
i18n runtimeConfig different domains not working
Hello, this is what worked for me:
// .env
NUXT_PUBLIC_MY_DOMAIN=localhost:3002

// nuxt.config.ts
i18n: {
strategy: 'no_prefix',
differentDomains: true,
detectBrowserLanguage: false,
locales: [
{
code: 'de',
iso: 'de-DE',
domain: `de.${process.env.NUXT_PUBLIC_MY_DOMAIN}`
},
{
code: 'en',
iso: 'en-GB',
domain: process.env.NUXT_PUBLIC_MY_DOMAIN
},
{
code: 'es',
iso: 'es-ES',
domain: `es.${process.env.NUXT_PUBLIC_MY_DOMAIN}`
},
{
code: 'fr',
iso: 'fr-FR',
domain: `fr.${process.env.NUXT_PUBLIC_MY_DOMAIN}`
},
{
code: 'it',
iso: 'it-IT',
domain: `it.${process.env.NUXT_PUBLIC_MY_DOMAIN}`
},
{
code: 'nl',
iso: 'nl-NL',
domain: `nl.${process.env.NUXT_PUBLIC_MY_DOMAIN}`
},
{
code: 'pt',
iso: 'pt-PT',
domain: `pt.${process.env.NUXT_PUBLIC_MY_DOMAIN}`
}
]
},
// .env
NUXT_PUBLIC_MY_DOMAIN=localhost:3002

// nuxt.config.ts
i18n: {
strategy: 'no_prefix',
differentDomains: true,
detectBrowserLanguage: false,
locales: [
{
code: 'de',
iso: 'de-DE',
domain: `de.${process.env.NUXT_PUBLIC_MY_DOMAIN}`
},
{
code: 'en',
iso: 'en-GB',
domain: process.env.NUXT_PUBLIC_MY_DOMAIN
},
{
code: 'es',
iso: 'es-ES',
domain: `es.${process.env.NUXT_PUBLIC_MY_DOMAIN}`
},
{
code: 'fr',
iso: 'fr-FR',
domain: `fr.${process.env.NUXT_PUBLIC_MY_DOMAIN}`
},
{
code: 'it',
iso: 'it-IT',
domain: `it.${process.env.NUXT_PUBLIC_MY_DOMAIN}`
},
{
code: 'nl',
iso: 'nl-NL',
domain: `nl.${process.env.NUXT_PUBLIC_MY_DOMAIN}`
},
{
code: 'pt',
iso: 'pt-PT',
domain: `pt.${process.env.NUXT_PUBLIC_MY_DOMAIN}`
}
]
},
(the rest continues in another message)
22 replies
NNuxt
Created by deetstrab on 6/30/2024 in #❓・help
Reactively add/remove a class name to <body>, from within a component...
But indeed, as the doc says (https://nuxt.com/docs/api/composables/use-head), bodyAttrs is non-reactive...
45 replies
NNuxt
Created by deetstrab on 6/30/2024 in #❓・help
Reactively add/remove a class name to <body>, from within a component...
You should use: useHead({ bodyAttrs: { class: 'YOUR-CLASS-NAME' } })
45 replies
NNuxt
Created by Inès on 6/27/2024 in #❓・help
Stop fetching favico on every request
Works perfectly! Many thanks @manniL always good to have someone to see with brand new 👀 !
13 replies