我有一个使用 i18n 进行国际化路由的网站,它工作正常,但现在我们也想翻译、本地化 slugs。
例如,我们有这个路线/integrations-and-plugins 例如:3 个语言环境,en de 和 hu 我们希望:
(+此外它还有一个集成和插件/*id,但并不重要)
这是我的下一个配置相关部分:
const bundleAnalyzer = require('@next/bundle-analyzer')({
enabled: !!process.env.BUNDLE_ANALYZE,
})
module.exports = bundleAnalyzer({
images: {
domains: ['cdn.builder.io'],
},
async headers() {
return [
{
source: '/:path*',
headers: [
// this will allow site to be framed under builder.io for wysiwyg editing
{
key: 'Content-Security-Policy',
value: 'frame-ancestors https://*.builder.io https://builder.io',
},
],
},
]
},
async rewrites() {
return [
{
source: '/hu/integracios-es-ellenorzesi/',
destination: '/hu/integrations-and-plugins/',
locale: false,
}, …Run Code Online (Sandbox Code Playgroud)