Skip to content

Commit 5e47801

Browse files
committed
feat: problem endpoint display
1 parent 49ff6e7 commit 5e47801

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/i18n/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ i18n
3636
'tools': 'Cryptography toolbox prepared for novice (WIP)',
3737
'visualize': 'Visualize cryptographic algorithm(WIP)',
3838
},
39+
'lab': {
40+
'endpoint': 'Endpoint ',
41+
'clear': 'Clear'
42+
},
3943
'wip': 'Work In Progress',
4044
i18n: {
4145
'en-US': 'English',
@@ -67,6 +71,10 @@ i18n
6771
'visualize': '图解密码学算法(施工中)',
6872
},
6973
'wip': '施工中',
74+
'lab': {
75+
'endpoint': '服务器 ',
76+
'clear': '关闭所有'
77+
},
7078
i18n: {
7179
'en-US': '英文',
7280
'zh-CN': '简体中文'

src/pages/practice/Lab.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ interface Match {
4646
}
4747

4848
export const Page: React.FC = () => {
49-
const { i18n } = useTranslation()
49+
const { t, i18n } = useTranslation()
5050
const language = i18n.language
5151
const { params: { category, lab } } = useRouteMatch<Match>()
5252
const query = useLabQuery({
@@ -72,10 +72,10 @@ export const Page: React.FC = () => {
7272
setTermianls(terminals.concat([endpoint]))
7373
}
7474
}
75-
return <Button key={id} onClick={onClick}intent={Intent.PRIMARY} outlined={true}>{endpoint.host}</Button>
75+
return <Button key={id} onClick={onClick}intent={Intent.PRIMARY} outlined={true}>{t('lab.endpoint') + id.toString()}</Button>
7676
})
7777
}
78-
<Button onClick={() => setTermianls([])} intent={Intent.DANGER} outlined={true}>clear</Button>
78+
<Button onClick={() => setTermianls([])} intent={Intent.DANGER} outlined={true}>{t('lab.clear')}</Button>
7979
</EndpointContainer>
8080
</>
8181
})

0 commit comments

Comments
 (0)