Skip to content

Commit

Permalink
finish translate to nepali
Browse files Browse the repository at this point in the history
  • Loading branch information
Janderson Souza Matias authored and Janderson Souza Matias committed Nov 22, 2023
1 parent 4c85d72 commit 3e1aa57
Show file tree
Hide file tree
Showing 13 changed files with 212 additions and 137 deletions.
2 changes: 1 addition & 1 deletion src/components/HeaderPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const HeaderPage: React.FC<Props> = ({ title, subtitle, newButtonValue, onClickN
<HStack>
{onClickDownload && (
<Button variant="solid" colorScheme="blue" onClick={onClickDownload} gap="8px">
{t('general.download-data')}
{t('common.download')}
</Button>
)}

Expand Down
2 changes: 1 addition & 1 deletion src/components/Table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ const Table: React.FC<Props> = ({ columns, data, filters, topSession }) => {
</Center>
<VStack w="120px">
<Text fontSize="14px" fontWeight="semibold" mr="auto">
Items per page:
{t('common.items-per-page')}
</Text>
<Select value={itemsPerPage} onChange={(e) => setItemsPerPage(Number(e.target.value))}>
{SIZE_OPTIONS.map((value) => (
Expand Down
38 changes: 38 additions & 0 deletions src/i18n/langs/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ const enTranslation = {
},

dashboard: {
filters: {
region: 'Select region',
district: 'Select district',
school: 'Select school',
},
engagement: {
title: 'Engagement',
description: 'The numbers that represent coach engagement using the Coach platform in the selected period.',
Expand All @@ -40,12 +45,26 @@ const enTranslation = {
title: 'Targeted improvement areas',
description: 'Teaching practices teachers and coaches agreed to work on between coaching sessions',
},
'needs-work': 'Needs work',
'keep-working': 'Keep working',
'needs-attention': 'Needs attention',
'almost-there': 'Almost there',
'doing-great': 'Doing great',
'school-rating': 'School rating',
'regional-average': 'Regional average',
'national-average': 'National average',
'select-teaching-practices-to-show': 'Select Teaching Practices to show',
'supportive-learning-environment': 'Supportive learning environment',
'teachers-showing-improvement-or-mastery': 'Teachers showing improvement or mastery',
'teachers-and-coaches-chose-to-work-on-improving-this-practice':
'Teachers and coaches chose to work on improving this practice',
'teachers-did-not-have-a-feedback-session': 'Teachers didn’t have a feedback session',
},

'teacher-practices': {
new: 'Add teaching practice',
active: 'Active',
inactive: 'Inactive',
table: {
name: 'Name',
'number-of-questions': 'Number of questions',
Expand Down Expand Up @@ -100,6 +119,16 @@ const enTranslation = {
},
},

session: {
table: {
school: 'School',
coach: 'Coach',
teacher: 'Teacher',
subject: 'Subject',
feedback: 'Feedback',
},
},

'session-data': {
filters: {
period: 'Period',
Expand All @@ -120,6 +149,15 @@ const enTranslation = {
},
},

sync: {
table: {
'android-version': 'Android version',
model: 'Model',
'device-id': 'DeviceID',
'last-update': 'Last Update',
},
},

settings: {
title: 'Settings',
tabs: {
Expand Down
38 changes: 38 additions & 0 deletions src/i18n/langs/np.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ const npTranslation = {
schools: 'विद्यालयहरू',
},
dashboard: {
filters: {
region: 'क्षेत्र चयन गर्नुहोस्',
district: 'जिल्ला चयन गर्नुहोस्',
school: 'विद्यालय चयन गर्नुहोस्',
},
engagement: {
title: 'संलग्नता',
'coaching-sessions': 'कोचिङ सत्रहरू',
Expand All @@ -38,8 +43,20 @@ const npTranslation = {
title: 'लक्षित सुधार क्षेत्रहरू',
description: 'शिक्षण अभ्यासहरू जसको लागि शिक्षक र प्रशिक्षकहरू कोचिङ सत्रहरू बीचमा काम गर्न सहमत भए',
},
'needs-work': 'काम चाहिन्छ',
'keep-working': 'काम गर्दै गर्नुहोस्',
'needs-attention': 'ध्यान चाहिन्छ',
'almost-there': 'लगभग त्यहाँ',
'doing-great': 'राम्रो गर्दै हुनुहुन्छ',
'school-rating': 'विद्यालय मूल्याङ्कन',
'regional-average': 'क्षेत्रीय औसत',
'national-average': 'राष्ट्रिय औसत',
'select-teaching-practices-to-show': 'तपाईंले हेर्न चाहनुभएको शिक्षण अभ्यासहरू चयन गर्नुहोस्',
'supportive-learning-environment': 'सहयोगी सिकाइ वातावरण',
'teachers-showing-improvement-or-mastery': 'सुधार वा निपुणता देखाउने शिक्षकहरू',
'teachers-and-coaches-chose-to-work-on-improving-this-practice':
'शिक्षक र प्रशिक्षकहरूले यो अभ्यास सुधार गर्न काम गर्न रोजे',
'teachers-did-not-have-a-feedback-session': 'शिक्षकहरूको प्रतिक्रिया सत्र थिएन',
},
'teacher-practices': {
new: 'शिक्षण अभ्यास थप्नुहोस्',
Expand Down Expand Up @@ -93,6 +110,17 @@ const npTranslation = {
'Teachers coached (last 30 days)': 'कुल प्रशिक्षित शिक्षक (पछिल्लो 30 दिन)',
},
},

session: {
table: {
school: 'विद्यालय',
coach: 'प्रशिक्षक',
teacher: 'शिक्षक',
subject: 'विषय',
feedback: 'प्रतिक्रिया',
},
},

'session-data': {
filters: {
period: 'अवधि',
Expand All @@ -112,6 +140,16 @@ const npTranslation = {
'supportive-learning Environment': 'सहयोगी सिकाइ वातावरण',
},
},

sync: {
table: {
'android-version': 'एन्ड्रोइड संस्करण',
model: 'मोडेल',
'device-id': 'यन्त्र ID',
'last-update': 'अन्तिम अपडेट',
},
},

settings: {
title: 'सेटिङ',
tabs: {
Expand Down
18 changes: 10 additions & 8 deletions src/pages/CoachOverTime/SessionList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ type Props = {
};

const SessionList: React.FC<Props> = ({ sessions, filters }) => {
const { t } = useTranslation();

return (
<Table
data={sessions}
Expand All @@ -31,55 +33,55 @@ const SessionList: React.FC<Props> = ({ sessions, filters }) => {
{
renderColumn: (item: ISessionOverTime) => item['School Name'],
getOrderProp: (item: ISessionOverTime) => item['School Name'],
title: 'School',
title: t('coach-over-time.table.School'),
width: '30%',
},
{
renderColumn: (item: ISessionOverTime) => item['Number of Coaches'],
getOrderProp: (item: ISessionOverTime) => item['Number of Coaches'],
title: 'Number of coaches',
title: t('coach-over-time.table.Number of coaches'),
isNumber: true,
width: '10%',
},
{
renderColumn: (item: ISessionOverTime) => item['Teachers with at least 1 Session'],
getOrderProp: (item: ISessionOverTime) => item['Teachers with at least 1 Session'],
title: 'Number of teachers coached',
title: t('coach-over-time.table.Number of teachers coached'),
isNumber: true,
width: '10%',
},
{
renderColumn: (item: ISessionOverTime) => item['Number of Feedbacks'],
getOrderProp: (item: ISessionOverTime) => item['Number of Feedbacks'],
title: 'Feedback sessions',
title: t('coach-over-time.table.Feedback sessions'),
isNumber: true,
width: '10%',
},
{
renderColumn: (item: ISessionOverTime) => item['Last 30 days'],
getOrderProp: (item: ISessionOverTime) => item['Last 30 days'],
title: 'Teachers coached (last 30 days)',
title: t('coach-over-time.table.Teachers coached (last 30 days)'),
isNumber: true,
width: '10%',
},
{
renderColumn: (item: ISessionOverTime) => item['Last 30 and 60 days'],
getOrderProp: (item: ISessionOverTime) => item['Last 30 and 60 days'],
title: 'Teachers coached (30-60 days)',
title: t('coach-over-time.table.Teachers coached (30-60 days)'),
isNumber: true,
width: '10%',
},
{
renderColumn: (item: ISessionOverTime) => item['Last 60 and 90 days'],
getOrderProp: (item: ISessionOverTime) => item['Last 60 and 90 days'],
title: 'Teachers coached (60-90 days)',
title: t('coach-over-time.table.Teachers coached (60-90 days)'),
isNumber: true,
width: '10%',
},
{
renderColumn: (item: ISessionOverTime) => item['More than 90 days ago'],
getOrderProp: (item: ISessionOverTime) => item['More than 90 days ago'],
title: 'Teachers coached (90+ days)',
title: t('coach-over-time.table.Teachers coached (90+ days)'),
isNumber: true,
width: '150px',
},
Expand Down
6 changes: 3 additions & 3 deletions src/pages/CoachOverTime/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const CoachOverTimePage: React.FC = () => {
filters={
<HStack w="100%" minH={'40px'} mb="0" bg="#F2F4F7" p="16px">
<VStack alignItems="start">
<FormLabel htmlFor="region">Region</FormLabel>
<FormLabel htmlFor="region">{t('coach-over-time.filters.region')}</FormLabel>
<Select id="region" value={region} onChange={(e) => setRegion(e.target.value)} bg="#fff">
<option value={''}>All regions</option>
{REGIONS.map((item) => (
Expand All @@ -64,7 +64,7 @@ const CoachOverTimePage: React.FC = () => {
</VStack>

<VStack alignItems="start" ml="12px">
<FormLabel htmlFor="schoolId">School</FormLabel>
<FormLabel htmlFor="schoolId">{t('coach-over-time.filters.school')}</FormLabel>
<Select id="schoolId" value={schoolId} onChange={(e) => setSchoolId(e.target.value)} bg="#fff">
<option value={''}>All schools</option>
{sessionOverTime.map((item) => (
Expand All @@ -75,7 +75,7 @@ const CoachOverTimePage: React.FC = () => {

<VStack alignItems="start" ml="12px">
<FormLabel htmlFor="onlyWithValues" mb="0" cursor="pointer">
Include schools with no data
{t('coach-over-time.filters.with-no-data')}
</FormLabel>
<Switch
id="onlyWithValues"
Expand Down
91 changes: 25 additions & 66 deletions src/pages/Competencies/CompetenceList/index.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
import {
Center,
Flex,
Menu,
MenuButton,
MenuItem,
MenuList,
Tag,
TagLabel,
} from "@chakra-ui/react";
import { ICompetence } from "@/types";
import Table from "@/components/Table";
import { useTranslation } from "react-i18next";
import Icon from "@/components/Base/Icon";
import { Center, Flex, Menu, MenuButton, MenuItem, MenuList, Tag, TagLabel } from '@chakra-ui/react';
import { ICompetence } from '@/types';
import Table from '@/components/Table';
import { useTranslation } from 'react-i18next';
import Icon from '@/components/Base/Icon';

type Props = {
competences: ICompetence[];
Expand All @@ -20,12 +11,7 @@ type Props = {
handleActivate: (competence: ICompetence) => void;
};

const CompetenceList: React.FC<Props> = ({
competences,
handleActivate,
handleEdit,
handleOpen,
}) => {
const CompetenceList: React.FC<Props> = ({ competences, handleActivate, handleEdit, handleOpen }) => {
const { t } = useTranslation();

return (
Expand All @@ -34,35 +20,24 @@ const CompetenceList: React.FC<Props> = ({
columns={[
{
renderColumn: (item: ICompetence) => item.title,
title: "competence.title",
title: 'teacher-practices.table.name',
width: 'calc(100% - 200px)',
},
{
width: "200px",
renderColumn: (item: ICompetence) => (
<Center>{item.questions?.length}</Center>
),
title: "competence.number-of-questions",
width: '100px',
renderColumn: (item: ICompetence) => <Center>{item.questions?.length}</Center>,
title: 'teacher-practices.table.number-of-questions',
},
{
renderColumn: (item: ICompetence) => (
<Center>
<Tag
size="lg"
variant="subtle"
colorScheme={item.deleted_at ? "red" : "green"}
>
<TagLabel>
{t(
item.deleted_at
? "competence.inactive"
: "competence.active"
)}
</TagLabel>
<Tag size="lg" variant="subtle" colorScheme={item.deleted_at ? 'red' : 'green'}>
<TagLabel>{t(item.deleted_at ? 'teacher-practices.inactive' : 'teacher-practices.active')}</TagLabel>
</Tag>
</Center>
),
width: "130px",
title: "competence.publish-state",
width: '120px',
title: 'teacher-practices.table.publish-state',
},
{
renderColumn: (item: ICompetence) => (
Expand All @@ -72,47 +47,31 @@ const CompetenceList: React.FC<Props> = ({
<Icon name="ellipsis-v" size={16} />
</MenuButton>
<MenuList>
<MenuItem
gap="8px"
alignItems="center"
onClick={() => handleOpen(item)}
>
<MenuItem gap="8px" alignItems="center" onClick={() => handleOpen(item)}>
<Icon name="eye" />
{t("common.view")}
{t('common.view')}
</MenuItem>
<MenuItem
gap="8px"
alignItems="center"
onClick={() => handleEdit(item)}
>
<MenuItem gap="8px" alignItems="center" onClick={() => handleEdit(item)}>
<Icon name="pen" />
{t("common.edit")}
{t('common.edit')}
</MenuItem>
{item.deleted_at ? (
<MenuItem
gap="8px"
alignItems="center"
onClick={() => handleActivate(item)}
>
<MenuItem gap="8px" alignItems="center" onClick={() => handleActivate(item)}>
<Icon name="toggle-on" />
{t("common.activate")}
{t('common.activate')}
</MenuItem>
) : (
<MenuItem
gap="8px"
alignItems="center"
onClick={() => handleActivate(item)}
>
<MenuItem gap="8px" alignItems="center" onClick={() => handleActivate(item)}>
<Icon name="toggle-off" />
{t("common.deactivate")}
{t('common.deactivate')}
</MenuItem>
)}
</MenuList>
</Menu>
</Flex>
),
width: "85px",
title: "common.actions",
width: '85px',
title: 'common.actions',
},
]}
/>
Expand Down
Loading

0 comments on commit 3e1aa57

Please sign in to comment.