Merged PR 1643: right click and language pref bugs

Related work items: #16185, #16478, #16630
This commit is contained in:
Robert Bond
2025-05-26 06:08:54 +00:00
6 changed files with 13 additions and 7 deletions
+2
View File
@@ -59,6 +59,7 @@ const Header = (props) => {
"/register",
"/myportal/searchresults",
"/myportal/representation",
"/myportal/viewall",
];
const hasContactLink = [
@@ -279,6 +280,7 @@ const Header = (props) => {
}}
>
{" "}
wwww
{t("common:available-in")}
</Link>
</div>
@@ -356,7 +356,7 @@ const AwaitingSubmissionFromBlob = (props) => {
router.locale +
"/fymhorth/gweldpopeth"
: "/myportal/viewall") +
"?viewKey=awaitingSubmission"
"?viewKey=awaitingSubmissionDetails"
}
className="govuk-link--no-underline"
onClick={() => {
+1 -1
View File
@@ -43,7 +43,7 @@
"account-title": "Your account",
"account-about-you-label": "About you",
"account-role-label": "Role",
"account-preferred-language-label": "Prefered language",
"account-preferred-language-label": "Preferred language",
"account-preferred-language-english": "English",
"account-preferred-language-welsh": "Welsh",
"account-first-name-label": "First name",
+3 -3
View File
@@ -24,9 +24,9 @@ class MyDocument extends Document {
const cookieObj = ctx.req.cookies.CookiePolicy || {};
console.log("useGATracking: ", useGATracking);
setCookie(ctx, "pedw_locale", ctx.locale, {
path: "/",
});
// setCookie(ctx, "pedw_locale", ctx.locale, {
// path: "/",
// });
const headers = ctx.req?.headers;
const generatedNonce = headers?.["x-nonce"];
+1 -1
View File
@@ -54,7 +54,7 @@ const Home = (props) => {
<div>
<Head>
<title>
{t("search:page-title")} - {t("common:service-name")}
{t("account:account-title")} - {t("common:service-name")}
</title>
</Head>
<div id="page_wrapper">
+5 -1
View File
@@ -264,15 +264,19 @@ export const getServerSideProps = wrapper.getServerSideProps(
);
console.log("req locale :", ctx.locale);
console.log("cookie locale :", cookies.pedw_locale);
store.dispatch(setLocale(ctx.locale));
const preferredLocale =
let preferredLocale =
accountDetails.pinswg_preferredlanguage == "846040000"
? "cy"
: "en";
// added to redirect if not the users preferred language
cookies.hasOwnProperty("pedw_locale") &&
(preferredLocale = cookies.pedw_locale);
if (preferredLocale != ctx.locale) {
return {
redirect: {