Skip to content

Commit 13acf59

Browse files
authored
chore: remove i18next (#9608)
1 parent 1a1c230 commit 13acf59

File tree

110 files changed

+549
-1496
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+549
-1496
lines changed

site/.storybook/preview.jsx

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { withRouter } from "storybook-addon-react-router-v6";
44
import { HelmetProvider } from "react-helmet-async";
55
import { dark } from "../src/theme";
66
import "../src/theme/globalFonts";
7-
import "../src/i18n";
87
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
98

109
export const decorators = [

site/package.json

-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@
6969
"eventsourcemock": "2.0.0",
7070
"formik": "2.4.1",
7171
"front-matter": "4.0.2",
72-
"i18next": "22.5.0",
7372
"jest-environment-jsdom": "29.5.0",
7473
"lodash": "4.17.21",
7574
"monaco-editor": "0.41.0",
@@ -82,7 +81,6 @@
8281
"react-dom": "18.2.0",
8382
"react-headless-tabs": "6.0.3",
8483
"react-helmet-async": "1.3.0",
85-
"react-i18next": "12.2.2",
8684
"react-markdown": "8.0.3",
8785
"react-router-dom": "6.15.0",
8886
"react-syntax-highlighter": "15.5.0",

site/pnpm-lock.yaml

-43
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/src/@types/i18n.d.ts

-10
This file was deleted.

site/src/components/Dialogs/DeleteDialog/DeleteDialog.test.tsx

+2-13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { screen } from "@testing-library/react";
22
import userEvent from "@testing-library/user-event";
3-
import i18next from "i18next";
43
import { render } from "testHelpers/renderHelpers";
54
import { DeleteDialog } from "./DeleteDialog";
65

@@ -20,7 +19,6 @@ describe("DeleteDialog", () => {
2019
});
2120

2221
it("disables confirm button when the text field is filled incorrectly", async () => {
23-
const { t } = i18next;
2422
render(
2523
<DeleteDialog
2624
isOpen
@@ -30,18 +28,13 @@ describe("DeleteDialog", () => {
3028
name="MyTemplate"
3129
/>,
3230
);
33-
const labelText = t("deleteDialog.confirmLabel", {
34-
ns: "common",
35-
entity: "template",
36-
});
37-
const textField = screen.getByLabelText(labelText);
31+
const textField = screen.getByTestId("delete-dialog-name-confirmation");
3832
await userEvent.type(textField, "MyTemplateWrong");
3933
const confirmButton = screen.getByRole("button", { name: "Delete" });
4034
expect(confirmButton).toBeDisabled();
4135
});
4236

4337
it("enables confirm button when the text field is filled correctly", async () => {
44-
const { t } = i18next;
4538
render(
4639
<DeleteDialog
4740
isOpen
@@ -51,11 +44,7 @@ describe("DeleteDialog", () => {
5144
name="MyTemplate"
5245
/>,
5346
);
54-
const labelText = t("deleteDialog.confirmLabel", {
55-
ns: "common",
56-
entity: "template",
57-
});
58-
const textField = screen.getByLabelText(labelText);
47+
const textField = screen.getByTestId("delete-dialog-name-confirmation");
5948
await userEvent.type(textField, "MyTemplate");
6049
const confirmButton = screen.getByRole("button", { name: "Delete" });
6150
expect(confirmButton).not.toBeDisabled();

site/src/components/Dialogs/DeleteDialog/DeleteDialog.tsx

+9-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import makeStyles from "@mui/styles/makeStyles";
22
import TextField from "@mui/material/TextField";
33
import { Maybe } from "components/Conditionals/Maybe";
44
import { ChangeEvent, useState, PropsWithChildren, FC } from "react";
5-
import { useTranslation } from "react-i18next";
65
import { ConfirmDialog } from "../ConfirmDialog/ConfirmDialog";
76

87
export interface DeleteDialogProps {
@@ -25,7 +24,6 @@ export const DeleteDialog: FC<PropsWithChildren<DeleteDialogProps>> = ({
2524
confirmLoading,
2625
}) => {
2726
const styles = useStyles();
28-
const { t } = useTranslation("common");
2927
const [nameValue, setNameValue] = useState("");
3028
const confirmed = name === nameValue;
3129
const handleChange = (event: ChangeEvent<HTMLInputElement>) => {
@@ -35,11 +33,12 @@ export const DeleteDialog: FC<PropsWithChildren<DeleteDialogProps>> = ({
3533

3634
const content = (
3735
<>
38-
<p>{t("deleteDialog.intro", { entity })}</p>
36+
<p>Deleting this {entity} is irreversible!</p>
3937
<Maybe condition={info !== undefined}>
4038
<p className={styles.warning}>{info}</p>
4139
</Maybe>
42-
<p>{t("deleteDialog.confirm", { entity, name })}</p>
40+
<p>Are you sure you want to proceed?</p>
41+
<p>Type {name} below to confirm.</p>
4342

4443
<form
4544
onSubmit={(e) => {
@@ -59,9 +58,12 @@ export const DeleteDialog: FC<PropsWithChildren<DeleteDialogProps>> = ({
5958
placeholder={name}
6059
value={nameValue}
6160
onChange={handleChange}
62-
label={t("deleteDialog.confirmLabel", { entity })}
61+
label={`Name of the ${entity} to delete`}
6362
error={hasError}
64-
helperText={hasError && t("deleteDialog.incorrectName", { entity })}
63+
helperText={
64+
hasError && `${nameValue} does not match the name of this ${entity}`
65+
}
66+
inputProps={{ ["data-testid"]: "delete-dialog-name-confirmation" }}
6567
/>
6668
</form>
6769
</>
@@ -72,7 +74,7 @@ export const DeleteDialog: FC<PropsWithChildren<DeleteDialogProps>> = ({
7274
type="delete"
7375
hideCancel={false}
7476
open={isOpen}
75-
title={t("deleteDialog.title", { entity })}
77+
title={`Delete ${entity}`}
7678
onConfirm={onConfirm}
7779
onClose={onCancel}
7880
description={content}

site/src/components/Expander/Expander.tsx

+2-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
} from "components/DropdownArrows/DropdownArrows";
77
import { PropsWithChildren, FC } from "react";
88
import Collapse from "@mui/material/Collapse";
9-
import { useTranslation } from "react-i18next";
109
import { combineClasses } from "utils/combineClasses";
1110

1211
export interface ExpanderProps {
@@ -20,7 +19,6 @@ export const Expander: FC<PropsWithChildren<ExpanderProps>> = ({
2019
children,
2120
}) => {
2221
const styles = useStyles();
23-
const { t } = useTranslation("common");
2422

2523
const toggleExpanded = () => setExpanded(!expanded);
2624

@@ -29,7 +27,7 @@ export const Expander: FC<PropsWithChildren<ExpanderProps>> = ({
2927
{!expanded && (
3028
<Link onClick={toggleExpanded} className={styles.expandLink}>
3129
<span className={styles.text}>
32-
{t("ctas.expand")}
30+
Click here to learn more
3331
<OpenDropdown margin={false} />
3432
</span>
3533
</Link>
@@ -43,7 +41,7 @@ export const Expander: FC<PropsWithChildren<ExpanderProps>> = ({
4341
className={combineClasses([styles.expandLink, styles.collapseLink])}
4442
>
4543
<span className={styles.text}>
46-
{t("ctas.collapse")}
44+
Click here to hide
4745
<CloseDropdown margin={false} />
4846
</span>
4947
</Link>

site/src/components/IconField/IconField.tsx

+2-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { useRef, FC, useState } from "react";
77
import Picker from "@emoji-mart/react";
88
import { makeStyles } from "@mui/styles";
99
import { colors } from "theme/colors";
10-
import { useTranslation } from "react-i18next";
1110
import data from "@emoji-mart/data/sets/14/twitter.json";
1211
import { Stack } from "components/Stack/Stack";
1312

@@ -26,15 +25,14 @@ const IconField: FC<IconFieldProps> = ({ onPickEmoji, ...textFieldProps }) => {
2625
const styles = useStyles();
2726
const emojiButtonRef = useRef<HTMLButtonElement>(null);
2827
const [isEmojiPickerOpen, setIsEmojiPickerOpen] = useState(false);
29-
const { t } = useTranslation("templateSettingsPage");
3028
const hasIcon = textFieldProps.value && textFieldProps.value !== "";
3129

3230
return (
3331
<Stack spacing={1}>
3432
<TextField
3533
{...textFieldProps}
3634
fullWidth
37-
label={t("iconLabel")}
35+
label="Icon"
3836
InputProps={{
3937
endAdornment: hasIcon ? (
4038
<InputAdornment position="end" className={styles.adornment}>
@@ -59,7 +57,7 @@ const IconField: FC<IconFieldProps> = ({ onPickEmoji, ...textFieldProps }) => {
5957
setIsEmojiPickerOpen((v) => !v);
6058
}}
6159
>
62-
{t("selectEmoji")}
60+
Select emoji
6361
</Button>
6462

6563
<Popover

site/src/components/Resources/AgentOutdatedTooltip.tsx

+7-13
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111
} from "components/HelpTooltip/HelpTooltip";
1212
import { WorkspaceAgent } from "api/typesGenerated";
1313
import { Stack } from "components/Stack/Stack";
14-
import { useTranslation } from "react-i18next";
1514

1615
type AgentOutdatedTooltipProps = ComponentProps<typeof HelpPopover> & {
1716
agent: WorkspaceAgent;
@@ -30,7 +29,6 @@ export const AgentOutdatedTooltip: FC<AgentOutdatedTooltipProps> = ({
3029
anchorEl,
3130
}) => {
3231
const styles = useStyles();
33-
const { t } = useTranslation("workspacePage");
3432

3533
return (
3634
<HelpPopover
@@ -43,25 +41,21 @@ export const AgentOutdatedTooltip: FC<AgentOutdatedTooltipProps> = ({
4341
<HelpTooltipContext.Provider value={{ open, onClose }}>
4442
<Stack spacing={1}>
4543
<div>
46-
<HelpTooltipTitle>
47-
{t("agentOutdatedTooltip.title")}
48-
</HelpTooltipTitle>
44+
<HelpTooltipTitle>Agent Outdated</HelpTooltipTitle>
4945
<HelpTooltipText>
50-
{t("agentOutdatedTooltip.description")}
46+
This agent is an older version than the Coder server. This can
47+
happen after you update Coder with running workspaces. To fix
48+
this, you can stop and start the workspace.
5149
</HelpTooltipText>
5250
</div>
5351

5452
<Stack spacing={0.5}>
55-
<span className={styles.versionLabel}>
56-
{t("agentOutdatedTooltip.agentVersionLabel")}
57-
</span>
53+
<span className={styles.versionLabel}>Agent version</span>
5854
<span>{agent.version}</span>
5955
</Stack>
6056

6157
<Stack spacing={0.5}>
62-
<span className={styles.versionLabel}>
63-
{t("agentOutdatedTooltip.serverVersionLabel")}
64-
</span>
58+
<span className={styles.versionLabel}>Server version</span>
6559
<span>{serverVersion}</span>
6660
</Stack>
6761

@@ -71,7 +65,7 @@ export const AgentOutdatedTooltip: FC<AgentOutdatedTooltipProps> = ({
7165
onClick={onUpdate}
7266
ariaLabel="Update workspace"
7367
>
74-
{t("agentOutdatedTooltip.updateWorkspaceLabel")}
68+
Update workspace
7569
</HelpTooltipAction>
7670
</HelpTooltipLinksGroup>
7771
</Stack>

0 commit comments

Comments
 (0)