You need to create i18n folder on root of your project directory.
in i18n/i18n.config.ts define config like this
import fr from "./fr.json"; import en from "./en.json"; export default defineI18nConfig(() => ({ legacy: false, messages: { fr: fr, en: en, }, // baseUrl: url// not working from here }));
And then in nuxt.config.ts
i18n: { debug: true, locales: [ { code: "fr", iso: "fr-BE", dir: "auto" }, { code: "en", iso: "en-GB", dir: "auto" }, ], strategy: "prefix", defaultLocale: "en", // defaultLanguage: "en", detectBrowserLanguage: false, baseUrl: url.substr(0, url.length - 1) || "https://example.com", vueI18n: "./i18n.config.ts", // if you are using custom path, default },
Please note path here is "./i18n.config.ts" somehow i18n lib using directory i18n as its root.
Thanks me later :wink