Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Nextjs动态路由器将参数转换为```next-i18next```_Javascript_Reactjs_Next.js_Next I18next - Fatal编程技术网

Javascript Nextjs动态路由器将参数转换为```next-i18next```

Javascript Nextjs动态路由器将参数转换为```next-i18next```,javascript,reactjs,next.js,next-i18next,Javascript,Reactjs,Next.js,Next I18next,使用getstaticpath时是否有转换参数的方法 当使用router.push({pathname,query},asPath,{locale:nextLocale})时,您应该生成所有带有翻译的路径,还是有办法只翻译参数 例如,如果我在getStaticPaths中有路径:{params:{color:'white',size:'big}},这会导致/dogs/white/big,在切换到DE时有/dogs/weiss/gross,而不在路径数组中添加{params:{color:'wei

使用
getstaticpath
时是否有转换参数的方法

当使用
router.push({pathname,query},asPath,{locale:nextLocale})时,您应该生成所有带有翻译的路径,还是有办法只翻译参数

例如,如果我在getStaticPaths中有路径:
{params:{color:'white',size:'big}}
,这会导致
/dogs/white/big
,在切换到
DE
时有
/dogs/weiss/gross
,而不在路径数组中添加
{params:{color:'weiss',size:'gross},locale:'DE}