Skip to content

Commit 957cbd8

Browse files
committed
Update session management
1 parent c848b89 commit 957cbd8

File tree

7 files changed

+18
-22
lines changed

7 files changed

+18
-22
lines changed

src/commons/sideContent/content/SideContentSessionManagement.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ interface AdminViewProps {
2424
}
2525

2626
function AdminView({ users, playgroundCode }: AdminViewProps) {
27-
const { t } = useTranslation();
27+
const { t } = useTranslation('sideContent', { keyPrefix: 'sessionManagement' });
2828
const [toggleAll, setToggleAll] = useState<boolean>(true);
2929
const [defaultRole, setDefaultRole] = useState<boolean>(true);
3030
const [toggling, setToggling] = useState<{ [key: string]: boolean }>(
@@ -92,8 +92,8 @@ function AdminView({ users, playgroundCode }: AdminViewProps) {
9292
<HTMLTable compact className={classes['table']}>
9393
<thead>
9494
<tr>
95-
<th>{t('sessionManagement.name')}</th>
96-
<th>{t('sessionManagement.role')}</th>
95+
<th>{t('name')}</th>
96+
<th>{t('role')}</th>
9797
</tr>
9898
</thead>
9999
<tbody>
@@ -137,7 +137,7 @@ const SideContentSessionManagement: React.FC<Props> = ({
137137
readOnly,
138138
workspaceLocation
139139
}) => {
140-
const { t } = useTranslation();
140+
const { t } = useTranslation('sideContent', { keyPrefix: 'sessionManagement' });
141141
const dispatch = useDispatch();
142142

143143
useEffect(() => {
@@ -179,8 +179,8 @@ const SideContentSessionManagement: React.FC<Props> = ({
179179
<HTMLTable compact className={classes['table']}>
180180
<thead>
181181
<tr>
182-
<th>{t('sessionManagement.name')}</th>
183-
<th>{t('sessionManagement.role')}</th>
182+
<th>{t('name')}</th>
183+
<th>{t('role')}</th>
184184
</tr>
185185
</thead>
186186
<tbody>

src/i18n/locales/en/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import commons from './commons.json';
22
import grading from './grading.json';
33
import login from './login.json';
4-
import sessionManagement from './sessionManagement.json';
54
import sicp from './sicp.json';
65
import autograder from './sideContent/autograder.json';
76
import contestLeaderboard from './sideContent/contestLeaderboard.json';
@@ -11,6 +10,7 @@ import dataVisualizer from './sideContent/dataVisualizer.json';
1110
import faceapiDisplay from './sideContent/faceapiDisplay.json';
1211
import htmlDisplay from './sideContent/htmlDisplay.json';
1312
import resultCard from './sideContent/resultCard.json';
13+
import sessionManagement from './sideContent/sessionManagement.json';
1414
import substVisualizer from './sideContent/substVisualizer.json';
1515
import upload from './sideContent/upload.json';
1616
import sourcecast from './sourcecast.json';
@@ -23,7 +23,6 @@ export default {
2323
login,
2424
translation: {
2525
...grading,
26-
...sessionManagement,
2726
...sicp,
2827
...sourcecast,
2928
...sourceRecorder,
@@ -39,6 +38,7 @@ export default {
3938
faceapiDisplay,
4039
htmlDisplay,
4140
resultCard,
41+
sessionManagement,
4242
substVisualizer,
4343
upload
4444
}

src/i18n/locales/en/sessionManagement.json

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"name": "Name",
3+
"role": "Role"
4+
}

src/i18n/locales/zh-SG/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import commons from './commons.json';
22
import grading from './grading.json';
33
import login from './login.json';
4-
import sessionManagement from './sessionManagement.json';
54
import sicp from './sicp.json';
65
import autograder from './sideContent/autograder.json';
76
import contestLeaderboard from './sideContent/contestLeaderboard.json';
@@ -11,6 +10,7 @@ import dataVisualizer from './sideContent/dataVisualizer.json';
1110
import faceapiDisplay from './sideContent/faceapiDisplay.json';
1211
import htmlDisplay from './sideContent/htmlDisplay.json';
1312
import resultCard from './sideContent/resultCard.json';
13+
import sessionManagement from './sideContent/sessionManagement.json';
1414
import substVisualizer from './sideContent/substVisualizer.json';
1515
import upload from './sideContent/upload.json';
1616
import sourcecast from './sourcecast.json';
@@ -23,7 +23,6 @@ export default {
2323
login,
2424
translation: {
2525
...grading,
26-
...sessionManagement,
2726
...sicp,
2827
...sourcecast,
2928
...sourceRecorder,
@@ -39,6 +38,7 @@ export default {
3938
faceapiDisplay,
4039
htmlDisplay,
4140
resultCard,
41+
sessionManagement,
4242
substVisualizer,
4343
upload
4444
}

src/i18n/locales/zh-SG/sessionManagement.json

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"name": "姓名",
3+
"role": "角色"
4+
}

0 commit comments

Comments
 (0)