Skip to content
Discussion options

You must be logged in to vote

Ok I see! So createLocalizedPathnamesNavigation is really intended to be run with static strings, with the main benefit being strict types across your code base (e.g. enabling autocomplete).

So I think you have these options:

  1. Use createLocalizedPathnamesNavigation and define at least some segments there (easiest)
export const pathnames = {
  '/products/[slug]': {
    en: '/products/[slug]',
    de: '/produkte/[slug]'
  }
}
  1. Fetch base pathnames during the build of the app and provide them via an env param
  2. Use a catch-all segment
// [locale]/[[...slug]]
async function Page({params: {slug}}) {
  const page = await getPageFromCMS(slug);
  if (page.type === 'products') {
    return <Produc…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@amannn
Comment options

Answer selected by GetWrecked99
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants