Nextjs 动态路由器使用 ```next-i18next``` 翻译参数

时间:2021-05-26 08:55:54

标签: javascript reactjs next.js next-i18next

有没有办法在使用 getStaticPaths 时翻译参数?

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

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

0 个答案:

没有答案