updated welsh translations

This commit is contained in:
2023-05-23 10:38:03 +01:00
parent dc43d7f2b4
commit 275258562e
45 changed files with 677 additions and 7698 deletions
+10 -1
View File
@@ -101,7 +101,16 @@ const RegisterComplete = (props) => {
onClick={() => {
setLogout(),
window.localStorage.clear(),
destroyCookie({}, "pinsUser"),
destroyCookie(
null,
"next-auth.csrf-token"
),
destroyCookie(
null,
"next-auth.callback-url"
),
destroyCookie(null, "pedw_locale"),
destroyCookie(null, "pinsUser"),
signOut({ callbackUrl: "/logout" });
}}
>
+51 -20
View File
@@ -87,7 +87,9 @@ const Breadcrumbs = (props) => {
<a
href={
router.locale != "en"
? router.locale + "/myportal"
? "/" +
router.locale +
"/fymhorth"
: "/myportal"
}
className="govuk-breadcrumbs__link"
@@ -123,10 +125,13 @@ const Breadcrumbs = (props) => {
{router.pathname == "/myportal/advancedsearch" ? (
<>
<li className="govuk-breadcrumbs__list-item">
www
<Link
href={
router.locale != "en"
? router.locale + "/myportal"
? "/" +
router.locale +
"/fymhorth"
: "/myportal"
}
>
@@ -177,7 +182,9 @@ const Breadcrumbs = (props) => {
<Link
href={
router.locale != "en"
? router.locale + "/myportal"
? "/" +
router.locale +
"/fymhorth"
: "/myportal"
}
>
@@ -217,7 +224,9 @@ const Breadcrumbs = (props) => {
<Link
href={
router.locale != "en"
? router.locale + "/myportal"
? "/" +
router.locale +
"/fymhorth"
: "/myportal"
}
>
@@ -239,7 +248,9 @@ const Breadcrumbs = (props) => {
<Link
href={
router.locale != "en"
? router.locale + "/myportal"
? "/" +
router.locale +
"/fymhorth"
: "/myportal"
}
>
@@ -261,7 +272,9 @@ const Breadcrumbs = (props) => {
<Link
href={
router.locale != "en"
? router.locale + "/myportal"
? "/" +
router.locale +
"/fymhorth"
: "/myportal"
}
>
@@ -286,7 +299,9 @@ const Breadcrumbs = (props) => {
<Link
href={
router.locale != "en"
? router.locale + "/myportal"
? "/" +
router.locale +
"/fymhorth"
: "/myportal"
}
>
@@ -299,7 +314,9 @@ const Breadcrumbs = (props) => {
<Link
href={
router.locale != "en"
? router.locale + "/myportal"
? "/" +
router.locale +
"/fymhorth"
: "/myportal"
}
>
@@ -321,7 +338,9 @@ const Breadcrumbs = (props) => {
<Link
href={
router.locale != "en"
? router.locale + "/myportal"
? "/" +
router.locale +
"/fymhorth"
: "/myportal"
}
>
@@ -331,7 +350,7 @@ const Breadcrumbs = (props) => {
</Link>
</li>
<li className="govuk-breadcrumbs__list-item">
Your cases
{t("common:breadcrumb-your-cases")}
</li>
</>
) : (
@@ -345,7 +364,7 @@ const Breadcrumbs = (props) => {
router.locale != "en"
? "/" +
router.locale +
"/myportal"
"/fymhorth"
: "/myportal"
}
>
@@ -380,7 +399,9 @@ const Breadcrumbs = (props) => {
<Link
href={
router.locale != "en"
? router.locale + "/myportal"
? "/" +
router.locale +
"/fymhorth"
: "/myportal"
}
>
@@ -393,12 +414,14 @@ const Breadcrumbs = (props) => {
<Link
href={
router.locale != "en"
? router.locale + "/viewall"
: "/viewall"
? "/" +
router.locale +
"/fymhorth/gweldpopeth"
: "/myportal/viewall"
}
>
<a className="govuk-breadcrumbs__link">
Your cases{" "}
{t("common:breadcrumb-your-cases")}
</a>
</Link>
</li>
@@ -421,7 +444,9 @@ const Breadcrumbs = (props) => {
<Link
href={
router.locale != "en"
? router.locale + "/myportal"
? "/" +
router.locale +
"/fymhorth"
: "/myportal"
}
>
@@ -443,7 +468,9 @@ const Breadcrumbs = (props) => {
<Link
href={
router.locale != "en"
? router.locale + "/myportal"
? "/" +
router.locale +
"/fymhorth"
: "/myportal"
}
>
@@ -564,7 +591,9 @@ const Breadcrumbs = (props) => {
<Link
href={
router.locale == "cy"
? router.locale + "/myportal"
? "/" +
router.locale +
"/fymhorth"
: "/myportal"
}
>
@@ -595,7 +624,9 @@ const Breadcrumbs = (props) => {
<Link
href={
router.locale == "cy"
? router.locale + "/myportal"
? "/" +
router.locale +
"/fymhorth"
: "/myportal"
}
>
@@ -814,7 +845,7 @@ const Breadcrumbs = (props) => {
<Link
href={
router.locale != "en"
? router.locale + "/myportal"
? "/" + router.locale +"/fymhorth"
: "/myportal"
}
>
+18 -8
View File
@@ -447,15 +447,19 @@ const CaseSummary = (props) => {
"watchedCases"
);
alert(
"You have stopped watching case " +
t(
"case:you-have-stopped-watching-label"
) +
props.currentView
.caseReference
.currentReference
);
}}
title="Stop watching this case"
title={t(
"case:stop-watching-case-link"
)}
>
Stop watching this case{" "}
{t("case:stop-watching-case-link")}{" "}
</span>
) : (
<span
@@ -472,14 +476,17 @@ const CaseSummary = (props) => {
.appealType
);
alert(
"You are watching case " +
t(
"case:you-are-watching-label"
) +
" " +
props.currentView
.caseReference
.currentReference
);
}}
>
Watch this case
{t("case:watch-this-case-link")}
</span>
))}
@@ -505,9 +512,9 @@ const CaseSummary = (props) => {
// item.title
// );
}}
title="Watch this case"
title={t("case:watch-this-case-link")}
>
Watch this case
{t("case:watch-this-case-link")}
</span>
)}
</div>
@@ -524,7 +531,10 @@ const CaseSummary = (props) => {
detailsObj.pinswg_representation_period_end_date
) && (
<div className="govuk-body">
Representation Period ended on{" "}
{t(
"case:representation-period-ended-on-label"
)}
{formatDates(
detailsObj.pinswg_representation_period_end_date
)}
-2
View File
@@ -1,7 +1,6 @@
import { Field, reduxForm } from "redux-form";
import { useRouter } from "next/router";
import DatePicker, { registerLocale, setDefaultLocale } from "react-datepicker";
import cy from "date-fns/locale/cy";
import React, { useCallback, useEffect, useMemo, useState } from "react";
import "react-datepicker/dist/react-datepicker.css";
import moment from "moment";
@@ -288,7 +287,6 @@ const RenderDatePicker = ({
...custom
}) => {
const router = useRouter();
registerLocale("cy", cy);
var startDateArr =
custom.dateStart != "0" ? custom.dateStart.split("") : custom.dateStart;
+26 -2
View File
@@ -220,8 +220,22 @@ const Header = (props) => {
<a
onClick={() => {
window.localStorage.clear(),
destroyCookie({}, "pinsUser"),
signOut({ callbackUrl: "/logout" });
destroyCookie(
null,
"next-auth.csrf-token"
),
destroyCookie(
null,
"next-auth.callback-url"
),
destroyCookie(null, "pedw_locale"),
destroyCookie(null, "pinsUser"),
signOut({
callbackUrl:
locale == "cy"
? "/allgofnodi"
: "/logout",
});
}}
className="govuk-header__link govuk-!-margin-right-3"
>
@@ -272,6 +286,16 @@ const Header = (props) => {
? "Dewiswch Cymraeg"
: "Select English"
}
onClick={() => {
setCookie(
null,
"pedw_locale",
locale == "en" ? "cy" : "en",
{
path: "/",
}
);
}}
>
{" "}
{t("common:available-in")}
+19 -4
View File
@@ -184,6 +184,16 @@ let Login = (props) => {
</button>
</>;
}
const signInButton = () => {
router.push(
`${
router.locale == "cy" ? "/awd/mewngofnodi" : "/auth/signin"
}?callbackUrl=${encodeURIComponent(
window.location.href
)}&error=EmailSignin`
);
};
return (
<>
<div className="card" id="login-card">
@@ -197,14 +207,19 @@ let Login = (props) => {
{session && "Signed in as " + session.user?.email}
</div>
<br />
{!session && (
<button
className="govuk-button withChevron govuk-button-cta"
type="button"
onClick={() =>
signIn("email", {
callbackUrl: "/",
})
onClick={
() => signInButton()
// signIn("email", {
// callbackUrl:
// (router.locale != "en"
// ? "/cy"
// : "") + "/",
// })
}
>
{t("home:login-via-nextuth-label")}
+2 -2
View File
@@ -12,7 +12,7 @@ import Dns from "./homepage/dns";
const MainHome = (props) => {
let { t } = useTranslation();
const { showLogin, session } = props;
const { showLogin, session, siteurl } = props;
const router = useRouter();
const { locale } = router;
@@ -34,7 +34,7 @@ const MainHome = (props) => {
{showLogin == "true" && (
<>
<CaseSearch />
<Login session={session} />
<Login session={session} siteurl={siteurl} />
</>
)}{" "}
<CaseComment />
+4 -1
View File
@@ -25,7 +25,10 @@ const MyPortal = (props) => {
const handleLogout = () => {
console.info("////////////\n" + "logout" + "\n////////////");
window.localStorage.clear(),
destroyCookie({}, "pinsUser"),
destroyCookie(null, "next-auth.csrf-token"),
destroyCookie(null, "next-auth.callback-url"),
destroyCookie(null, "pedw_locale"),
destroyCookie(null, "pinsUser"),
signOut({ callbackUrl: "/logout" });
};
+9 -1
View File
@@ -32,7 +32,15 @@ const AwaitingSubmission = (props) => {
{props.awaitingSubmission.awaitingSubmission["@odata.count"] >
3 && (
<div className="cardVieAll">
<Link href="/myportal/viewall">
<Link
href={
router.locale != "en"
? "/" +
router.locale +
"/fymhorth/gweldpopeth"
: "/myportal/viewall"
}
>
<a
className="govuk-link--no-underline"
onClick={() => {
@@ -60,22 +60,21 @@ const AwaitingSubmissionFromBlob = (props) => {
<Link
href={
router.locale == "cy"
? "/fymhorth/parhauigyflwyno"
: "/myportal" +
"/" +
urlname +
"?lpa=" +
showTopThreeArr[key][
"_pinswg_associatedlpa_value"
] +
"&apt=" +
showTopThreeArr[key]
.pinswg_appealcasetype +
"&casereference=" +
showTopThreeArr[key].pinswg_name +
"&inid=" +
showTopThreeArr[key].incidentid
(router.locale == "cy"
? "/fymhorth"
: "/myportal") +
"/" +
urlname +
"?lpa=" +
showTopThreeArr[key][
"_pinswg_associatedlpa_value"
] +
"&apt=" +
showTopThreeArr[key].pinswg_appealcasetype +
"&casereference=" +
showTopThreeArr[key].pinswg_name +
"&inid=" +
showTopThreeArr[key].incidentid
}
>
<a
@@ -215,7 +214,15 @@ const AwaitingSubmissionFromBlob = (props) => {
</div>
{props.awaitingSubmissionFromBlob["@odata.count"] > 3 && (
<div className="cardVieAll">
<Link href="/myportal/viewall">
<Link
href={
router.locale != "en"
? "/" +
router.locale +
"/fymhorth/gweldpopeth"
: "/myportal/viewall"
}
>
<a
className="govuk-link--no-underline"
onClick={() => {
+9 -1
View File
@@ -26,7 +26,15 @@ const MyCases = (props) => {
</div>
{props.myCases.myCases["@odata.count"] > 3 && (
<div className="cardVieAll">
<Link href="/myportal/viewall">
<Link
href={
router.locale != "en"
? "/" +
router.locale +
"/fymhorth/gweldpopeth"
: "/myportal/viewall"
}
>
<a
className="govuk-link--no-underline"
onClick={() => {
+10 -1
View File
@@ -31,7 +31,16 @@ const MyRepresentations = (props) => {
{props.myRepresentations.myRepresentations["@odata.count"] >
3 && (
<div className="cardVieAll">
<Link href="/myportal/viewall" shallow>
<Link
href={
router.locale != "en"
? "/" +
router.locale +
"/fymhorth/gweldpopeth"
: "/myportal/viewall"
}
shallow
>
<a
className="govuk-link--no-underline"
onClick={() => {
@@ -31,7 +31,16 @@ const MyRepresentations = (props) => {
{props.myRepresentations.myRepresentations["@odata.count"] >
3 && (
<div className="cardVieAll">
<Link href="/myportal/viewall" shallow>
<Link
href={
router.locale != "en"
? "/" +
router.locale +
"/fymhorth/gweldpopeth"
: "/myportal/viewall"
}
shallow
>
<a
className="govuk-link--no-underline"
onClick={() => {
+10 -1
View File
@@ -28,7 +28,16 @@ const WatchedCases = (props) => {
{props.watchedCases.watchedCases["@odata.count"] > 3 && (
<div className="cardVieAll">
<Link href="/myportal/viewall" shallow>
<Link
href={
router.locale != "en"
? "/" +
router.locale +
"/fymhorth/gweldpopeth"
: "/myportal/viewall"
}
shallow
>
<a
className="govuk-link--no-underline"
onClick={() => {
+9 -3
View File
@@ -175,13 +175,14 @@ let BuildSection = (props) => {
const reference = "PEDW-PARTIAL";
const templateId = "021b0a7b-df00-41f1-b94e-c269bee98c75";
const templateIdCY = "f3c4a56b-bfb8-4d39-97dd-888df3062b0a";
const emailAddress = props.props.accountDetails.loggedinUserEmail;
const personalisation = {
"caseReference": props.appealType.caseReference.ticketnumber,
"emailAddress": props.props.accountDetails.loggedinUserEmail,
"returnLink":
props.props.url +
"/myportal/" +
(router.locale != "en" ? "/cy/fymhorth/" : "/myportal/") +
appTypeCollection.UrlName +
"?lpa=" +
props.appealType.appealLPA +
@@ -195,12 +196,17 @@ let BuildSection = (props) => {
};
sendSavedEmail == true &&
sendEmail(templateId, emailAddress, personalisation, reference);
sendEmail(
router.locale != "en" ? templateIdCY : templateId,
emailAddress,
personalisation,
reference
);
useSaveStatus &&
router.replace(
router.locale != "en"
? router.locale + "/myportal"
? "/" + router.locale + "/myportal"
: "/myportal"
);
};
+12 -6
View File
@@ -542,11 +542,14 @@ const DNSSearchResults = (props) => {
"watchedCases"
);
alert(
"You have stopped watching case " +
item.title
t(
"case:you-have-stopped-watching-label"
) + item.title
);
}}
title="Stop watching this case"
title={t(
"case:stop-watching-case-link"
)}
>
<span className="eye"></span>
</span>
@@ -560,11 +563,14 @@ const DNSSearchResults = (props) => {
item.pinswg_appealcasetype
);
alert(
"You are watching case " +
item.title
t(
"case:you-are-watching-label"
) + item.title
);
}}
title="Watch this case"
title={t(
"case:watch-this-case-link"
)}
>
<span className="eye"></span>
</span>
+15 -7
View File
@@ -504,11 +504,14 @@ const SearchResults = (props) => {
"watchedCases"
);
alert(
"You have stopped watching case " +
item.title
t(
"case:you-have-stopped-watching-label"
) + item.title
);
}}
title="Stop watching this case"
title={t(
"case:stop-watching-case-link"
)}
>
<span className="eye"></span>
</span>
@@ -522,11 +525,14 @@ const SearchResults = (props) => {
item.pinswg_appealcasetype
);
alert(
"You are watching case " +
item.title
t(
"case:you-are-watching-label"
) + item.title
);
}}
title="Watch this case"
title={t(
"case:watch-this-case-link"
)}
>
<span className="eye"></span>
</span>
@@ -554,7 +560,9 @@ const SearchResults = (props) => {
item.title
);
}}
title="Watch this case"
title={t(
"case:watch-this-case-link"
)}
>
<span className="eye"></span>
</span>
+4 -1
View File
@@ -41,7 +41,10 @@ const TimeOut = (props) => {
const handleLogout = () => {
console.info("////////////\n" + "logout" + "\n////////////");
window.localStorage.clear(),
destroyCookie({}, "pinsUser"),
destroyCookie(null, "next-auth.csrf-token"),
destroyCookie(null, "next-auth.callback-url"),
destroyCookie(null, "pedw_locale"),
destroyCookie(null, "pinsUser"),
signOut({ callbackUrl: "/logout" });
};