Skip to content

Commit a5da88b

Browse files
committed
Add i18n
1 parent 6cf89a4 commit a5da88b

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

site/src/components/AuditLogRow/AuditLogRow.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { CloseDropdown, OpenDropdown } from "components/DropdownArrows/DropdownA
88
import { Pill } from "components/Pill/Pill"
99
import { Stack } from "components/Stack/Stack"
1010
import { UserAvatar } from "components/UserAvatar/UserAvatar"
11+
import { t } from "i18next"
1112
import { ComponentProps, useState } from "react"
1213
import { Link as RouterLink } from "react-router-dom"
1314
import { createDayString } from "util/createDayString"
@@ -68,9 +69,9 @@ const ResourceLink: React.FC<{
6869
}
6970

7071
const actionLabelByAction: Record<AuditLog["action"], string> = {
71-
create: "created a new",
72-
write: "updated",
73-
delete: "deleted",
72+
create: t("actions.create", { ns: "auditLog" }),
73+
write: t("actions.write", { ns: "auditLog" }),
74+
delete: t("actions.delete", { ns: "auditLog" }),
7475
}
7576

7677
const resourceLabelByResourceType: Record<AuditLog["resource_type"], string> = {

site/src/i18n/en/auditLog.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"actions": {
3+
"create": "created a new",
4+
"write": "updated",
5+
"delete": "deleted"
6+
}
7+
}

site/src/i18n/en/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
import auditLog from "./auditLog.json"
12
import common from "./common.json"
23
import workspacePage from "./workspacePage.json"
34

45
export const en = {
56
common,
67
workspacePage,
8+
auditLog,
79
}

0 commit comments

Comments
 (0)