Skip to content

Commit 8aee4b7

Browse files
committed
Use translation files in more side content components
1 parent 69a5777 commit 8aee4b7

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed

src/commons/sideContent/content/SideContentContestVoting.tsx

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Button, Card, Classes, Collapse, Elevation, Icon, Pre, Tooltip } from '
22
import { IconNames } from '@blueprintjs/icons';
33
import classNames from 'classnames';
44
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
5+
import { useTranslation } from 'react-i18next';
56

67
import { ContestEntry } from '../../assessment/AssessmentTypes';
78

@@ -34,6 +35,7 @@ const SideContentContestVoting: React.FC<SideContentContestVotingProps> = ({
3435
handleContestEntryClick,
3536
handleVotingSubmissionChange
3637
}) => {
38+
const { t } = useTranslation('sideContent', { keyPrefix: 'contestVoting' });
3739
const [showContestEntries, setShowContestEntries] = useState(true);
3840
const [currentDraggedItem, setCurrentDraggedItem] = useState<HTMLElement | null>(null);
3941
const [hoveredTier, setHoveredTier] = useState<string | null>(null);
@@ -166,21 +168,22 @@ const SideContentContestVoting: React.FC<SideContentContestVotingProps> = ({
166168
</div>
167169
</div>
168170
) : (
169-
<div className="noResults">There are no eligible entries for voting found.</div>
171+
<div className="noResults">{t('noEntries')}</div>
170172
)}
171173
</div>
172174
),
173175
[
174-
isValid,
175-
canSave,
176+
tierBoard,
176177
sortedContestEntries,
177-
handleContestEntryClick,
178-
handleDragEnd,
179-
handleDragEnter,
180-
handleDragLeave,
181178
handleDragOver,
179+
handleDragLeave,
180+
handleDragEnter,
182181
handleDrop,
183-
tierBoard
182+
t,
183+
isValid,
184+
canSave,
185+
handleDragEnd,
186+
handleContestEntryClick
184187
]
185188
);
186189

@@ -209,15 +212,11 @@ const SideContentContestVoting: React.FC<SideContentContestVotingProps> = ({
209212
<Button
210213
className="collapse-button"
211214
icon={showContestEntries ? IconNames.CARET_DOWN : IconNames.CARET_RIGHT}
212-
minimal={true}
215+
variant="minimal"
213216
onClick={() => setShowContestEntries(!showContestEntries)}
214217
>
215-
<span>Contest Voting</span>
216-
<Tooltip
217-
content={
218-
<span>Rank your favourite contest entries from tiers D (worst) to S (best)!</span>
219-
}
220-
>
218+
<span>{t('title')}</span>
219+
<Tooltip content={<span>{t('tooltip')}</span>}>
221220
<Icon icon={IconNames.HELP} />
222221
</Tooltip>
223222
</Button>

src/commons/sideContent/content/SideContentFaceapiDisplay.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import { Button, Divider } from '@blueprintjs/core';
22
import { IconNames } from '@blueprintjs/icons';
33
import React from 'react';
4+
import { useTranslation } from 'react-i18next';
45

56
const SideContentFaceapiDisplay: React.FC = () => {
7+
const { t } = useTranslation('sideContent', { keyPrefix: 'faceapiDisplay' });
68
const browserWindow = window as any;
79

810
const takePhotoA = () => browserWindow.video.takePhotoA();
@@ -25,7 +27,7 @@ const SideContentFaceapiDisplay: React.FC = () => {
2527
style={{ height: 20 }}
2628
icon={IconNames.CAMERA}
2729
onClick={takePhoto}
28-
text={'Take picture'}
30+
text={t('takePicture')}
2931
/>
3032
</div>
3133
<Divider />
@@ -39,7 +41,7 @@ const SideContentFaceapiDisplay: React.FC = () => {
3941
style={{ height: 20 }}
4042
icon={IconNames.RESET}
4143
onClick={resetPhoto}
42-
text={'Reset'}
44+
text={t('reset')}
4345
/>
4446
</div>
4547
</div>

0 commit comments

Comments
 (0)