diff --git a/components/myportal/awaitingsubmissionfromblob.js b/components/myportal/awaitingsubmissionfromblob.js index f4a26c87..be32e0eb 100644 --- a/components/myportal/awaitingsubmissionfromblob.js +++ b/components/myportal/awaitingsubmissionfromblob.js @@ -288,7 +288,10 @@ const AwaitingSubmissionFromBlob = (props) => { )}
- LPA: + + {router.locale == "cy" ? "ACLl" : "LPA"} + : + {router.locale == "cy" ? jsonpath( '$..[?(@.value=="' + diff --git a/components/myportal/topthree.js b/components/myportal/topthree.js index 6eb25afe..9c33cdbb 100644 --- a/components/myportal/topthree.js +++ b/components/myportal/topthree.js @@ -394,7 +394,7 @@ const TopThree = (props) => {
)}
- LPA: + {router.locale == "cy" ? "ACLl" : "LPA"}: {router.locale == "cy" ? jsonpath( '$..[?(@.value=="' + diff --git a/components/myportal/topthree_reps.js b/components/myportal/topthree_reps.js index 42930b34..8ebbbaff 100644 --- a/components/myportal/topthree_reps.js +++ b/components/myportal/topthree_reps.js @@ -313,7 +313,7 @@ const TopThree = (props) => { {repRaisedDate(showTopThreeArr[key].repfile_name)}
{" "}
- LPA: + {router.locale == "cy" ? "ACLl" : "LPA"}: {" "} {router.locale == "cy" diff --git a/components/utils/index.js b/components/utils/index.js index 67841c5b..f3d07bde 100644 --- a/components/utils/index.js +++ b/components/utils/index.js @@ -8,6 +8,7 @@ import { getPortalModuleDetails, } from "../../actions"; import data from "../../data/collections.json"; +import { useRouter } from "next/router"; import xpath from "xpath"; @@ -644,3 +645,29 @@ export const updateLinks = (jsonObj) => { return jsonObj; }; + +export const whichRepType = (props) => { + const router = useRouter(); + const { locale } = router; + let repType; + let whichBaseType = + props.currentView?.caseReference.repDetails.representationType || + formObj.representationForm.values.representationType; + + switch (whichBaseType) { + case "Statement": + repType = router.locale == "cy" ? "Datganiad" : "Statment"; + break; + case "Questionnaire": + repType = router.locale == "cy" ? "Holiadur" : "Questionnaire"; + break; + case "Final comments": + repType = + router.locale == "cy" ? "Sylwadau terfynol" : "Final comments"; + break; + default: + // code block + } + + return repType; +}; diff --git a/data/lookuptranslations.json b/data/lookuptranslations.json index 1eb991fc..7a5e3f46 100644 --- a/data/lookuptranslations.json +++ b/data/lookuptranslations.json @@ -611,6 +611,10 @@ { "value": "Interested Party", "value_cy": "Parti รข Buddiant" + }, + { + "value": "LPA", + "value_cy": "ACLl" } ], "representation-type": [