Closed AnasGamal closed 11 months ago
I think the issue stems from the way Global
single content type data is fetched from Strapi API in frontend/src/app/[lang]/layout.tsx
.
The issue also affects meta data from my experience. I think this is because data for meta data, header, and footer are all imported together from Global
content type.
Line 21
-34
in frontend/src/app/[lang]/layout.tsx
const urlParamsObject = { populate: [ "metadata.shareImage", "favicon", "notificationBanner.link", "navbar.links", "navbar.navbarLogo.logoImg", "footer.footerLogo.logoImg", "footer.menuLinks", "footer.legalLinks", "footer.socialLinks", "footer.categories", ], };
I created pull request #61 related to this issue, please review it and merge it if it's possible.
You are the best @AnasGamal thank you.
Bug Description: Next.js Navbar and Footer components do not display localized content that should be fetched from Strapi CMS,. Despite creating localized versions in different languages and adding language-specific content to the header and footer sections in the Strapi CMS, the website only shows the default (i suppose) locale content for the Navbar and Footer across all languages.
Steps to Reproduce:
Global
underSingle Type
.Expected Result: All homepage sections, including the Navbar and Footer, should display the localized content specific to the selected language.
Actual Result: The Navbar and Footer components continue to display the default locale content across all languages, instead of the expected localized content.