我们在加载时收到此错误。
\n应用程序首先在 URL 处加载http://localhost:3000/,然后当我们切换到 ex: french 时,我们会得到http://localhost:3000/fr,但当我们再次将语言切换到 ex: deutsch 时,我们会得到,http://localhost:3000/de/fr依此类推。新选择的语言路径插入到第一个选择的语言和根 URL 之间。
另外,如果我们直接转到 ex:http://localhost:3000/fr我们会以正确的语言登陆正确的页面。
//i18n.js\nconst NextI18Next = require(\'next-i18next\').default;\n\nmodule.exports = new NextI18Next({\n defaultLanguage: \'en\',\n otherLanguages: [\'fr\', \'de\', \'nl\', \'it\', \'pt\', \'es\'],\n localeSubpaths: {\n en: \'en\',\n fr: \'fr\',\n de: \'de\',\n nl: \'nl\',\n it: \'it\',\n es: \'es\',\n pt: \'pt\',\n },\n});\nRun Code Online (Sandbox Code Playgroud)\n//next.config.js\n\nconst isProd = process.env.NODE_ENV === \'production\';\n\nmodule.exports = {\n exportPathMap: async function (defaultPathMap, { dev, dir, outDir, distDir, buildId }) {\n return …Run Code Online (Sandbox Code Playgroud)