Skip to content

Commit

Permalink
Merge pull request #191 from Rushikesh-Sonawane99/shiksha-2.0
Browse files Browse the repository at this point in the history
Issue #PS-384 chore: Added translations and integrated constant from config file
  • Loading branch information
itsvick authored May 31, 2024
2 parents 411d749 + 4591dde commit 584a4e8
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 15 deletions.
2 changes: 1 addition & 1 deletion app.config.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const lowLearnerAttendanceLimit: number = 67;
export const lowLearnerAttendanceLimit: number = 33;
11 changes: 6 additions & 5 deletions public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,12 @@
"LAST_SIX_MONTHS": "Last Six Months",
"CUSTOM_RANGE": "Custom Range",
"NONE": "None",
"LEARNERS":"Learners",
"LEARNERS": "Learners",
"LEARNER_NAME": "Learner Name",
"DATE_RANGE": "Date Range",
"SELECT_AN_OPTION": "Select an option"
"SELECT_AN_OPTION": "Select an option",
"AND": "and",
"MORE": "more"
},
"LOGIN_PAGE": {
"USERNAME": "Username",
Expand Down Expand Up @@ -78,9 +80,8 @@
"MY_TIMETABLE": "My Timetable",
"MY_TEACHING_CENTERS": "My Teaching Centers",
"UPCOMING_EXTRA_SESSION": "Upcoming Extra Sessions",
"BACK_TO_TOP":"Back to Top",
"BACK_TO_TOP": "Back to Top",
"LAST_SEVEN_DAYS_RANGE": "Last 7 Days {{date_range}})"

},
"ATTENDANCE": {
"TOTAL_STUDENTS": "Total Number of Learners: {{count}}",
Expand Down Expand Up @@ -127,6 +128,6 @@
"VIEW_DAY_WISE": "View Day-Wise",
"SUBMITTED_ON": "Submitted On",
"MARK_OBTAINED": "Mark Obtained",
"TOTAL_QUESTIONS":"Total Questions"
"TOTAL_QUESTIONS": "Total Questions"
}
}
8 changes: 5 additions & 3 deletions public/locales/hi/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@
"AS_OF_LAST_WEEK": "पिछले सप्ताह तक",
"AS_OF_LAST_SIX_MONTH": "पिछले छह महीने से",
"NONE": "कोई नहीं",
"LEARNERS":"शिक्षार्थियों",
"LEARNERS": "शिक्षार्थियों",
"LEARNER_NAME": "शिक्षार्थी का नाम",
"DATE_RANGE": "तिथि सीमा",
"SELECT_AN_OPTION": "कोई विकल्प चुनें"
"SELECT_AN_OPTION": "कोई विकल्प चुनें",
"AND": "और",
"MORE": "अधिक"
},
"LOGIN_PAGE": {
"USERNAME": "उपयोगकर्ता नाम",
Expand Down Expand Up @@ -76,7 +78,7 @@
"CENTER_ATTENDANCE": "केंद्रीय उपस्थिति",
"MY_TEACHING_CENTERS": "मेरे शिक्षण केंद्र",
"UPCOMING_EXTRA_SESSION": "आगामी अतिरिक्त सत्र",
"BACK_TO_TOP":"वापस शीर्ष पर",
"BACK_TO_TOP": "वापस शीर्ष पर",
"LAST_SEVEN_DAYS_RANGE": "पिछले 7 दिन {{date_range}}"
},
"ATTENDANCE": {
Expand Down
8 changes: 5 additions & 3 deletions public/locales/mr/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@
"AS_OF_LAST_WEEK": "गेल्या आठवड्याप्रमाणे",
"AS_OF_LAST_SIX_MONTH": "गेल्या सहा महिन्यांपासून",
"NONE": "काहीही नाही",
"LEARNERS":"शिकणारे",
"LEARNERS": "शिकणारे",
"LEARNER_NAME": "शिकणाऱ्याचे नाव",
"DATE_RANGE": "तारीख श्रेणी",
"SELECT_AN_OPTION": "एक पर्याय निवडा"
"SELECT_AN_OPTION": "एक पर्याय निवडा",
"AND": "आणि",
"MORE": "अधिक"
},
"LOGIN_PAGE": {
"USERNAME": "वापरकर्ता नाव",
Expand Down Expand Up @@ -76,7 +78,7 @@
"MY_TIMETABLE": "माझे वेळापत्रक",
"MY_TEACHING_CENTERS": "माझे शिक्षण केंद्र",
"UPCOMING_EXTRA_SESSION": "आगामी अतिरिक्त सत्रे",
"BACK_TO_TOP":"परत वर जा",
"BACK_TO_TOP": "परत वर जा",
"LAST_SEVEN_DAYS_RANGE": "शेवटचे 7 दिवस {{date_range}}"
},
"ATTENDANCE": {
Expand Down
3 changes: 2 additions & 1 deletion src/components/LearnerAttendanceStatsListView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Box, Grid, Stack, Typography } from '@mui/material';
import { useTheme } from '@mui/material/styles';
import { useTranslation } from 'react-i18next';
import Link from 'next/link';
import { lowLearnerAttendanceLimit } from '../../app.config';
interface StudentsStatsListProps {
name: string;
presentPercent: number;
Expand All @@ -22,7 +23,7 @@ const StudentsStatsList: React.FC<StudentsStatsListProps> = ({
const theme = useTheme<any>();
const { t } = useTranslation();
const textColor =
presentPercent > 60 ? theme.palette.success.main : theme.palette.error.main;
presentPercent > lowLearnerAttendanceLimit ? theme.palette.success.main : theme.palette.error.main;

// const handleStudentDetails = () => {
// router.push(`/student-details/${cohortId}/${userId}`);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/attendance-overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ const AttendanceOverview: React.FC<AttendanceOverviewProps> = () => {
))}
value={
lowAttendanceLearnerList.length > 2
? `${lowAttendanceLearnerList[0]}, ${lowAttendanceLearnerList[1]} and ${lowAttendanceLearnerList.length - 2} more`
? `${lowAttendanceLearnerList[0]}, ${lowAttendanceLearnerList[1]} ${t('COMMON.AND')} ${lowAttendanceLearnerList.length - 2} ${t('COMMON.MORE')}`
: lowAttendanceLearnerList.length === 2
? `${lowAttendanceLearnerList[0]}, ${lowAttendanceLearnerList[1]}`
: lowAttendanceLearnerList.length === 1
Expand Down
2 changes: 1 addition & 1 deletion src/pages/dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ const Dashboard: React.FC<DashboardProps> = () => {
))}
value={
lowAttendanceLearnerList.length > 2
? `${lowAttendanceLearnerList[0]}, ${lowAttendanceLearnerList[1]} and ${lowAttendanceLearnerList.length - 2} more`
? `${lowAttendanceLearnerList[0]}, ${lowAttendanceLearnerList[1]} ${t('COMMON.AND')} ${lowAttendanceLearnerList.length - 2} ${t('COMMON.MORE')}`
: lowAttendanceLearnerList.length === 2
? `${lowAttendanceLearnerList[0]}, ${lowAttendanceLearnerList[1]}`
: lowAttendanceLearnerList.length === 1
Expand Down

0 comments on commit 584a4e8

Please sign in to comment.