partial updates for welsh in myportal

This commit is contained in:
2025-02-11 08:54:26 +00:00
parent 130102ad30
commit e23cdef338
5 changed files with 37 additions and 3 deletions
+27
View File
@@ -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;
};