Skip to content

added react-i18next to FE #3682

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 24, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
snake case to camel case
  • Loading branch information
Kira-Pilot committed Aug 24, 2022
commit 41ec9e8b2ea2b58406d7fe5c881aa7df6b01fc56
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const WorkspaceScheduleButton: React.FC<WorkspaceScheduleButtonProps> = (
disabled={!deadlineMinusEnabled()}
onClick={onDeadlineMinus}
>
<Tooltip title={t("workspace_schedule_button.edit_deadline_minus")}>
<Tooltip title={t("workspaceScheduleButton.editDeadlineMinus")}>
<RemoveIcon />
</Tooltip>
</IconButton>
Expand All @@ -84,7 +84,7 @@ export const WorkspaceScheduleButton: React.FC<WorkspaceScheduleButtonProps> = (
disabled={!deadlinePlusEnabled()}
onClick={onDeadlinePlus}
>
<Tooltip title={t("workspace_schedule_button.edit_deadline_plus")}>
<Tooltip title={t("WorkspaceScheduleButton.editDeadlinePlus")}>
<AddIcon />
</Tooltip>
</IconButton>
Expand All @@ -100,7 +100,7 @@ export const WorkspaceScheduleButton: React.FC<WorkspaceScheduleButtonProps> = (
}}
className={styles.scheduleButton}
>
{t("workspace_schedule_button.schedule")}
{t("workspaceScheduleButton.schedule")}
</Button>
<Popover
classes={{ paper: styles.popoverPaper }}
Expand Down
22 changes: 11 additions & 11 deletions site/src/components/WorkspaceStatusBadge/WorkspaceStatusBadge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,67 +26,67 @@ export const getStatus = (
switch (status) {
case undefined:
return {
text: t("workspace_status.loading", { ns: "common" }),
text: t("workspaceStatus.loading", { ns: "common" }),
icon: <LoadingIcon />,
}
case "started":
return {
type: "success",
text: t("workspace_status.started", { ns: "common" }),
text: t("workspaceStatus.started", { ns: "common" }),
icon: <PlayIcon />,
}
case "starting":
return {
type: "success",
text: t("workspace_status.starting", { ns: "common" }),
text: t("workspaceStatus.starting", { ns: "common" }),
icon: <LoadingIcon />,
}
case "stopping":
return {
type: "warning",
text: t("workspace_status.stopping", { ns: "common" }),
text: t("workspaceStatus.stopping", { ns: "common" }),
icon: <LoadingIcon />,
}
case "stopped":
return {
type: "warning",
text: t("workspace_status.stopped", { ns: "common" }),
text: t("workspaceStatus.stopped", { ns: "common" }),
icon: <StopIcon />,
}
case "deleting":
return {
type: "warning",
text: t("workspace_status.deleting", { ns: "common" }),
text: t("workspaceStatus.deleting", { ns: "common" }),
icon: <LoadingIcon />,
}
case "deleted":
return {
type: "error",
text: t("workspace_status.deleted", { ns: "common" }),
text: t("workspaceStatus.deleted", { ns: "common" }),
icon: <ErrorIcon />,
}
case "canceling":
return {
type: "warning",
text: t("workspace_status.canceling", { ns: "common" }),
text: t("workspaceStatus.canceling", { ns: "common" }),
icon: <LoadingIcon />,
}
case "canceled":
return {
type: "warning",
text: t("workspace_status.canceled", { ns: "common" }),
text: t("workspaceStatus.canceled", { ns: "common" }),
icon: <ErrorIcon />,
}
case "error":
return {
type: "error",
text: t("workspace_status.failed", { ns: "common" }),
text: t("workspaceStatus.failed", { ns: "common" }),
icon: <ErrorIcon />,
}
case "queued":
return {
type: "info",
text: t("workspace_status.queued", { ns: "common" }),
text: t("workspaceStatus.queued", { ns: "common" }),
icon: <LoadingIcon />,
}
}
Expand Down
2 changes: 1 addition & 1 deletion site/src/i18n/en/common.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"workspace_status": {
"workspaceStatus": {
"loading": "Loading",
"started": "Running",
"starting": "Starting",
Expand Down
6 changes: 3 additions & 3 deletions site/src/i18n/en/workspacePage.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"workspace_schedule_button": {
"workspaceScheduleButton": {
"schedule": "Schedule",
"edit_deadline_minus": "Subtract one hour",
"edit_deadline_plus": "Add one hour"
"editDeadlineMinus": "Subtract one hour",
"editDeadlinePlus": "Add one hour"
}
}
2 changes: 1 addition & 1 deletion site/src/pages/WorkspacePage/WorkspacePage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ describe("WorkspacePage", () => {
await testStatus(MockDeletingWorkspace, DisplayStatusLanguage.deleting)
})
it("shows the Deleted status when the workspace is deleted", async () => {
await testStatus(MockDeletedWorkspace, t("workspace_status.deleted", { ns: "common" }))
await testStatus(MockDeletedWorkspace, t("workspaceStatus.deleted", { ns: "common" }))
})

describe("Timeline", () => {
Expand Down