Skip to content

Commit

Permalink
Merge pull request #496 from Aar-if/forty
Browse files Browse the repository at this point in the history
Issue #000 Bug:  Course Planner Translation Fixes
  • Loading branch information
itsvick authored Dec 4, 2024
2 parents a8eb6dd + e1612eb commit 1b8936f
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 32 deletions.
6 changes: 4 additions & 2 deletions public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -573,8 +573,10 @@
"COLLAPSE_ALL": "Collapse All",
"EXPAND_ALL": "Expand All",
"RESOURCES": "Resources",
"MARK_AS_COMPLETED": "Mark As Complete"

"MARK_AS_COMPLETED": "Mark As Complete",
"COURSE_TYPE": "Course Type",
"SUBTOPICS_SELECTED": "subtopics selected",
"NO_RESOURCES_FOUND": "No resources found"
},
"ASSESSMENTS": {
"ASSESSMENTS": "Assessments",
Expand Down
20 changes: 11 additions & 9 deletions public/locales/hi/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -564,15 +564,17 @@
"ENTER_VALID_CENTER_NAME": "वैध केंद्र नाम दर्ज करें"
},
"COURSE_PLANNER": {
"COURSE_PLANNER": "पाठ्यक्रम योजना",
"FOUNDATION_COURSE": "आधार पाठ्यक्रम",
"MAIN_COURSE": "मुख्य पाठ्यक्रम",
"COLLAPSE_ALL": "सभी को संक्षिप्त करें",
"EXPAND_ALL": "सभी को विस्तृत करें",
"RESOURCES": "संसाधन",

"MARK_AS_COMPLETED": "पूर्ण के रूप में चिह्नित करें"
},
"COURSE_PLANNER": "कोर्स योजना",
"FOUNDATION_COURSE": "फाउंडेशन कोर्स",
"MAIN_COURSE": "मुख्य कोर्स",
"COLLAPSE_ALL": "सभी को संकुचित करें",
"EXPAND_ALL": "सभी को विस्तारित करें",
"RESOURCES": "संसाधन",
"MARK_AS_COMPLETED": "पूर्ण के रूप में चिह्नित करें",
"COURSE_TYPE": "कोर्स प्रकार",
"SUBTOPICS_SELECTED": "उपविषयों का चयन किया गया",
"NO_RESOURCES_FOUND": "कोई संसाधन नहीं मिला"
},
"ASSESSMENTS": {
"ASSESSMENTS": "मूल्यांकन",
"CENTER": "केंद्र",
Expand Down
20 changes: 11 additions & 9 deletions public/locales/mr/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -562,15 +562,17 @@
"ENTER_VALID_CENTER_NAME": "वैध केंद्राचे नाव प्रविष्ट करा."
},
"COURSE_PLANNER": {
"COURSE_PLANNER": "पाठ्यक्रम योजना",
"FOUNDATION_COURSE": "आधार पाठ्यक्रम",
"MAIN_COURSE": "मुख्य पाठ्यक्रम",
"COLLAPSE_ALL": "सर्व संक्षिप्त करा.",
"EXPAND_ALL": "सर्व विस्तृत करा.",
"RESOURCES": "संसाधन",
"MARK_AS_COMPLETED": "पूर्ण म्हणून चिन्हांकित करा"

},
"COURSE_PLANNER": "कोर्स योजना",
"FOUNDATION_COURSE": "फाउंडेशन कोर्स",
"MAIN_COURSE": "मुख्य कोर्स",
"COLLAPSE_ALL": "सर्व संकुचित करा",
"EXPAND_ALL": "सर्व विस्तारित करा",
"RESOURCES": "साधने",
"MARK_AS_COMPLETED": "पूर्ण म्हणून चिन्हांकित करा",
"COURSE_TYPE": "कोर्स प्रकार",
"SUBTOPICS_SELECTED": "उपविषय निवडलेले आहेत",
"NO_RESOURCES_FOUND": "कोणतीही साधने सापडली नाही"
},

"ASSESSMENTS": {
"ASSESSMENTS": "मूल्यांकन",
Expand Down
35 changes: 26 additions & 9 deletions src/components/CourseAccordion.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,42 @@
import React, { useEffect } from 'react';
import { Box, Accordion, AccordionSummary, AccordionDetails, Typography } from '@mui/material';
import {
Box,
Accordion,
AccordionSummary,
AccordionDetails,
Typography,
} from '@mui/material';
import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown';
import { useTheme } from '@mui/material/styles';
import CoursePlannerCards from './CoursePlannerCards';
import { useTranslation } from 'next-i18next';

interface CourseAccordionProps {
title: any;
type: string;
resources: any;
resources: any;
expanded: boolean;
onChange?: (event: React.SyntheticEvent, expanded: boolean) => void;
}

const CourseAccordion: React.FC<CourseAccordionProps> = ({ title, type, resources, expanded, onChange }) => {
const CourseAccordion: React.FC<CourseAccordionProps> = ({
title,
type,
resources,
expanded,
onChange,
}) => {
const theme = useTheme<any>();

const { t } = useTranslation();
useEffect(() => {
console.log("resources", type, resources);
console.log('resources', type, resources);
}, []);

return (
<Box sx={{ mt: 2, mb: 1.5 }}>
<Accordion expanded={expanded} onChange={onChange}
<Accordion
expanded={expanded}
onChange={onChange}
sx={{
boxShadow: 'none !important',
border: 'none !important',
Expand Down Expand Up @@ -65,9 +80,11 @@ const CourseAccordion: React.FC<CourseAccordionProps> = ({ title, type, resource
>
<CoursePlannerCards resources={resources} type={type} />

{
resources?.length === 0 && <Typography sx={{ p: '10px', mt:2, fontSize: '12px'}}>No resources found</Typography>
}
{resources?.length === 0 && (
<Typography sx={{ p: '10px', mt: 2, fontSize: '12px' }}>
{t('COURSE_PLANNER.NO_RESOURCES_FOUND')}
</Typography>
)}
</AccordionDetails>
</Accordion>
</Box>
Expand Down
4 changes: 2 additions & 2 deletions src/components/FacilitatorDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const FacilitatorDrawer: React.FC<FacilitatorDrawerProps> = ({
}}
>
{selectedCount > 0
? `${selectedCount} subtopics selected`
? `${selectedCount} ${t('COURSE_PLANNER.SUBTOPICS_SELECTED')}`
: `${t('ASSESSMENTS.NO_SUBTOPIC_SELECTED')}`}
</Box>
<Box
Expand All @@ -87,7 +87,7 @@ const FacilitatorDrawer: React.FC<FacilitatorDrawerProps> = ({
}}
>
{secondary && (
<Box onClick={onSecondaryClick}>
<Box onClick={onSecondaryClick}>
<Button
sx={{
border: `1px solid ${theme?.palette?.warning['A400']}`,
Expand Down
5 changes: 4 additions & 1 deletion src/pages/course-planner/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,10 @@ const CoursePlanner = () => {
<Grid item xs={12} md={6}>
<Box sx={{ mt: 2, px: '20px', width: '100%' }}>
<FormControl sx={{ width: '100%' }}>
<InputLabel id="course-type-select-label">Course Type</InputLabel>
<InputLabel id="course-type-select-label">
{' '}
{t('COURSE_PLANNER.COURSE_TYPE')}
</InputLabel>
<Select
labelId="course-type-select-label"
id="course-type-select"
Expand Down

0 comments on commit 1b8936f

Please sign in to comment.