Skip to content

Commit

Permalink
Fix tranlsations in disclaimer (#1456)
Browse files Browse the repository at this point in the history
  • Loading branch information
MiraGeowerkstatt authored Aug 20, 2024
2 parents 6021ec8 + 9a2f0f3 commit df7dc12
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 16 deletions.
8 changes: 5 additions & 3 deletions src/client/cypress/e2e/app.cy.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { selectLanguage } from "./helpers/testHelpers";

describe("General app tests", () => {
it("Displays the login page in the correct language", () => {
// default is english
Expand All @@ -10,15 +12,15 @@ describe("General app tests", () => {
cy.contains("Welcome to");

// german
cy.contains("span", "DE").click();
selectLanguage("de");
cy.contains("Willkommen bei");

// french
cy.contains("span", "FR").click();
selectLanguage("fr");
cy.contains("Bienvenue sur");

// italian
cy.contains("span", "IT").click();
selectLanguage("it");
cy.contains("Benvenuti su");
});
});
1 change: 1 addition & 0 deletions src/client/public/locale/de/common.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"about": "Über",
"accept": "Akzeptieren",
"add": "Hinzufügen",
"addBackfill": "Verfüllung/Hinterfüllung hinzufügen",
"addCasing": "Verrohrung hinzufügen",
Expand Down
1 change: 1 addition & 0 deletions src/client/public/locale/en/common.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"about": "About",
"accept": "Accept",
"add": "Add",
"addBackfill": "Add sealing/backfilling",
"addCasing": "Add casing",
Expand Down
1 change: 1 addition & 0 deletions src/client/public/locale/fr/common.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"about": "A propos",
"accept": "Accepter",
"add": "Ajouter",
"addBackfill": "Ajouter un remplissage/remblayage",
"addCasing": "Ajouter un tubage",
Expand Down
1 change: 1 addition & 0 deletions src/client/public/locale/it/common.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"about": "A proposito",
"accept": "Accettare",
"add": "Aggiungere",
"addBackfill": "Aggiungere un'riempimento/rinterro",
"addCasing": "Aggiungere una tubazione",
Expand Down
4 changes: 2 additions & 2 deletions src/client/src/auth/SplashScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { FC, PropsWithChildren } from "react";
import { Stack, Typography } from "@mui/material";
import styled from "@mui/material/styles/styled";
import TranslationKeys from "./translationKeys";
import { useTranslation } from "react-i18next";
import { theme } from "../AppTheme.ts";
import { LanguagePopup } from "../components/header/languagePopup.tsx";

export const SplashScreen: FC<PropsWithChildren> = ({ children }) => {
const { t } = useTranslation();
Expand Down Expand Up @@ -54,7 +54,7 @@ export const SplashScreen: FC<PropsWithChildren> = ({ children }) => {
<Typography sx={{ fontSize: "0.8em", alignSelf: "center" }}>Borehole Data Management System</Typography>
</Stack>
{children}
<TranslationKeys />
<LanguagePopup />
</Stack>
</RowContainer>
</InnerContainer>
Expand Down
5 changes: 0 additions & 5 deletions src/client/src/pages/settings/termSettings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import PropTypes from "prop-types";
import { withTranslation } from "react-i18next";
import Markdown from "markdown-to-jsx";
import { Button, Form, Modal, TextArea } from "semantic-ui-react";

import TranslationKeys from "../../auth/translationKeys";

import { draftTerms, getTermsDraft, publishTerms } from "../../api-lib/index";

class TermSettings extends React.Component {
Expand Down Expand Up @@ -241,9 +239,6 @@ TermSettings.propTypes = {
user: PropTypes.object,
};

// TermSettings.defaultProps = {
// };

const mapStateToProps = state => {
return {
user: state.core_user,
Expand Down
8 changes: 4 additions & 4 deletions src/client/src/term/accept.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ export const AcceptTerms = ({ children }: { children: React.ReactNode }) => {
setIsFetching(false);
if (termsObject.data) {
setTerms({
en: termsObject.data?.en,
fr: termsObject.data?.fr,
de: termsObject.data?.de,
it: termsObject.data?.it,
en: termsObject.data?.en || en,
fr: termsObject.data?.fr || fr,
de: termsObject.data?.de || de,
it: termsObject.data?.it || it,
});
}
});
Expand Down
4 changes: 2 additions & 2 deletions src/client/src/term/disclaimerDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { useState } from "react";
import { useTranslation } from "react-i18next";
import { Dialog, DialogProps, Stack, Typography } from "@mui/material";
import { DialogFooterContainer, DialogHeaderContainer, DialogMainContent } from "../components/styledComponents.ts";
import TranslationKeys from "../auth/translationKeys";
import { AcceptButton } from "../components/buttons/buttons.tsx";
import { MarkdownWrapper } from "./markdownWrapper.tsx";
import { LanguagePopup } from "../components/header/languagePopup.tsx";

interface DisclaimerDialogProps {
onClose?: () => void;
Expand Down Expand Up @@ -34,7 +34,7 @@ export const DisclaimerDialog = ({ markdownContent, onClose = () => {} }: Discla
<Typography variant="h5" sx={{ flexGrow: 1 }}>
{t("terms")}
</Typography>
<TranslationKeys />
<LanguagePopup />
</Stack>
</DialogHeaderContainer>
<DialogMainContent>
Expand Down

0 comments on commit df7dc12

Please sign in to comment.