Skip to content

Commit ecb41a9

Browse files
committed
Add translations to preview card
1 parent 6c5cfd5 commit ecb41a9

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

site/src/components/Resources/AgentRowPreview.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { makeStyles } from "@material-ui/core/styles"
22
import { AppPreviewLink } from "components/AppLink/AppPreviewLink"
33
import { FC } from "react"
4+
import { useTranslation } from "react-i18next"
45
import { combineClasses } from "util/combineClasses"
56
import { WorkspaceAgent } from "../../api/typesGenerated"
67
import { Stack } from "../Stack/Stack"
@@ -11,6 +12,7 @@ export interface AgentRowPreviewProps {
1112

1213
export const AgentRowPreview: FC<AgentRowPreviewProps> = ({ agent }) => {
1314
const styles = useStyles()
15+
const { t } = useTranslation("agent")
1416

1517
return (
1618
<Stack
@@ -36,7 +38,7 @@ export const AgentRowPreview: FC<AgentRowPreviewProps> = ({ agent }) => {
3638
spacing={1}
3739
className={combineClasses([styles.noShrink, styles.agentDataItem])}
3840
>
39-
<span>Agent:</span>
41+
<span>{t("label.agent").toString()}:</span>
4042
<span className={styles.agentDataValue}>{agent.name}</span>
4143
</Stack>
4244

@@ -46,7 +48,7 @@ export const AgentRowPreview: FC<AgentRowPreviewProps> = ({ agent }) => {
4648
spacing={1}
4749
className={combineClasses([styles.noShrink, styles.agentDataItem])}
4850
>
49-
<span>OS:</span>
51+
<span>{t("label.os").toString()}:</span>
5052
<span
5153
className={combineClasses([
5254
styles.agentDataValue,
@@ -63,7 +65,7 @@ export const AgentRowPreview: FC<AgentRowPreviewProps> = ({ agent }) => {
6365
spacing={1}
6466
className={styles.agentDataItem}
6567
>
66-
<span>Apps:</span>
68+
<span>{t("label.apps").toString()}:</span>
6769
<Stack
6870
direction="row"
6971
alignItems="center"

site/src/i18n/en/agent.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,10 @@
33
"private": "Private, only accessible by you",
44
"authenticated": "Shared with all authenticated users",
55
"public": "Shared publicly"
6+
},
7+
"labels": {
8+
"agent": "Agent",
9+
"os": "OS",
10+
"apps": "Apps"
611
}
712
}

0 commit comments

Comments
 (0)