Skip to content

Commit 94424aa

Browse files
committed
Add build translation
1 parent 7f90d06 commit 94424aa

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Stats, StatsItem } from "components/Stats/Stats"
22
import { FC } from "react"
3+
import { useTranslation } from "react-i18next"
34
import { Link } from "react-router-dom"
45
import { WorkspaceBuild } from "../../api/typesGenerated"
56
import { displayWorkspaceBuildDuration } from "../../util/workspace"
@@ -11,25 +12,27 @@ export interface WorkspaceBuildStatsProps {
1112
export const WorkspaceBuildStats: FC<WorkspaceBuildStatsProps> = ({
1213
build,
1314
}) => {
15+
const { t } = useTranslation("buildPage")
16+
1417
return (
1518
<Stats>
1619
<StatsItem
17-
label="Workspace"
20+
label={t("stats.workspace")}
1821
value={
1922
<Link to={`/@${build.workspace_owner_name}/${build.workspace_name}`}>
2023
{build.workspace_name}
2124
</Link>
2225
}
2326
/>
2427
<StatsItem
25-
label="Duration"
28+
label={t("stats.duration")}
2629
value={displayWorkspaceBuildDuration(build)}
2730
/>
2831
<StatsItem
29-
label="Started at"
32+
label={t("stats.startedAt")}
3033
value={new Date(build.created_at).toLocaleString()}
3134
/>
32-
<StatsItem label="Action" value={build.transition} />
35+
<StatsItem label={t("stats.action")} value={build.transition} />
3336
</Stats>
3437
)
3538
}

site/src/i18n/en/buildPage.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"stats": {
3+
"workspace": "Workspace",
4+
"duration": "Duration",
5+
"startedAt": "Started at",
6+
"action": "Action"
7+
}
8+
}

site/src/i18n/en/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import templatePage from "./templatePage.json"
55
import templatesPage from "./templatesPage.json"
66
import workspacePage from "./workspacePage.json"
77
import agent from "./agent.json"
8+
import buildPage from "./buildPage.json"
89

910
export const en = {
1011
common,
@@ -14,4 +15,5 @@ export const en = {
1415
templatesPage,
1516
createWorkspacePage,
1617
agent,
18+
buildPage,
1719
}

0 commit comments

Comments
 (0)