Skip to content

Commit

Permalink
add new translate files
Browse files Browse the repository at this point in the history
  • Loading branch information
Janderson Souza Matias authored and Janderson Souza Matias committed Dec 22, 2023
1 parent af294dd commit d86028b
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 33 deletions.
19 changes: 19 additions & 0 deletions src/i18n/langs/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ const enTranslation = {
'all-regions': 'All regions',
'all-schools': 'All schools',
'all-districts': 'All districts',
complete: 'Complete',
incomplete: 'Incomplete',
},

Navbar: {
Expand Down Expand Up @@ -160,6 +162,13 @@ const enTranslation = {
subject: 'Subject',
feedback: 'Feedback',
},
view: {
title: 'View session',
school: 'School',
coach: 'Coach',
teacher: 'Teacher',
feedback: 'Feedback annotation',
},
},

'session-data': {
Expand Down Expand Up @@ -204,6 +213,16 @@ const enTranslation = {
users: {
title: 'Users',
new: 'New user',
edit: 'Edit user',
remove: 'Remove user',
form: {
name: 'Name',
email: 'Email',
password: 'Password',
role: 'Role',
save: 'Save',
cancel: 'Cancel',
},
},
'change-password': {
title: 'Change password',
Expand Down
56 changes: 43 additions & 13 deletions src/i18n/langs/np.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
const npTranslation = {
common: {
actions: 'क्रियाहरू',
activate: 'सक्रिय गर्नुहोस्',
deactivate: 'निष्क्रिय गर्नुहोस्',
save: 'बचत गर्नुहोस्',
edit: 'सम्पादन गर्नुहोस्',
view: 'हेर्नुहोस्',
delete: 'हटाउनुहोस्',
'items-per-page': 'पृष्ठ सूचीमा कुल',
activate: 'सक्रिय गर्नुहोस्',
deactivate: 'निष्क्रिय पार्नुहोस्',
generateQRCode: 'QR कोड सिर्जना गर्नुहोस्',
delete: 'मेटाउनुहोस्',
generateQRCode: 'क्यूआर कोड उत्पन्न गर्नुहोस्',
cancel: 'रद्द गर्नुहोस्',
download: 'डाटा डाउनलोड गर्नुहोस्',
'all-time': 'सधैं',
'last-7-days': 'पछिल्लो ७ दिन',
'last-30-days': 'पछिल्लो ३० दिन',
'last-60-days': 'पछिल्लो ६० दिन',
'last-90-days': 'पछिल्लो ९० दिन',
download: 'डेटा डाउनलोड गर्नुहोस्',
import: 'डेटा आयात गर्नुहोस्',
'items-per-page': 'प्रति पृष्ठ वस्तुहरू',
'all-time': 'सबै समय',
'last-7-days': 'अन्तिम ७ दिनहरू',
'last-30-days': 'अन्तिम ३० दिनहरू',
'last-60-days': 'अन्तिम ६० दिनहरू',
'last-90-days': 'अन्तिम ९० दिनहरू',
'all-regions': 'सबै क्षेत्रहरू',
'all-schools': 'सबै विद्यालयहरू',
'all-districts': 'सबै जिल्लाहरू',
actions: 'कार्यहरू',
save: 'बचत गर्नुहोस्',
complete: 'पूर्ण',
incomplete: 'अपूर्ण',
},
Navbar: {
dashboard: 'मुख्य पृष्ठ',
Expand Down Expand Up @@ -69,6 +72,8 @@ const npTranslation = {
},
'teacher-practices': {
new: 'शिक्षण अभ्यास थप्नुहोस्',
active: 'सक्रिय',
inactive: 'निष्क्रिय',
table: {
name: 'नाम',
'number-of-questions': 'प्रश्न संख्या',
Expand Down Expand Up @@ -111,11 +116,19 @@ const npTranslation = {
table: {
actions: 'कार्यहरू',
name: 'नाम',
region: 'क्षेत्रहरू',
'teachers-count': 'कुल शिक्षक संख्या',
'coaches-count': 'कोच को कुल संख्या',
},
'new-school': 'नयाँ विद्यालय',
filter: 'विद्यालयको नाम',
form: {
new: 'नयाँ विद्यालय',
update: 'विद्यालय अपडेट गर्नुहोस्',
region: 'क्षेत्र: ',
name: 'विद्यालयको नाम',
emis: 'एमिस नम्बर',
},
},
'coach-over-time': {
filters: {
Expand Down Expand Up @@ -143,6 +156,13 @@ const npTranslation = {
subject: 'विषय',
feedback: 'प्रतिक्रिया',
},
view: {
title: 'सत्र हेर्नुहोस्',
school: 'विद्यालय',
coach: 'प्रशिक्षक',
teacher: 'शिक्षक',
feedback: 'प्रतिक्रिया टिप्पणी',
},
},

'session-data': {
Expand Down Expand Up @@ -186,6 +206,16 @@ const npTranslation = {
users: {
title: 'प्रयोगकर्ताहरू',
new: 'नयाँ प्रयोगकर्ताहरू',
edit: 'प्रयोगकर्ता सम्पादन गर्नुहोस्',
remove: 'प्रयोगकर्ता हटाउनुहोस्',
form: {
name: 'नाम',
email: 'इमेल',
password: 'पासवर्ड',
role: 'भूमिका',
save: 'बचत गर्नुहोस्',
cancel: 'रद्द गर्नुहोस्',
},
},
logs: {
table: {
Expand Down
3 changes: 3 additions & 0 deletions src/pages/Schools/SchoolList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,17 @@ const SchoolList: React.FC<Props> = ({ schools, handleDelete, handleEdit }) => {
{
renderColumn: (item: ISchool) => item.emis_number,
title: t('school.table.emis_number'),
getOrderProp: (item: ISchool) => item.emis_number,
},
{
renderColumn: (item: ISchool) => item.name,
title: t('school.table.name'),
getOrderProp: (item: ISchool) => item.name,
},
{
renderColumn: (item: ISchool) => formatRegionPath(item.region),
title: t('school.table.region'),
getOrderProp: (item: ISchool) => formatRegionPath(item.region),
},
{
renderColumn: (item: ISchool) => (
Expand Down
14 changes: 7 additions & 7 deletions src/pages/Sessions/SessionList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,37 +20,37 @@ const SessionList: React.FC<Props> = ({ sessions, handleOpen }) => {
{
renderColumn: (item: ISession) => item.school.name,
title: t('session.table.school'),
width: '20%',
getOrderProp: (item: ISession) => item.school.name,
},
{
renderColumn: (item: ISession) => item.coach.name,
title: t('session.table.coach'),
width: '20%',
getOrderProp: (item: ISession) => item.coach.name,
},
{
renderColumn: (item: ISession) => item.teacher.name,
title: t('session.table.teacher'),
width: '20%',
getOrderProp: (item: ISession) => item.teacher.name,
},
{
renderColumn: (item: ISession) => item.subject,
title: t('session.table.subject'),
width: '20%',
getOrderProp: (item: ISession) => item.subject,
},

{
renderColumn: (item: ISession) =>
item?.feedback_id ? (
<Tag color="green.700" bg="green.100">
Complete
{t('common.complete')}
</Tag>
) : (
<Tag color="red.700" bg="red.100">
Incomplete
{t('common.incomplete')}
</Tag>
),
title: t('session.table.feedback'),
width: '10%',
getOrderProp: (item: ISession) => !!item?.feedback_id,
},
{
renderColumn: (item: ISession) => (
Expand Down
12 changes: 7 additions & 5 deletions src/pages/Sessions/SessionView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ import {
Divider,
} from '@chakra-ui/react';
import { useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';

type Props = {
session?: ISession;
onClose: () => void;
};

const SessionView: React.FC<Props> = ({ session, onClose }) => {
const { t } = useTranslation();
const [competencies, setCompetencies] = useState<ICompetence[]>([]);

useEffect(() => {
Expand Down Expand Up @@ -47,34 +49,34 @@ const SessionView: React.FC<Props> = ({ session, onClose }) => {
<DrawerOverlay />
<DrawerContent roundedLeft={14}>
<DrawerCloseButton mt={2} color="Primary.$200" />
<DrawerHeader>{'View session'}</DrawerHeader>
<DrawerHeader>{t('session.view.title')}</DrawerHeader>

<DrawerBody>
<HStack mb="4px" alignItems="center">
<Icon name="university" size={16} />
<Text fontWeight="semibold">School</Text>
<Text fontWeight="semibold">{t('session.view.school')}</Text>
</HStack>
<Text>{session?.school.name}</Text>
<Divider my="8px" />

<HStack mb="4px" alignItems="center">
<Icon name="user" size={16} />
<Text fontWeight="semibold">Coach</Text>
<Text fontWeight="semibold">{t('session.view.coach')}</Text>
</HStack>
<Text>{session?.coach.name}</Text>
<Divider my="8px" />

<HStack mb="4px" alignItems="center">
<Icon name="graduation-cap" size={16} />
<Text fontWeight="semibold">Teacher</Text>
<Text fontWeight="semibold">{t('session.view.teacher')}</Text>
</HStack>
<Text>{session?.teacher.name}</Text>
<Divider my="8px" />

{session?.feedback_id && (
<VStack w="100%" mb="20px" py="16px" borderBottom="1px solid #eee">
<Text w="100%" mb="16px" fontSize={20} fontWeight="semibold">
Feedback annotation
{t('session.view.feedback')}
</Text>
<Text w="100%">{session?.feedback_id}</Text>
</VStack>
Expand Down
12 changes: 6 additions & 6 deletions src/pages/Settings/Users/Form/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const UserForm: React.FC<Props> = ({ defaultValues, handleSubmitForm, handleClos
<DrawerHeader>{defaultValues && 'id' in defaultValues ? 'Update user' : 'New user'}</DrawerHeader>

<DrawerBody>
<FormLabel htmlFor="name">Name</FormLabel>
<FormLabel htmlFor="name">{t('settings.tabs.users.form.name')}</FormLabel>
<Controller
rules={{ required: true }}
control={control}
Expand All @@ -65,7 +65,7 @@ const UserForm: React.FC<Props> = ({ defaultValues, handleSubmitForm, handleClos
/>

<FormLabel htmlFor="name" style={{ marginTop: '8px' }}>
Email
{t('settings.tabs.users.form.email')}
</FormLabel>
<Controller
rules={{ required: true }}
Expand All @@ -79,7 +79,7 @@ const UserForm: React.FC<Props> = ({ defaultValues, handleSubmitForm, handleClos
{defaultValues && !('id' in defaultValues) && (
<>
<FormLabel htmlFor="name" style={{ marginTop: '8px' }}>
Password
{t('settings.tabs.users.form.password')}
</FormLabel>
<Controller
rules={{ required: true }}
Expand All @@ -99,7 +99,7 @@ const UserForm: React.FC<Props> = ({ defaultValues, handleSubmitForm, handleClos
)}

<FormLabel htmlFor="name" style={{ marginTop: '8px' }}>
Role
{t('settings.tabs.users.form.role')}
</FormLabel>

<Controller
Expand Down Expand Up @@ -165,10 +165,10 @@ const UserForm: React.FC<Props> = ({ defaultValues, handleSubmitForm, handleClos

<DrawerFooter mt="auto">
<Button colorScheme="blue" mr={3} type="submit" isLoading={isLoading}>
Save
{t('settings.tabs.users.form.save')}
</Button>
<Button variant="outline" mr={'auto'} onClick={handleClose} isLoading={isLoading}>
Cancel
{t('settings.tabs.users.form.cancel')}
</Button>
</DrawerFooter>
</form>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Settings/Users/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ const Users = () => {

const menuOptions = [
{
label: 'Edit user',
label: t('settings.tabs.users.edit'),
handleClick: (user: IUser) => setCurrentUser(user),
},
{
label: 'Remove user',
label: t('settings.tabs.users.remove'),
color: 'Red.$400',
handleClick: (user: IUser) => handleRemoveUser(user.id),
},
Expand Down

0 comments on commit d86028b

Please sign in to comment.