Skip to content

Commit

Permalink
Added ua/en translation for labels
Browse files Browse the repository at this point in the history
  • Loading branch information
amoutens committed Nov 14, 2024
1 parent cbeb1a3 commit 5df89ad
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
8 changes: 5 additions & 3 deletions src/components/app-progress-bar-line/AppProgressBarLine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { LinearProgress } from '@mui/material'
import { UserRoleEnum } from '~/types'

import { AccessTime } from '@mui/icons-material'
import { useTranslation } from 'react-i18next'
interface AppProgressBarLineProps {
value: number
userRole: UserRoleEnum | ''
Expand All @@ -20,23 +21,24 @@ const AppProgressBarLine: FC<AppProgressBarLineProps> = ({
isCooperationActivities = false
}) => {
const { isMobile } = useBreakpoints()
const { t } = useTranslation()
const labelsValue =
userRole === UserRoleEnum.Student
? [0, 25, 50, 75, 100]
: [0, 20, 40, 60, 80, 100]
const labelsWithPercentForCooperation = (
<Box width={'100%'}>
<Typography sx={styles.primaryLabelsCoop} variant='body2'>
Your progress
{t('cooperationDetailsPage.progressBar.yourProgress')}
</Typography>
<Box sx={styles.wrapperTypographyProgressCoop}>
<Typography sx={styles.completedLabel} variant='h5'>
{`${value}% completed`}
{`${value}% ${t('cooperationDetailsPage.progressBar.completed')}`}
</Typography>
<Box sx={styles.wrapperTitleWithIconCoop}>
<AccessTime sx={styles.accessTimeIcon} />
<Typography sx={styles.primaryLabelsCoop} variant='subtitle1'>
{`${100 - value}% to complete`}
{`${100 - value}% ${t('cooperationDetailsPage.progressBar.needToComplete')}`}
</Typography>
</Box>
</Box>
Expand Down
7 changes: 6 additions & 1 deletion src/constants/translations/en/cooperation-details.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,10 @@
"tutoringSubject": "Tutoring subject & level:",
"aboutCooperation": "About cooperation:",
"tutoringLanguages": "Tutoring languages:",
"pricing": "Pricing:"
"pricing": "Pricing:",
"progressBar": {
"yourProgress": "Your progress",
"completed": "completed",
"needToComplete": "to complete"
}
}
7 changes: 6 additions & 1 deletion src/constants/translations/uk/cooperation-details.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,10 @@
"tutoringSubject": "Предмет і рівень:",
"aboutCooperation": "Про співпрацю:",
"tutoringLanguages": "Мови:",
"pricing": "Ціна:"
"pricing": "Ціна:",
"progressBar": {
"yourProgress": "Ваш прогрес",
"completed": "виконано",
"needToComplete": "до завершення"
}
}

0 comments on commit 5df89ad

Please sign in to comment.