From cb27f80e7fd0908747e23fb4e8e70dd4d493a5a9 Mon Sep 17 00:00:00 2001 From: rdbsolutions Date: Thu, 11 Apr 2024 11:26:07 +0100 Subject: [PATCH] update language translations placeholders --- components/footer.js | 5 +- .../myportal/awaitingsubmissionfromblob.js | 20 ++++--- components/myportal/topthree.js | 19 ++++--- components/myportal/topthree_reps.js | 20 ++++++- components/myportal/viewall.js | 53 +++++++++++-------- components/myportal/watchedcases.js | 9 +++- components/newappeal/buildsection.js | 2 +- data/lookuptranslations.json | 28 ++++++++++ locales/cy/common.json | 2 + locales/cy/myportal.json | 4 +- locales/cy/newappeal.json | 1 + locales/en/common.json | 2 + locales/en/myportal.json | 4 +- 13 files changed, 127 insertions(+), 42 deletions(-) diff --git a/components/footer.js b/components/footer.js index b5627591..3a97f47f 100644 --- a/components/footer.js +++ b/components/footer.js @@ -34,7 +34,7 @@ export default function Footer(props) { const copyToClipBoard = async (copyMe) => { try { await navigator.clipboard.writeText(copyMe); - setCopySuccess(" - done!"); + setCopySuccess(" - " + t("common:social-bar-share-copy-link-done")); } catch (err) { setCopySuccess("Failed to copy!"); } @@ -145,7 +145,8 @@ export default function Footer(props) { Share this page via{" "} - Copy Link {copySuccess} + {t("common:social-bar-share-copy-link")}{" "} + {copySuccess} diff --git a/components/myportal/awaitingsubmissionfromblob.js b/components/myportal/awaitingsubmissionfromblob.js index 904b81a5..17f80f5f 100644 --- a/components/myportal/awaitingsubmissionfromblob.js +++ b/components/myportal/awaitingsubmissionfromblob.js @@ -138,12 +138,20 @@ const AwaitingSubmissionFromBlob = (props) => {
{t("myportal:appeal-type-label")}:{" "} - { - getFormCollectionByID( - showTopThreeArr[key] - .pinswg_appealcasetype - ).value - } + {router.locale == "cy" + ? jsonpath( + '$..[?(@.value=="' + + getFormCollectionByID( + showTopThreeArr[key] + .pinswg_appealcasetype + ).value + + '")].value_cy', + transLookup + ) + : getFormCollectionByID( + showTopThreeArr[key] + .pinswg_appealcasetype + ).value || ""}
{t("myportal:case-address")}:{" "} diff --git a/components/myportal/topthree.js b/components/myportal/topthree.js index 10b460cd..a002a68c 100644 --- a/components/myportal/topthree.js +++ b/components/myportal/topthree.js @@ -162,7 +162,7 @@ const TopThree = (props) => { showTopThreeArr[key].pinswg_publishtoweb === false ? ( {showTopThreeArr[key].ticketnumber}{" "} - - Pending + - {t("myportal:appeal-pending-label")} ) : ( { topThreeType == "watchedCases") && ( */}
{t("myportal:appeal-type-label")}:{" "} - { - showTopThreeArr[key][ - "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" - ] - } + {router.locale == "cy" + ? jsonpath( + '$..[?(@.value=="' + + showTopThreeArr[key][ + "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" + ] + + '")].value_cy', + transLookup + ) + : showTopThreeArr[key][ + "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" + ] || ""}
{/* )} */} {/* {topThreeType != "awaitingSubmission" ? ( */} diff --git a/components/myportal/topthree_reps.js b/components/myportal/topthree_reps.js index fc86e376..42506d22 100644 --- a/components/myportal/topthree_reps.js +++ b/components/myportal/topthree_reps.js @@ -188,12 +188,28 @@ const TopThree = (props) => {
{t("myportal:representation-type")}: {" "} - {showTopThreeArr[key].representationType} + + {router.locale == "cy" + ? jsonpath( + '$..[?(@.value=="' + + showTopThreeArr[key].representationType + + '")].value_cy', + transLookup + ) + : showTopThreeArr[key].representationType || ""}
{t("myportal:capacity")}: {" "} - {showTopThreeArr[key].representationCapacity} + {router.locale == "cy" + ? jsonpath( + '$..[?(@.value=="' + + showTopThreeArr[key] + .representationCapacity + + '")].value_cy', + transLookup + ) + : showTopThreeArr[key].representationCapacity || ""}
{t("myportal:date-raised")}: diff --git a/components/myportal/viewall.js b/components/myportal/viewall.js index 29e2f0fe..ddc73ff0 100644 --- a/components/myportal/viewall.js +++ b/components/myportal/viewall.js @@ -81,7 +81,8 @@ const ViewAllResults = (props) => { {currentView.viewKey == "myCases" && resultsArr[key].pinswg_publishtoweb === false ? (
- {resultsArr[key].ticketnumber} Pending + {resultsArr[key].ticketnumber}{" "} + {t("myportal:appeal-pending-label")}
) : ( { : currentView.viewKey == "myRepresentations" ? repRaisedDate(item.createdDate) // ? router.locale == "cy" : // ? jsonpath( - // - // '$..[?(@.value=="' + - // searchDetailsObj[key].value[0][ - // "statuscode@OData.Community.Display.V1.FormattedValue" - // ] + - // '")].value_cy',transLookup, - // ) - // : searchDetailsObj[key].value[0][ - // "statuscode@OData.Community.Display.V1.FormattedValue" - // ] || "N/A" - // : router.locale == "cy" - // ? jsonpath( - // - // '$..[?(@.value=="' + - // item[ - // "statuscode@OData.Community.Display.V1.FormattedValue" - // ] + - // '")].value_cy',transLookup, - // ) - item[ + // + // '$..[?(@.value=="' + + // searchDetailsObj[key].value[0][ + // "statuscode@OData.Community.Display.V1.FormattedValue" + // ] + + // '")].value_cy',transLookup, + // ) + // : searchDetailsObj[key].value[0][ + // "statuscode@OData.Community.Display.V1.FormattedValue" + // ] || "N/A" + // : router.locale == "cy" + // ? jsonpath( + // + // '$..[?(@.value=="' + + // item[ + // "statuscode@OData.Community.Display.V1.FormattedValue" + // ] + + // '")].value_cy',transLookup, + // ) + + router.locale == "cy" + ? jsonpath( + '$..[?(@.value=="' + + item[ + "statuscode@OData.Community.Display.V1.FormattedValue" + ] + + '")].value_cy', + transLookup + ) + : item[ "statuscode@OData.Community.Display.V1.FormattedValue" ] || "N/A"} diff --git a/components/myportal/watchedcases.js b/components/myportal/watchedcases.js index 9c3dba6a..787685db 100644 --- a/components/myportal/watchedcases.js +++ b/components/myportal/watchedcases.js @@ -47,9 +47,14 @@ const WatchedCases = (props) => { }); }} > - {t("myportal:viewall-link")}{" "} + {/* {t("myportal:viewall-link")}{" "} {props.watchedCases.watchedCases["@odata.count"] + - " cases"} + " cases"} */} + {t("myportal:viewall-link-count", { + count: props.watchedCases.watchedCases[ + "@odata.count" + ], + })}
)} diff --git a/components/newappeal/buildsection.js b/components/newappeal/buildsection.js index 2484721e..e7d73b50 100644 --- a/components/newappeal/buildsection.js +++ b/components/newappeal/buildsection.js @@ -474,7 +474,7 @@ let BuildSection = (props) => { {savingStatus ? ( - Saving data + {router.locale == "cy" ? "Nôl data" : "Saving data"}