From 643c2ef12060b6d2b2dd005781dfea3ac5ec4dfb Mon Sep 17 00:00:00 2001 From: MiraGeowerkstatt Date: Thu, 15 Aug 2024 10:00:58 +0200 Subject: [PATCH 1/4] Replace simply TranslationTexts --- .../domain/dropdown/domainDropdown.jsx | 5 +- .../domain/tree/domainTree.jsx | 15 +-- .../multiple/multipleForm.jsx | 2 +- .../attachments/table/filesTableComponent.jsx | 24 +--- .../src/pages/detail/detailPageContent.jsx | 5 +- .../form/borehole/boreholeDetailSegment.jsx | 53 +++----- .../form/borehole/boreholeGeneralSegment.jsx | 13 +- .../location/cantonMunicipalitySegment.jsx | 10 +- .../form/location/indentifierSegment.jsx | 15 +-- .../detail/form/location/nameSegment.jsx | 15 +-- .../form/location/restrictionSegment.jsx | 15 +-- .../stratigraphy/hierarchicalDataSearch.jsx | 4 +- .../lithologyAttributes.jsx | 3 +- .../lithologyHeader/profileHeader.jsx | 6 +- .../infoCheckBox/infoCheckBox.jsx | 9 +- .../lithologyLayersList.jsx | 17 +-- .../lithologyLayers/profileLayers.jsx | 7 +- .../lithologyLayersError.jsx | 22 ++-- .../detail/form/workflow/workflowForm.jsx | 34 +++--- .../commons/workgroupSelect.tsx | 5 +- .../sidePanelContent/filter/listFilter.jsx | 2 +- .../sidePanelContent/importer/importModal.tsx | 4 +- .../importer/importModalContent.tsx | 13 +- .../src/pages/settings/aboutSettings.jsx | 12 +- .../pages/settings/admin/adminSettings.jsx | 113 +++++++----------- .../editorSettingList/editorSettingList.jsx | 7 +- .../editorSettingList/mapSettings.jsx | 11 +- .../src/pages/settings/editorSettings.jsx | 3 +- 28 files changed, 170 insertions(+), 274 deletions(-) diff --git a/src/client/src/components/legacyComponents/domain/dropdown/domainDropdown.jsx b/src/client/src/components/legacyComponents/domain/dropdown/domainDropdown.jsx index efa44b5e0..6ef1ef993 100644 --- a/src/client/src/components/legacyComponents/domain/dropdown/domainDropdown.jsx +++ b/src/client/src/components/legacyComponents/domain/dropdown/domainDropdown.jsx @@ -7,7 +7,6 @@ import _ from "lodash"; import { loadDomains } from "../../../../api-lib/index.js"; import { Form, Header } from "semantic-ui-react"; -import TranslationText from "../../translationText.jsx"; class DomainDropdown extends React.Component { constructor(props) { @@ -115,7 +114,7 @@ class DomainDropdown extends React.Component { } render() { - const { domains, schema, search, multiple, additionalValues, readOnly } = this.props, + const { domains, schema, search, multiple, additionalValues, readOnly, t } = this.props, { selected } = this.state; if (!Object.prototype.hasOwnProperty.call(domains.data, schema)) { if (domains.isFetching === true) { @@ -134,7 +133,7 @@ class DomainDropdown extends React.Component { style={{ color: "red", }}> - + {t("reset")} ), }); diff --git a/src/client/src/components/legacyComponents/domain/tree/domainTree.jsx b/src/client/src/components/legacyComponents/domain/tree/domainTree.jsx index 01bb50345..33ba0e261 100644 --- a/src/client/src/components/legacyComponents/domain/tree/domainTree.jsx +++ b/src/client/src/components/legacyComponents/domain/tree/domainTree.jsx @@ -5,7 +5,6 @@ import { withTranslation } from "react-i18next"; import _ from "lodash"; import { loadDomains } from "../../../../api-lib/index.js"; import { Dropdown, Form, Header, Icon, Input, List, Modal } from "semantic-ui-react"; -import TranslationText from "../../translationText.jsx"; import DomainText from "../domainText.jsx"; class DomainTree extends React.Component { @@ -157,7 +156,7 @@ class DomainTree extends React.Component { } render() { - const { domains, schema, isEditable } = this.props; + const { domains, schema, isEditable, t } = this.props; if (!Object.prototype.hasOwnProperty.call(domains.data, schema)) { if (domains.isFetching === true) { return "loading translations"; @@ -173,7 +172,7 @@ class DomainTree extends React.Component { style={{ color: "red", }}> - + {t("reset")} ), }, @@ -215,7 +214,7 @@ class DomainTree extends React.Component { style={{ color: "red", }}> - + {t("reset")} ), }, @@ -367,9 +366,7 @@ class DomainTree extends React.Component { flex: "1 1 100%", }}> - + {this.state.levels.map((lev, idx) => { @@ -465,9 +462,7 @@ class DomainTree extends React.Component { flex: "1 1 100%", }}> - + {workgroups.length === 0 ? ( - + t("disabled") ) : workgroups.length === 1 ? ( workgroups[0].workgroup ) : ( diff --git a/src/client/src/pages/detail/attachments/table/filesTableComponent.jsx b/src/client/src/pages/detail/attachments/table/filesTableComponent.jsx index d03ca1f3e..0a697f67e 100644 --- a/src/client/src/pages/detail/attachments/table/filesTableComponent.jsx +++ b/src/client/src/pages/detail/attachments/table/filesTableComponent.jsx @@ -3,10 +3,10 @@ import { withTranslation } from "react-i18next"; import { Button, Checkbox, Icon, Table, TextArea } from "semantic-ui-react"; import DateText from "../../../../components/legacyComponents/dateText.js"; import DownloadLink from "../downloadlink.jsx"; -import TranslationText from "../../../../components/legacyComponents/translationText.jsx"; import { downloadBoreholeAttachment } from "../../../../api/fetchApiV2.js"; const FilesTableComponent = props => { + const { t } = props; return (
{ - {props.editor === true && ( - - - - )} - - - - - - - - - - - - + {props.editor === true && {t("public")}} + {t("name")} + {t("description")} + {t("type")} + {t("uploaded")} {props.unlocked === true ? : null} diff --git a/src/client/src/pages/detail/detailPageContent.jsx b/src/client/src/pages/detail/detailPageContent.jsx index 24880e321..1dc98d9a4 100644 --- a/src/client/src/pages/detail/detailPageContent.jsx +++ b/src/client/src/pages/detail/detailPageContent.jsx @@ -6,7 +6,6 @@ import _ from "lodash"; import { Redirect, Route, Switch, withRouter } from "react-router-dom"; import { loadBorehole, patchBorehole, updateBorehole } from "../../api-lib"; import EditorBoreholeFilesTable from "./attachments/table/editorBoreholeFilesTable.tsx"; -import TranslationText from "../../components/legacyComponents/translationText.jsx"; import { Dimmer, Loader } from "semantic-ui-react"; import Lithology from "./form/stratigraphy/lithology"; import IdentifierSegment from "./form/location/indentifierSegment.jsx"; @@ -273,9 +272,9 @@ class DetailPageContent extends React.Component { {(() => { if (borehole.isFetching || this.state.loadingFetch === true) { - return ; + return t("layer_loading_fetch"); } else if (this.state.creationFetch === true) { - return ; + return t("layer_creation_fetch"); } })()} diff --git a/src/client/src/pages/detail/form/borehole/boreholeDetailSegment.jsx b/src/client/src/pages/detail/form/borehole/boreholeDetailSegment.jsx index f347aba37..86c4f021b 100644 --- a/src/client/src/pages/detail/form/borehole/boreholeDetailSegment.jsx +++ b/src/client/src/pages/detail/form/borehole/boreholeDetailSegment.jsx @@ -1,5 +1,4 @@ import _ from "lodash"; - import DomainDropdown from "../../../../components/legacyComponents/domain/dropdown/domainDropdown.jsx"; import DomainTree from "../../../../components/legacyComponents/domain/tree/domainTree.jsx"; import TranslationText from "../../../../components/legacyComponents/translationText.jsx"; @@ -10,9 +9,11 @@ import { parseIfString } from "../../../../components/legacyComponents/formUtils import { DisabledRadio } from "../styledComponents.jsx"; import { getBoreholeGeometryDepthTVD } from "../../../../api/fetchApiV2.js"; import { useCallback, useEffect, useState } from "react"; +import { useTranslation } from "react-i18next"; const BoreholeDetailSegment = props => { const { size, borehole, updateChange, updateNumber, isEditable } = props; + const { t } = useTranslation(); const [depthTVD, setDepthTVD] = useState(null); @@ -61,9 +62,7 @@ const BoreholeDetailSegment = props => { - + { - + { updateChange("custom.qt_depth", selected.id, false); @@ -94,9 +91,7 @@ const BoreholeDetailSegment = props => { opacity: 0.6, pointerEvents: "none", }}> - + { - + { opacity: 0.6, pointerEvents: "none", }}> - + { - + { opacity: 0.6, pointerEvents: "none", }}> - + { - + { updateChange("custom.lithology_top_bedrock", selected.id, false); }} schema="custom.lithology_top_bedrock" selected={borehole.data.custom.lithology_top_bedrock} - title={} + title={t("lithology_top_bedrock")} isEditable={isEditable} /> - + { }} schema="custom.lithostratigraphy_top_bedrock" selected={borehole.data.custom.lithostratigraphy_top_bedrock} - title={} + title={t("lithostratigraphy_top_bedrock")} isEditable={isEditable} /> - + { }} schema="custom.chronostratigraphy_top_bedrock" selected={borehole.data.custom.chronostratigraphy_top_bedrock} - title={} + title={t("chronostratigraphy_top_bedrock")} isEditable={isEditable} /> - + { const { size, borehole, updateChange, isEditable } = props; + const { t } = useTranslation(); + return (
{ {/* drilling type in Borehole */} - + { updateChange("borehole_type", selected.id, false); @@ -34,9 +35,7 @@ const BoreholeGeneralSegment = props => { - + { updateChange("extended.purpose", selected.id, false); @@ -71,7 +70,7 @@ const BoreholeGeneralSegment = props => { }}> - + {t("remarks")}