Next js: not getting locale in dynamic Route after deployment

27 Views Asked by At
export async function getStaticProps({ params, locale }) {
  const { slug } = params;
  // Fetch post data based on the slug
  const post = await getPost(slug);

  return {
    props: {
      ...(await serverSideTranslations(locale, ["common"])),
      post,
    },
  };
}

export async function getStaticPaths({}) {
  return {
    paths: [],
    fallback: true
  };
}

Using I18 next for the translation in a next js project. In my localhost it is working fine. But after deploymwnt, I am not getting the translations. it is a dynamic route and directory is news-detail/[slug].js

I am deploying using vercel

0

There are 0 best solutions below