-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chore/multi language fixes #180
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
f66dd16
to
e0f360a
Compare
next.config.js
Outdated
@@ -1,6 +1,6 @@ | |||
module.exports = { | |||
i18n: { | |||
locales: ['en', 'pt'], | |||
locales: ['en', 'pt_BR'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The correct is pt-BR (with hiphen)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I'll update that in the https://github.com/w3b3d3v/buildspace-projects as well
lessonsSubmitted.map((item) => { | ||
if (item?.lesson === lesson && item?.user == user?.uid && item?.cohort_id == cohort?.id) { | ||
lessonsSubmitted.forEach((item) => { | ||
console.log('lesson', lesson) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left over
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙈
|
||
useEffect(() => { | ||
lessonsSubmitted.map((item) => { | ||
if (item?.lesson === lesson && item?.user == user?.uid && item?.cohort_id == cohort?.id) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you remove this check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the previous code, "lessonsSubmitted" included all users' lessons from other courses and cohorts. However, my solution only fetches the lessons for the current course and cohort directly in the database query, eliminating the need for additional checks.
const nextLesson = () => { | ||
const currentLessonIndex = sortedLessons.map((item) => item.lesson === lesson).indexOf(true) | ||
const currentLessonIndex = sortedLessons.findIndex((item) => item.lesson === lesson) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😍
|
||
useEffect(() => { | ||
setSortedLessons(course.lessons.sort((a, b) => (a.section > b.section ? 1 : -1))) | ||
}, [sortedLessons]) | ||
|
||
useEffect(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code should not be here. It is a generic language change code that should be in the page template or navbar component.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed 😉
This PR includes several key updates and fixes to improve multi-language support and functionality.
Closes #179