Skip to content

Commit 6c5cfd5

Browse files
committed
Add translation
1 parent 927a68e commit 6c5cfd5

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

site/src/components/AppLink/ShareIcon.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,24 @@ import GroupOutlinedIcon from "@material-ui/icons/GroupOutlined"
44
import { FC } from "react"
55
import * as TypesGen from "../../api/typesGenerated"
66
import Tooltip from "@material-ui/core/Tooltip"
7+
import { useTranslation } from "react-i18next"
78

89
export interface ShareIconProps {
910
app: TypesGen.WorkspaceApp
1011
}
1112

1213
export const ShareIcon: FC<ShareIconProps> = ({ app }) => {
14+
const { t } = useTranslation("agent")
15+
1316
let shareIcon = <LockOutlinedIcon />
14-
let shareTooltip = "Private, only accessible by you"
17+
let shareTooltip = t("shareTooltip.private")
1518
if (app.sharing_level === "authenticated") {
1619
shareIcon = <GroupOutlinedIcon />
17-
shareTooltip = "Shared with all authenticated users"
20+
shareTooltip = t("shareTooltip.authenticated")
1821
}
1922
if (app.sharing_level === "public") {
2023
shareIcon = <PublicOutlinedIcon />
21-
shareTooltip = "Shared publicly"
24+
shareTooltip = t("shareTooltip.public")
2225
}
2326

2427
return <Tooltip title={shareTooltip}>{shareIcon}</Tooltip>

site/src/i18n/en/agent.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"shareTooltip": {
3+
"private": "Private, only accessible by you",
4+
"authenticated": "Shared with all authenticated users",
5+
"public": "Shared publicly"
6+
}
7+
}

site/src/i18n/en/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import createWorkspacePage from "./createWorkspacePage.json"
44
import templatePage from "./templatePage.json"
55
import templatesPage from "./templatesPage.json"
66
import workspacePage from "./workspacePage.json"
7+
import agent from "./agent.json"
78

89
export const en = {
910
common,
@@ -12,4 +13,5 @@ export const en = {
1213
templatePage,
1314
templatesPage,
1415
createWorkspacePage,
16+
agent,
1517
}

0 commit comments

Comments
 (0)