Skip to content

Commit

Permalink
Remove translations (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
maximilianruesch authored Jan 24, 2024
1 parent 715029c commit dc6fc2a
Show file tree
Hide file tree
Showing 17 changed files with 12 additions and 177 deletions.
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,10 @@
"electron-squirrel-startup": "^1.0.0",
"fastify": "^4.17.0",
"file-saver": "^2.0.5",
"i18next": "21.10.0",
"immer": "^9.0.19",
"lodash": "^4.17.21",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-i18next": "11.18.6",
"react-router-dom": "^6.4.5",
"use-immer": "^0.8.1",
"zustand": "^4.3.1"
Expand Down
13 changes: 0 additions & 13 deletions src/components/Login/Login.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,6 @@ jest.mock("react-router-dom", () => ({
useNavigate: () => mockedUsedNavigate,
}))

jest.mock("react-i18next", () => ({
useTranslation: () => ({
t: (str: string) => str,
i18n: {
changeLanguage: () => new Promise(() => {}),
},
}),
initReactI18next: {
type: "3rdParty",
init: () => {},
},
}))

describe("<Login />", () => {
it("should set providerLogin to JiraCloud after clicking on the Jira Cloud Button", async () => {
const { container, getByTestId } = render(
Expand Down
12 changes: 3 additions & 9 deletions src/components/Login/Login.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import {Button, Container, Divider, Group, Image, Paper, rgba} from "@mantine/core"
import { Button, Container, Divider, Image, Paper, rgba } from "@mantine/core"
import { IconCloud, IconServer } from "@tabler/icons-react"
import { ipcRenderer } from "electron"
import { useState } from "react"
import { useTranslation } from "react-i18next"
import { useNavigate } from "react-router-dom"
import { LanguageSelector } from "../common/LanguageSelector"
import { ColorSchemeToggle } from "../common/ColorSchemeToggle"
import { JiraCloudLogin } from "./jira-cloud/JiraCloudLogin"
import { JiraServerLogin } from "./jira-server/JiraServerLogin"
Expand All @@ -15,7 +13,6 @@ export function Login() {
const navigateTo = useNavigate()
const onSuccess = () => navigateTo("/projectsview")
const goBack = () => setProviderLogin("")
const { t } = useTranslation("login")
const colorScheme = useColorScheme()

return (
Expand All @@ -39,10 +36,7 @@ export function Login() {
borderRadius: theme.radius.lg,
})}
>
<Group gap="xs">
<ColorSchemeToggle ml="auto" />
<LanguageSelector />
</Group>
<ColorSchemeToggle ml="auto" />
<Image
mx="auto"
src="./project_canvas_logo.svg"
Expand All @@ -61,7 +55,7 @@ export function Login() {
<>
<Divider
my="lg"
label={t("choseProvider")}
label="Please choose a Provider"
labelPosition="center"
/>
<Button
Expand Down
12 changes: 0 additions & 12 deletions src/components/Login/jira-cloud/JiraCloudLogin.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,6 @@ jest.mock("electron", () => ({
removeAllListeners: jest.fn(),
},
}))
jest.mock("react-i18next", () => ({
useTranslation: () => ({
t: (str: string) => str,
i18n: {
changeLanguage: () => new Promise(() => {}),
},
}),
initReactI18next: {
type: "3rdParty",
init: () => {},
},
}))

describe("<JiraCloudLogin />", () => {
it("should call goBack when GO BACK button clicked", async () => {
Expand Down
4 changes: 1 addition & 3 deletions src/components/Login/jira-cloud/JiraCloudLogin.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Button, Center, Loader } from "@mantine/core"
import { ipcRenderer } from "electron"
import { useEffect } from "react"
import { useTranslation } from "react-i18next"
import { loginToJiraCloud } from "./loginToJiraCloud"

export function JiraCloudLogin({
Expand All @@ -11,7 +10,6 @@ export function JiraCloudLogin({
goBack: () => void
onSuccess: () => void
}) {
const { t } = useTranslation("login")
loginToJiraCloud({ onSuccess })

// Add event listener for "cancelOAuth" message
Expand All @@ -31,7 +29,7 @@ export function JiraCloudLogin({
<Loader size="xl" />
</Center>
<Button variant="outline" fullWidth color="dark" onClick={goBack}>
{t("button.goBack")}
Go Back
</Button>
</>
)
Expand Down
16 changes: 7 additions & 9 deletions src/components/Login/jira-server/LoginForm.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Button, Group, PasswordInput, Stack, TextInput } from "@mantine/core"
import { useForm } from "@mantine/form"
import { useTranslation } from "react-i18next"
import { LoginFormValues } from "./LoginFormValues"
import { loginToJiraServer } from "./loginToJiraServer"
import { getImportMetaEnv } from "../../../get-meta-env";
Expand All @@ -12,7 +11,6 @@ export function LoginForm({
goBack: () => void
onSuccess: () => void
}) {
const { t } = useTranslation("login")
const metaEnv = getImportMetaEnv()
const form = useForm<LoginFormValues>({
initialValues: {
Expand All @@ -30,20 +28,20 @@ export function LoginForm({
<Stack>
<TextInput
required
label={t("url")}
placeholder={t("urlPlaceholder")}
label="Instance URL"
placeholder="https://jira.example.com"
{...form.getInputProps("url")}
/>
<TextInput
required
label={t("username")}
placeholder={t("username")}
label="Username"
placeholder="Username"
{...form.getInputProps("username")}
/>
<PasswordInput
required
label={t("password")}
placeholder={t("password")}
label="Password"
placeholder="Password"
{...form.getInputProps("password")}
/>
</Stack>
Expand All @@ -62,7 +60,7 @@ export function LoginForm({
Log in
</Button>
<Button variant="outline" fullWidth color="dark" onClick={goBack}>
{t("button.goBack")}
Go Back
</Button>
</Group>
</form>
Expand Down
27 changes: 0 additions & 27 deletions src/components/common/LanguageSelector.tsx

This file was deleted.

34 changes: 0 additions & 34 deletions src/i18n/i18n.ts

This file was deleted.

15 changes: 0 additions & 15 deletions src/i18n/i18next.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { ReactQueryDevtools } from "@tanstack/react-query-devtools"
import { HashRouter } from "react-router-dom"
import { App } from "./App"
import { ThemeProvider } from "./ThemeProvider"
import "./i18n/i18n"

import '@mantine/core/styles.css';
import '@mantine/dates/styles.css';
Expand Down
1 change: 0 additions & 1 deletion src/translations/de/backlogView.json

This file was deleted.

10 changes: 0 additions & 10 deletions src/translations/de/login.json

This file was deleted.

1 change: 0 additions & 1 deletion src/translations/de/projectsView.json

This file was deleted.

1 change: 0 additions & 1 deletion src/translations/en/backlogView.json

This file was deleted.

10 changes: 0 additions & 10 deletions src/translations/en/login.json

This file was deleted.

1 change: 0 additions & 1 deletion src/translations/en/projectsView.json

This file was deleted.

29 changes: 1 addition & 28 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@
dependencies:
regenerator-runtime "^0.14.0"

"@babel/runtime@^7.12.5", "@babel/runtime@^7.14.5", "@babel/runtime@^7.17.2", "@babel/runtime@^7.18.3", "@babel/runtime@^7.20.7", "@babel/runtime@^7.5.5", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2":
"@babel/runtime@^7.12.5", "@babel/runtime@^7.18.3", "@babel/runtime@^7.20.7", "@babel/runtime@^7.5.5", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2":
version "7.23.2"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.23.2.tgz#062b0ac103261d68a966c4c7baf2ae3e62ec3885"
integrity sha512-mM8eg4yl5D6i3lu2QKPuPH4FArvJ8KhTofbE7jwMUv9KX5mBvwPAqnV3MlyBNqdp9RyRKP6Yck8TrfYrPvX3bg==
Expand Down Expand Up @@ -4849,13 +4849,6 @@ html-escaper@^2.0.0:
resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453"
integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==

html-parse-stringify@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/html-parse-stringify/-/html-parse-stringify-3.0.1.tgz#dfc1017347ce9f77c8141a507f233040c59c55d2"
integrity sha512-KknJ50kTInJ7qIScF3jeaFRpMpE8/lfiTdzf/twXyPBLAGrLRTmkz3AdTnKeh40X8k9L2fdYwEp/42WGXIRGcg==
dependencies:
void-elements "3.1.0"

http-cache-semantics@^4.0.0, http-cache-semantics@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz#abe02fcb2985460bf0323be664436ec3476a6d5a"
Expand Down Expand Up @@ -4919,13 +4912,6 @@ husky@^8.0.0:
resolved "https://registry.yarnpkg.com/husky/-/husky-8.0.3.tgz#4936d7212e46d1dea28fef29bb3a108872cd9184"
integrity sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==

[email protected]:
version "21.10.0"
resolved "https://registry.yarnpkg.com/i18next/-/i18next-21.10.0.tgz#85429af55fdca4858345d0e16b584ec29520197d"
integrity sha512-YeuIBmFsGjUfO3qBmMOc0rQaun4mIpGKET5WDwvu8lU7gvwpcariZLNtL0Fzj+zazcHUrlXHiptcFhBMFaxzfg==
dependencies:
"@babel/runtime" "^7.17.2"

[email protected]:
version "0.4.24"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"
Expand Down Expand Up @@ -7155,14 +7141,6 @@ react-dom@^18.2.0:
loose-envify "^1.1.0"
scheduler "^0.23.0"

[email protected]:
version "11.18.6"
resolved "https://registry.yarnpkg.com/react-i18next/-/react-i18next-11.18.6.tgz#e159c2960c718c1314f1e8fcaa282d1c8b167887"
integrity sha512-yHb2F9BiT0lqoQDt8loZ5gWP331GwctHz9tYQ8A2EIEUu+CcEdjBLQWli1USG3RdWQt3W+jqQLg/d4rrQR96LA==
dependencies:
"@babel/runtime" "^7.14.5"
html-parse-stringify "^3.0.1"

react-is@^16.13.1, react-is@^16.7.0:
version "16.13.1"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
Expand Down Expand Up @@ -8579,11 +8557,6 @@ vite@^5.0.0:
optionalDependencies:
fsevents "~2.3.3"

[email protected]:
version "3.1.0"
resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-3.1.0.tgz#614f7fbf8d801f0bb5f0661f5b2f5785750e4f09"
integrity sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w==

w3c-xmlserializer@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz#aebdc84920d806222936e3cdce408e32488a3073"
Expand Down

0 comments on commit dc6fc2a

Please sign in to comment.