Skip to content

Commit 282adbc

Browse files
authored
fix: i18n for operators in action sequence. (#447)
1 parent ab8e85c commit 282adbc

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/components/ActionCard.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Card, Elevation } from '@blueprintjs/core'
22

33
import clsx from 'clsx'
4+
import { useAtomValue } from 'jotai'
45
import { FC, ReactNode } from 'react'
56
import { FCC } from 'types'
67

@@ -9,8 +10,12 @@ import { FactItem } from 'components/FactItem'
910
import { CopilotDocV1 } from 'models/copilot.schema'
1011
import { findActionType } from 'models/types'
1112

12-
import { useTranslation } from '../i18n/i18n'
13-
import { findOperatorDirection, getSkillUsageTitle } from '../models/operator'
13+
import { languageAtom, useTranslation } from '../i18n/i18n'
14+
import {
15+
findOperatorDirection,
16+
getLocalizedOperatorName,
17+
getSkillUsageTitle,
18+
} from '../models/operator'
1419
import { formatDuration } from '../utils/times'
1520

1621
interface ActionCardProps {
@@ -25,6 +30,7 @@ export const ActionCard: FC<ActionCardProps> = ({
2530
title,
2631
}) => {
2732
const t = useTranslation()
33+
const language = useAtomValue(languageAtom)
2834
const type = findActionType(action.type)
2935

3036
title ??= (
@@ -47,7 +53,7 @@ export const ActionCard: FC<ActionCardProps> = ({
4753
{'name' in action && action.name && (
4854
<FactItem
4955
dense
50-
title={action.name}
56+
title={getLocalizedOperatorName(action.name, language)}
5157
icon="mugshot"
5258
className="font-bold"
5359
/>

0 commit comments

Comments
 (0)