From abfe685dc4fc5b75f50a91a7fe854f0cae8b1758 Mon Sep 17 00:00:00 2001 From: Daniel Cukier Date: Thu, 6 Jun 2024 21:23:18 -0300 Subject: [PATCH] fix language bug --- components/Home/index.js | 8 ++++++-- components/Navbar/index.js | 4 ++-- pages/courses/[id].js | 8 ++++++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/components/Home/index.js b/components/Home/index.js index 82d5d3aa..623690d8 100644 --- a/components/Home/index.js +++ b/components/Home/index.js @@ -22,7 +22,9 @@ export default function Main({ course }) {
- {!course?.metadata ? course.title : course.metadata[i18n.language].title} + {!course?.metadata + ? course.title + : course.metadata[i18n.resolvedLanguage || 'en'].title}
@@ -31,7 +33,9 @@ export default function Main({ course }) {
{course?.metadata && (
)} {!course?.metadata &&
} diff --git a/components/Navbar/index.js b/components/Navbar/index.js index 4663482a..9538e0ae 100644 --- a/components/Navbar/index.js +++ b/components/Navbar/index.js @@ -73,7 +73,7 @@ export default function NavbarComponent() { - {i18n.language} + {i18n.resolvedLanguage || 'en'} {i18n.options.whitelist - .filter((l) => l !== i18n.language) + .filter((l) => l !== i18n.resolvedLanguage) .map((l) => ( diff --git a/pages/courses/[id].js b/pages/courses/[id].js index 58ccd12b..bc17454e 100644 --- a/pages/courses/[id].js +++ b/pages/courses/[id].js @@ -200,13 +200,17 @@ function Course({ course, currentDate }) {

- {!course?.metadata ? course.title : course.metadata[i18n.language].title} + {!course?.metadata + ? course.title + : course.metadata[i18n.resolvedLanguage || 'en'].title}

{course?.metadata && (

)} {!course?.metadata && (