Skip to content

Commit

Permalink
Feat: #309 Add Swedish translation
Browse files Browse the repository at this point in the history
  • Loading branch information
MARZOOQUE authored and georgepadayatti committed Jan 5, 2024
1 parent e66b435 commit 07ace52
Show file tree
Hide file tree
Showing 13 changed files with 295 additions and 262 deletions.
47 changes: 24 additions & 23 deletions src/components/modals/globalDataPolicyConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {
import { OrganizationDetailsCRUDContext } from "../../contexts/organizationDetailsCrud";
import { useForm, FormProvider, Controller } from "react-hook-form";
import { HttpService } from "../../service/HTTPService";
import { useTranslation } from "react-i18next";

const tableCellStyle: CSS.Properties = {
fontWeight: "normal",
Expand Down Expand Up @@ -67,17 +68,6 @@ interface Props {
setOpen: Dispatch<SetStateAction<boolean>>;
}

const thirdPartyDataSharingOptions = [
{
value: false,
label: "False",
},
{
value: true,
label: "True",
},
];

let defaultValues = {
name: "string",
version: "string",
Expand All @@ -92,6 +82,17 @@ let defaultValues = {

export default function GlobalDataPolicyConfigModal(props: Props) {
const { open, setOpen } = props;
const { t } = useTranslation("translation");
const thirdPartyDataSharingOptions = [
{
value: false,
label: t("common.false"),
},
{
value: true,
label: t("common.true"),
},
];

const { organisationDetails, logoImageBase64, coverImageBase64 } = useContext(
OrganizationDetailsCRUDContext
Expand Down Expand Up @@ -156,7 +157,7 @@ export default function GlobalDataPolicyConfigModal(props: Props) {
<form onSubmit={methods.handleSubmit(onSubmit)}>
<HeaderContainer>
<Typography pl={2} color="#F3F3F6">
Global Data Policy Configurations{" "}
{t("dataAgreements.globalDataPolicyConfigurations")}{" "}
</Typography>
<CloseIcon
onClick={() => setOpen(false)}
Expand Down Expand Up @@ -201,7 +202,7 @@ export default function GlobalDataPolicyConfigModal(props: Props) {
{organisationDetails.location}
</Typography>
<Typography variant="subtitle1" mt={2}>
Overview
{t("common.overView")}
</Typography>
<Typography
color="#9F9F9F"
Expand All @@ -215,7 +216,7 @@ export default function GlobalDataPolicyConfigModal(props: Props) {
<Box mt={2}>
<Typography variant="subtitle1">
{" "}
Global Data Policy Configurations{" "}
{t("dataAgreements.globalDataPolicyConfigurations")}{" "}
</Typography>
<table
style={{
Expand All @@ -232,7 +233,7 @@ export default function GlobalDataPolicyConfigModal(props: Props) {
style={{ ...tableCellStyle, borderTop: 0 }}
scope="row"
>
Policy URL
{t("common.policyUrl")}
</th>

<td style={{ ...tableCellStyle, borderTop: 0 }}>
Expand All @@ -254,7 +255,7 @@ export default function GlobalDataPolicyConfigModal(props: Props) {

<tr>
<th style={tableCellStyle} scope="row">
Jurisdiction
{t("dataAgreements.jurisdiction")}
</th>

<td style={tableCellStyle}>
Expand All @@ -276,7 +277,7 @@ export default function GlobalDataPolicyConfigModal(props: Props) {

<tr>
<th style={tableCellStyle} scope="row">
Industry scope
{t("dataAgreements.industryScope")}
</th>

<td
Expand Down Expand Up @@ -308,7 +309,7 @@ export default function GlobalDataPolicyConfigModal(props: Props) {

<tr>
<th style={tableCellStyle} scope="row">
Storage Location
{t("dataAgreements.storageLocation")}
</th>

<td style={tableCellStyle}>
Expand All @@ -330,7 +331,7 @@ export default function GlobalDataPolicyConfigModal(props: Props) {

<tr>
<th style={tableCellStyle} scope="row">
Data retention period in year(s)
{t("dataAgreements.retentionPeriod")}
</th>

<td style={tableCellStyle}>
Expand All @@ -351,7 +352,7 @@ export default function GlobalDataPolicyConfigModal(props: Props) {
</tr>

<tr>
<th style={tableCellStyle}>Geographic restriction</th>
<th style={tableCellStyle}>{t("dataAgreements.geographicRestriction")}</th>

<td style={{ ...tableCellStyle, borderRight: 0 }}>
<input
Expand All @@ -374,7 +375,7 @@ export default function GlobalDataPolicyConfigModal(props: Props) {

<tr>
<th style={tableCellStyle}>
Third party data sharing
{t("dataAgreements.3pp")}
</th>

<td style={{ ...tableCellStyle, borderRight: 0 }}>
Expand Down Expand Up @@ -428,7 +429,7 @@ export default function GlobalDataPolicyConfigModal(props: Props) {
}}
variant="outlined"
>
Close
{t("common.close")}
</Button>
<Button
variant="outlined"
Expand All @@ -450,7 +451,7 @@ export default function GlobalDataPolicyConfigModal(props: Props) {
},
}}
>
Save
{t("common.save")}
</Button>
</FooterContainer>
</form>
Expand Down
28 changes: 9 additions & 19 deletions src/pages/dataAgreements/DataAgreements.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import VersionDropdown from "../../components/dataAgreements/versionDropdown";
import { useTranslation } from "react-i18next";
import { TableEmptyMessage } from "../../components/tableEmptyMessage";
import '../../index.css'
import useLanguageChange from "../../utils/translateTableLanguage";

const Container = styled("div")(({ theme }) => ({
margin: "58px 15px 0px 15px",
Expand Down Expand Up @@ -88,13 +89,7 @@ const DataAgreement = () => {
setSelectedDropdownDataAgreementValue,
] = useState<any>({});
const { t } = useTranslation("translation");

// split delete description so that to make DELETE word to bold
const deleteDescription = t("dataAgreements.deleteDADescription");
const splittedDeleteDescription = deleteDescription.split("Please type ");
// split publish description so that to make DELETE word to bold
const publishDescription = t("dataAgreements.publishDADescription");
const splittedPublishDescription = publishDescription.split("Please type ");
const key = useLanguageChange();

const [listFilterValue, setListFilterValue] = useState("all");
const refresh = useRefresh();
Expand Down Expand Up @@ -475,6 +470,7 @@ const DataAgreement = () => {
sx={{
width: "100%",
}}
key={key}
>
<PurposeField
source="purpose"
Expand Down Expand Up @@ -535,12 +531,9 @@ const DataAgreement = () => {
}
modalDescriptionText={
<Typography variant="body1">
{splittedDeleteDescription[0]}Please type{" "}
<b>{splittedDeleteDescription[1].split(" ")[0]}</b>
{" " +
splittedDeleteDescription[1].substring(
splittedDeleteDescription[1].indexOf(" ") + 1
)}
{t("dataAgreements.deleteDADescription1")}
<b>DELETE</b>
{t("dataAgreements.deleteDADescription2")}
</Typography>
}
setSelectedDropdownValue={setSelectedDropdownValue}
Expand All @@ -561,12 +554,9 @@ const DataAgreement = () => {
}
modalDescriptionText={
<Typography variant="body1">
{splittedPublishDescription[0]}Please type{" "}
<b>{splittedPublishDescription[1].split(" ")[0]}</b>
{" " +
splittedPublishDescription[1].substring(
splittedPublishDescription[1].indexOf(" ") + 1
)}
{t("dataAgreements.publishDADescription1")}
<b>PUBLISH</b>
{t("dataAgreements.publishDADescription2")}
</Typography>
}
/>
Expand Down
34 changes: 18 additions & 16 deletions src/pages/developerAPIs/developerAPIs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { formatISODateToLocalString } from "../../utils/formatISODateToLocalStri
import { configStore } from "../../store/configStore";
import { useTranslation } from "react-i18next";
import { TableEmptyMessage } from "../../components/tableEmptyMessage";
import useLanguageChange from "../../utils/translateTableLanguage";

const Container = styled("div")(({ theme }) => ({
margin: "58px 15px 0px 15px",
Expand Down Expand Up @@ -73,9 +74,7 @@ const DeveloperAPIs = () => {
const [openDeleteApiKey, setOpenDeleteApiKey] = useState(false);
const [developerApiDeleteID, setDeveloperApiDeleteID] = useState<any>();
const { t } = useTranslation("translation");
// split delete description so that to make DELETE word to bold
const deleteDescription = t("developerAPIs.deleteDescription");
const splittedDeleteDescription = deleteDescription.split("Please type ");
const key = useLanguageChange();

const refresh = useRefresh();
const onRefetch = () => {
Expand Down Expand Up @@ -117,7 +116,9 @@ const DeveloperAPIs = () => {
}
return (
record[props.source] && (
<Typography variant="body2">{formatISODateToLocalString(record[props.source])}</Typography>
<Typography variant="body2">
{formatISODateToLocalString(record[props.source])}
</Typography>
)
);
};
Expand Down Expand Up @@ -151,7 +152,10 @@ const DeveloperAPIs = () => {

return (
<Container>
<BreadCrumb Link={t("sidebar.account")} Link2={t("sidebar.developerAPIs")} />
<BreadCrumb
Link={t("sidebar.account")}
Link2={t("sidebar.developerAPIs")}
/>
<Snackbar
open={showAPI}
anchorOrigin={{ vertical: "top", horizontal: "right" }}
Expand Down Expand Up @@ -193,12 +197,12 @@ const DeveloperAPIs = () => {

<HeaderContainer>
<Typography variant="h6" fontWeight="bold">
{t("developerAPIs.headerText")}
{t("developerAPIs.headerText")}
</Typography>
</HeaderContainer>
<DetailsContainer sx={{ flexGrow: 1 }}>
<Typography variant="body2" mt={1.25} mb={1}>
{t("developerAPIs.pageDescription")}
{t("developerAPIs.pageDescription")}
</Typography>
<Grid container spacing={2}>
<Grid item lg={4} md={12} sm={12} xs={12}>
Expand Down Expand Up @@ -239,7 +243,7 @@ const DeveloperAPIs = () => {
fontWeight="bold"
mb={0.5}
>
{t("developerAPIs.configuredBaseURL")}
{t("developerAPIs.configuredBaseURL")}
</Typography>
<Typography color="grey" variant="body2">
{stagingURL}
Expand All @@ -249,7 +253,7 @@ const DeveloperAPIs = () => {
<Grid item lg={12} md={12} sm={12} xs={12}>
<Box style={{ display: "flex", alignItems: "center" }} mt={1}>
<Typography color="black" variant="subtitle1" fontWeight="bold">
{t("developerAPIs.apiKey")}
{t("developerAPIs.apiKey")}
</Typography>
<Tooltip title={t("developerAPIs.createApiKey")} placement="top">
<AddCircleOutlineOutlinedIcon
Expand All @@ -268,7 +272,7 @@ const DeveloperAPIs = () => {
actions={false}
sx={{ width: "100%", overflow: "hidden" }}
empty={<TableEmptyMessage />}
>
>
<Box
style={{
display: "flex",
Expand All @@ -282,6 +286,7 @@ const DeveloperAPIs = () => {
overflow: "auto",
width: "100%",
}}
key={key}
>
<TextField
source="name"
Expand Down Expand Up @@ -324,12 +329,9 @@ const DeveloperAPIs = () => {
onRefetch={onRefetch}
modalDescriptionText={
<Typography variant="body1">
{splittedDeleteDescription[0]}Please type{" "}
<b>{splittedDeleteDescription[1].split(" ")[0]}</b>
{" " +
splittedDeleteDescription[1].substring(
splittedDeleteDescription[1].indexOf(" ") + 1
)}
{t("developerAPIs.deleteDescription1")}
<b>DELETE</b>
{t("developerAPIs.deleteDescription2")}
</Typography>
}
/>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/manageAdmin/manageAdmin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ const ManageAdmin = () => {
<TextField
variant="standard"
autoComplete="off"
placeholder="Name"
placeholder={t("common.name")}
sx={{ marginTop: -0.1 }}
style={{
...editStyleEnable,
Expand Down Expand Up @@ -411,7 +411,7 @@ const ManageAdmin = () => {
<Typography variant="body2">{t("manageAdmin.confirmNewPassword")}:</Typography>
<TextField
variant="standard"
placeholder="Confirm New Password"
placeholder={t("manageAdmin.confirmNewPassword")}
type="password"
sx={{ width: "50%", marginRight: "20px" }}
value={confirmNewPassword}
Expand Down
5 changes: 4 additions & 1 deletion src/pages/personalData/personalData.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useState } from "react";
import { useEffect, useState } from "react";
import { List, Datagrid, TextField, Form, useRefresh } from "react-admin";

import {
Expand All @@ -19,6 +19,7 @@ import BreadCrumb from "../../components/Breadcrumbs";
import EditPersonalDataModal from "../../components/modals/editPersonalDataModal";
import { useTranslation } from "react-i18next";
import { TableEmptyMessage } from "../../components/tableEmptyMessage";
import useLanguageChange from "../../utils/translateTableLanguage";

const Container = styled("div")(({ theme }) => ({
margin: "58px 15px 0px 15px",
Expand All @@ -41,6 +42,7 @@ const PersonalData = () => {
useState(false);
const [listFilterValue, setListFilterValue] = useState("all");
const { t } = useTranslation("translation");
const key = useLanguageChange();

const refresh = useRefresh();

Expand Down Expand Up @@ -136,6 +138,7 @@ const PersonalData = () => {
width: "100%",
}}
rowClick="edit"
key={key}
>
<TextField
source="name"
Expand Down
11 changes: 2 additions & 9 deletions src/pages/userAccess/userAcess.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ const UserAccess = () => {
const [successMessage, setSuccessMessage] = useState("");
const [errorMessage, setErrorMessage] = useState("");
const { t } = useTranslation("translation");
// split delete description so that to make DELETE word to bold
const deleteDescription = t("userAccess.deleteDescription");
const splittedDeleteDescription = deleteDescription.split("Please type ");

useEffect(() => {
HttpService.listAllIdps().then((response) => {
Expand Down Expand Up @@ -240,12 +237,8 @@ const UserAccess = () => {
userAccessId={idpDetails?.id}
modalDescriptionText={
<Typography variant="body1">
{splittedDeleteDescription[0]}Please type{" "}
<b>{splittedDeleteDescription[1].split(" ")[0]}</b>
{" " +
splittedDeleteDescription[1].substring(
splittedDeleteDescription[1].indexOf(" ") + 1
)}
{t("userAccess.deleteDescription1")} <b>DELETE</b>
{t("userAccess.deleteDescription2")}
</Typography>
}
/>
Expand Down
Loading

0 comments on commit 07ace52

Please sign in to comment.