diff --git a/components/newappeal/buildsection.js b/components/newappeal/buildsection.js
index 57da936f..31fd9f3d 100644
--- a/components/newappeal/buildsection.js
+++ b/components/newappeal/buildsection.js
@@ -626,12 +626,14 @@ const mapStateToProps = (state, ownProps) => {
formData: state.formData,
appealType: state.appealType,
initialValues: state.appealType.caseReference.caseDetails,
+ currentView: state.currentView,
}
: {
search: state.search,
searchResultsObj: state.searchResultsObj,
formData: state.formData,
appealType: state.appealType,
+ currentView: state.currentView,
//form: state.form,
};
};
@@ -658,22 +660,28 @@ const mapDispatchToProps = (dispatch) => {
const selector = formValueSelector("appealForm"); // <-- same as form name
-const validate = (values) => {
+const validate = (values, props) => {
const errors = {};
const strippedHtml = (htmlStr) => {
return htmlStr.replace(/(<([^>]+)>)/gi, "").trim();
};
+ const locale = props.currentView.locale;
+
if (values.hasOwnProperty("pinswg_attachsoc")) {
if (values.pinswg_attachsoc == "false") {
if (values.hasOwnProperty("pinswg_statementofcase")) {
if (strippedHtml(values.pinswg_statementofcase).length == 0)
errors.pinswg_statementofcase =
- "Submit your Statement of Case or select Yes to attach a separate Statement of Case Document";
+ locale != "cy"
+ ? "Submit your Statement of Case or select Yes to attach a separate Statement of Case Document"
+ : "Cyflwynwch eich Datganiad Achos neu dewiswch Ie i atodi Dogfen Datganiad Achos ar wahân";
} else {
errors.pinswg_statementofcase =
- "Submit your Statement of Case or select Yes to attach a separate Statement of Case Document";
+ locale != "cy"
+ ? "Submit your Statement of Case or select Yes to attach a separate Statement of Case Document"
+ : "Cyflwynwch eich Datganiad Achos neu dewiswch Ie i atodi Dogfen Datganiad Achos ar wahân";
}
}
}
@@ -684,10 +692,14 @@ const validate = (values) => {
if (values.hasOwnProperty("pinswg_costapplication")) {
if (strippedHtml(values.pinswg_costapplication).length == 0)
errors.pinswg_costapplication =
- "Submit a Costs application or select Yes to attach a separate Costs application";
+ locale != "cy"
+ ? "Submit a Costs application or select Yes to attach a separate Costs application"
+ : "Cyflwyno cais Costau neu ddewis Ie i atodi cais Costau ar wahân";
} else {
errors.pinswg_costapplication =
- "Submit a Costs application or select Yes to attach a separate Costs application";
+ locale != "cy"
+ ? "Submit a Costs application or select Yes to attach a separate Costs application"
+ : "Cyflwyno cais Costau neu ddewis Ie i atodi cais Costau ar wahân";
}
}
}
diff --git a/data/crmfieldlookuptranslations.json b/data/crmfieldlookuptranslations.json
index cf426221..e3e74e4c 100644
--- a/data/crmfieldlookuptranslations.json
+++ b/data/crmfieldlookuptranslations.json
@@ -172,8 +172,8 @@
"value_cy": "Datblygiad sy'n effeithio ar leoliad adeilad rhestredig"
},
{
- "value": "Floor space in square meters",
- "value_cy": "Arwynebedd llawr mewn metrau sgwâr"
+ "value": "Floor space in square meters (to nearest whole number)",
+ "value_cy": "Arwynebedd llawr mewn metrau sgwâr (i’r rhif cyfan agosaf)"
},
{
"value": "In CA/relates to CA",
@@ -287,8 +287,8 @@
"value_cy": "Datblygiad sy'n effeithio ar leoliad adeilad rhestredig"
},
{
- "value": "Floor space in square meters",
- "value_cy": "Arwynebedd llawr mewn metrau sgwâr"
+ "value": "Floor space in square meters (to nearest whole number)",
+ "value_cy": "Arwynebedd llawr mewn metrau sgwâr (i’r rhif cyfan agosaf)"
},
{
"value": "In CA/relates to CA",
@@ -402,8 +402,8 @@
"value_cy": "Datblygiad sy'n effeithio ar leoliad adeilad rhestredig"
},
{
- "value": "Floor space in square meters",
- "value_cy": "Arwynebedd llawr mewn metrau sgwâr"
+ "value": "Floor space in square meters (to nearest whole number)",
+ "value_cy": "Arwynebedd llawr mewn metrau sgwâr (i’r rhif cyfan agosaf)"
},
{
"value": "In CA/relates to CA",
@@ -501,8 +501,8 @@
"value_cy": "Datblygiad sy'n effeithio ar leoliad adeilad rhestredig"
},
{
- "value": "Floor space in square meters",
- "value_cy": "Arwynebedd llawr mewn metrau sgwâr"
+ "value": "Floor space in square meters (to nearest whole number)",
+ "value_cy": "Arwynebedd llawr mewn metrau sgwâr (i’r rhif cyfan agosaf)"
},
{
"value": "In CA/relates to CA",
@@ -616,8 +616,8 @@
"value_cy": "Datblygiad sy'n effeithio ar leoliad adeilad rhestredig"
},
{
- "value": "Floor space in square meters",
- "value_cy": "Arwynebedd llawr mewn metrau sgwâr"
+ "value": "Floor space in square meters (to nearest whole number)",
+ "value_cy": "Arwynebedd llawr mewn metrau sgwâr (i’r rhif cyfan agosaf)"
},
{
"value": "In CA/relates to CA",
@@ -924,8 +924,8 @@
"value_cy": "Datblygiad sy'n effeithio ar leoliad adeilad rhestredig"
},
{
- "value": "Floor space in square meters",
- "value_cy": "Arwynebedd llawr mewn metrau sgwâr"
+ "value": "Floor space in square meters (to nearest whole number)",
+ "value_cy": "Arwynebedd llawr mewn metrau sgwâr (i’r rhif cyfan agosaf)"
},
{
"value": "Is Flooding an issue",
@@ -1039,8 +1039,8 @@
"value_cy": "Datblygiad sy'n effeithio ar leoliad adeilad rhestredig"
},
{
- "value": "Floor space in square meters",
- "value_cy": "Arwynebedd llawr mewn metrau sgwâr"
+ "value": "Floor space in square meters (to nearest whole number)",
+ "value_cy": "Arwynebedd llawr mewn metrau sgwâr (i’r rhif cyfan agosaf)"
},
{
"value": "In CA/related to CA",
@@ -1229,8 +1229,8 @@
"value_cy": "Datblygiad sy'n effeithio ar leoliad adeilad rhestredig"
},
{
- "value": "Floor space in square meters",
- "value_cy": "Arwynebedd llawr mewn metrau sgwâr"
+ "value": "Floor space in square meters (to nearest whole number)",
+ "value_cy": "Arwynebedd llawr mewn metrau sgwâr (i’r rhif cyfan agosaf)"
},
{
"value": "In CA/relates to CA",
@@ -1328,8 +1328,8 @@
"value_cy": "Datblygiad sy'n effeithio ar leoliad adeilad rhestredig"
},
{
- "value": "Floor space in square meters",
- "value_cy": "Arwynebedd llawr mewn metrau sgwâr"
+ "value": "Floor space in square meters (to nearest whole number)",
+ "value_cy": "Arwynebedd llawr mewn metrau sgwâr (i’r rhif cyfan agosaf)"
},
{
"value": "In CA/Relates to CA",
@@ -1456,7 +1456,7 @@
},
{
"value": "Floor in Square Meters",
- "value_cy": "Arwynebedd llawr mewn metrau sgwâr"
+ "value_cy": "Arwynebedd llawr mewn metrau sgwâr (i’r rhif cyfan agosaf)"
},
{
"value": "In CA/relates to CA",
@@ -1585,8 +1585,8 @@
"value_cy": "Datblygiad sy'n effeithio ar leoliad adeilad rhestredig"
},
{
- "value": "Floor space in square meters",
- "value_cy": "Arwynebedd llawr mewn metrau sgwâr"
+ "value": "Floor space in square meters (to nearest whole number)",
+ "value_cy": "Arwynebedd llawr mewn metrau sgwâr (i’r rhif cyfan agosaf)"
},
{
"value": "In CA/relates to CA",
@@ -1700,8 +1700,8 @@
"value_cy": "Datblygiad sy'n effeithio ar leoliad adeilad rhestredig"
},
{
- "value": "Floor space in square meters",
- "value_cy": "Arwynebedd llawr mewn metrau sgwâr"
+ "value": "Floor space in square meters (to nearest whole number)",
+ "value_cy": "Arwynebedd llawr mewn metrau sgwâr (i’r rhif cyfan agosaf)"
},
{
"value": "In CA/relates to CA",
@@ -1799,8 +1799,8 @@
"value_cy": "Datblygiad sy'n effeithio ar leoliad adeilad rhestredig"
},
{
- "value": "Floor space in square meters",
- "value_cy": "Arwynebedd llawr mewn metrau sgwâr"
+ "value": "Floor space in square meters (to nearest whole number)",
+ "value_cy": "Arwynebedd llawr mewn metrau sgwâr (i’r rhif cyfan agosaf)"
},
{
"value": "In CA/related to CA",
@@ -1898,8 +1898,8 @@
"value_cy": "Datblygiad sy'n effeithio ar leoliad adeilad rhestredig"
},
{
- "value": "Floor space in square meters",
- "value_cy": "Arwynebedd llawr mewn metrau sgwâr"
+ "value": "Floor space in square meters (to nearest whole number)",
+ "value_cy": "Arwynebedd llawr mewn metrau sgwâr (i’r rhif cyfan agosaf)"
},
{
"value": "In CA/relates to CA",
@@ -2025,8 +2025,8 @@
"value_cy": "Datblygiad sy'n effeithio ar leoliad adeilad rhestredig"
},
{
- "value": "Floor space in square meters",
- "value_cy": "Arwynebedd llawr mewn metrau sgwâr"
+ "value": "Floor space in square meters (to nearest whole number)",
+ "value_cy": "Arwynebedd llawr mewn metrau sgwâr (i’r rhif cyfan agosaf)"
},
{
"value": "In CA/relates to CA",
@@ -2453,7 +2453,7 @@
},
{
"value": "Floor Space in Square Meaters",
- "value_cy": "Arwynebedd llawr mewn metrau sgwâr"
+ "value_cy": "Arwynebedd llawr mewn metrau sgwâr (i’r rhif cyfan agosaf)"
},
{
"value": "In CA/relates to CA",
@@ -2567,8 +2567,8 @@
"value_cy": "Datblygiad sy'n effeithio ar leoliad adeilad rhestredig"
},
{
- "value": "Floor space in square meters",
- "value_cy": "Arwynebedd llawr mewn metrau sgwâr"
+ "value": "Floor space in square meters (to nearest whole number)",
+ "value_cy": "Arwynebedd llawr mewn metrau sgwâr (i’r rhif cyfan agosaf)"
},
{
"value": "In CA/relates to CA",
@@ -2678,8 +2678,8 @@
"value_cy": "Datblygiad sy'n effeithio ar leoliad adeilad rhestredig"
},
{
- "value": "Floor space in square meters",
- "value_cy": "Arwynebedd llawr mewn metrau sgwâr"
+ "value": "Floor space in square meters (to nearest whole number)",
+ "value_cy": "Arwynebedd llawr mewn metrau sgwâr (i’r rhif cyfan agosaf)"
},
{
"value": "In CA/relates to CA",
@@ -2868,8 +2868,8 @@
"value_cy": "Datblygiad sy'n effeithio ar osodiad adeilad rhestredig"
},
{
- "value": "Floor space in square meters",
- "value_cy": "Arwynebedd llawr mewn metrau sgwâr"
+ "value": "Floor space in square meters (to nearest whole number)",
+ "value_cy": "Arwynebedd llawr mewn metrau sgwâr (i’r rhif cyfan agosaf)"
},
{
"value": "In CA/related to CA",
diff --git a/data/forms/callinss77.js b/data/forms/callinss77.js
index f9e1f934..404ed85e 100644
--- a/data/forms/callinss77.js
+++ b/data/forms/callinss77.js
@@ -126,7 +126,8 @@ const Callinss77Form = (props) => {
class="govuk-label"
for="pinswg_floorspaceinsquaremeters"
>
- Floor space in square meters
+ Floor space in square meters (to nearest
+ whole number)
{
class="govuk-label"
for="pinswg_floorspaceinsquaremeters"
>
- Floor space in square meters
+ Floor space in square meters (to nearest
+ whole number)
{
class="govuk-label"
for="pinswg_floorspaceinsquaremeters"
>
- Floor space in square meters
+ Floor space in square meters (to nearest
+ whole number)
{
class="govuk-label"
for="pinswg_floorspaceinsquaremeters"
>
- Floor space in square meters
+ Floor space in square meters (to nearest
+ whole number)
{
class="govuk-label"
for="pinswg_floorspaceinsquaremeters"
>
- Floor space in square meters
+ Floor space in square meters (to nearest
+ whole number)
{
class="govuk-label"
for="pinswg_floorspaceinsquaremeters"
>
- Floor space in square meters
+ Floor space in square meters (to nearest
+ whole number)
{
class="govuk-label"
for="pinswg_floorspaceinsquaremeters"
>
- Floor space in square meters
+ Floor space in square meters (to nearest
+ whole number)
{
class="govuk-label"
for="pinswg_floorspaceinsquaremeters"
>
- Floor space in square meters
+ Floor space in square meters (to nearest
+ whole number)
{
class="govuk-label"
for="pinswg_floorspaceinsquaremeters"
>
- Floor space in square meters
+ Floor space in square meters (to nearest
+ whole number)
{
class="govuk-label"
for="pinswg_floorspaceinsquaremeters"
>
- Floor space in square meters
+ Floor space in square meters (to nearest
+ whole number)
-
+
diff --git a/data/formsxml/commonland.xml b/data/formsxml/commonland.xml
index 7f6dfe6d..305e589b 100644
--- a/data/formsxml/commonland.xml
+++ b/data/formsxml/commonland.xml
@@ -370,7 +370,7 @@
-
+
diff --git a/data/formsxml/compulsorypurchaseorders.xml b/data/formsxml/compulsorypurchaseorders.xml
index 3976bab3..83595906 100644
--- a/data/formsxml/compulsorypurchaseorders.xml
+++ b/data/formsxml/compulsorypurchaseorders.xml
@@ -370,7 +370,7 @@
-
+
diff --git a/data/formsxml/environmentalpermitting.xml b/data/formsxml/environmentalpermitting.xml
index f25e273b..00a5425d 100644
--- a/data/formsxml/environmentalpermitting.xml
+++ b/data/formsxml/environmentalpermitting.xml
@@ -370,7 +370,7 @@
-
+
diff --git a/data/formsxml/hedgeshedgerowstreepreservationreplacem.xml b/data/formsxml/hedgeshedgerowstreepreservationreplacem.xml
index 6225eda8..51f37263 100644
--- a/data/formsxml/hedgeshedgerowstreepreservationreplacem.xml
+++ b/data/formsxml/hedgeshedgerowstreepreservationreplacem.xml
@@ -370,7 +370,7 @@
-
+
diff --git a/data/formsxml/maintenanceoflands217.xml b/data/formsxml/maintenanceoflands217.xml
index 941b6390..1e425d81 100644
--- a/data/formsxml/maintenanceoflands217.xml
+++ b/data/formsxml/maintenanceoflands217.xml
@@ -370,7 +370,7 @@
-
+
diff --git a/data/formsxml/planningappeals78.xml b/data/formsxml/planningappeals78.xml
index bbc92d95..152b63bf 100644
--- a/data/formsxml/planningappeals78.xml
+++ b/data/formsxml/planningappeals78.xml
@@ -46,7 +46,7 @@
-
+
@@ -142,7 +142,7 @@
-
+
@@ -286,7 +286,7 @@
-
+
@@ -316,13 +316,13 @@
-
+
-
+
diff --git a/data/formsxml/planningconditionss73s79.xml b/data/formsxml/planningconditionss73s79.xml
index 3a96d003..c8e2eff7 100644
--- a/data/formsxml/planningconditionss73s79.xml
+++ b/data/formsxml/planningconditionss73s79.xml
@@ -601,7 +601,7 @@
-
+
diff --git a/locales/cy/newappeal.json b/locales/cy/newappeal.json
index dd99e3ac..dee9e91f 100644
--- a/locales/cy/newappeal.json
+++ b/locales/cy/newappeal.json
@@ -16,6 +16,9 @@
"appeal-confirmation-label": "Cadarnhaf fy mod yn gwneud apêl yn erbyn penderfyniad i wrthod caniatâd cynllunio neu fethiant i benderfynu ar gais cynllunio o fewn 8 wythnos.",
"select-to-confirm-label": "Cadarnhewch i barhau",
"is-required-label": "Yn ofynnol",
+ "select-a-date-label": "Dewiswch ddyddiad",
+ "invalid-decimal-label": "Rhif annilys (uchafswm o 7 nod, 2 le degol)",
+ "invalid-number-label": "Dylai fod yn rhif",
"emojis-not-allowed-label": "Ni chaniateir emojis",
"invalid-postcode-label": "Cod post annilys",
"hascas-confirmation-label": "Cadarnhewch fod angen apêl HAS/CAS",
@@ -99,5 +102,14 @@
"new-appeal-complete-back-link": "Yn ôl i Fy Mhorth",
"new-appeal-multiline-pid": "Peidiwch â chynnwys gwybodaeth bersonol nac ariannol",
"new-appeal-statement-case-error": "Cyflwynwch eich Datganiad Achos neu dewiswch Ie i atodi Dogfen Datganiad Achos ar wahân",
- "new-appeal-costs-application-error": "Cyflwyno cais Costau neu ddewis Ie i atodi cais Costau ar wahân"
+ "new-appeal-costs-application-error": "Cyflwyno cais Costau neu ddewis Ie i atodi cais Costau ar wahân",
+ "application-form": "Ffurflen gais",
+ "description-of-development-change-confirmation": "Disgrifiad o gadarnhad newid datblygiad",
+ "relevant-ownership-certificate": "Tystysgrif Perchnogaeth Berthnasol",
+ "statement-of-case": "Datganiad Achos",
+ "cost-application": "Cais Cost",
+ "planning-obligation-(s106/unilateral)": "Rhwymedigaeth gynllunio (S106/Unochrog)",
+ "site-location-plan": "Cynllun Lleoliad Safle",
+ "registration-of-application-letter": "Llythyr Cofrestru Cais",
+ "previously-added-files": "Ffeiliau a ychwanegwyd yn flaenorol"
}
\ No newline at end of file
diff --git a/locales/en/newappeal.json b/locales/en/newappeal.json
index 3283c465..1c6b73ce 100644
--- a/locales/en/newappeal.json
+++ b/locales/en/newappeal.json
@@ -1,5 +1,6 @@
{
"viewall-link": "View all",
+ "viewall-link-count": "View all {{count}} cases",
"parent-page-title": "My portal",
"page-title": "New appeal",
"select-lpa-label": "Select your Local Planning Authority (LPA)",
@@ -15,6 +16,9 @@
"appeal-confirmation-label": "I confirm that I am making an appeal against a refusal of planning permission or failure to determine a planning application within 8 weeks.",
"select-to-confirm-label": "Confirm to continue",
"is-required-label": "Is required",
+ "select-a-date-label": "Select a date",
+ "invalid-decimal-label": "Invalid number (max 7 characters, 2 decimal places)",
+ "invalid-number-label": "Should be a number",
"emojis-not-allowed-label": "Emojis are not allowed",
"invalid-postcode-label": "Invalid postcode",
"hascas-confirmation-label": "Confirm HAS/CAS appeal is required",
@@ -81,7 +85,7 @@
"s78-appeals-only-bullet-one": "a refusal of planning permission",
"s78-appeals-only-bullet-two": "failure to determine a planning application within 8 weeks",
"s78-appeals-only-label-a": "All other appeals must be submitted by email or post.",
- "new-appeal-inspector-onsite-paragraph": "NOTE: The inspector will visit the site unaccompanied by either party unless the relevant part of the site cannot be seen from a road or other public land, or it is essential for the Inspector to enter the site to check measurements or relevant facts.",
+ "new-appeal-inspector-onsite-paragraph": "NOTE: The Inspector will visit the site unaccompanied by either party unless the relevant part of the site cannot be seen from a road or other public land, or it is essential for the Inspector to enter the site to check measurements or relevant facts.",
"new-appeal-submission-of-case-hint": "This is your only opportunity to make your case in connection with the reason for the appeal. Therefore please provide your FULL statement of case. To do this, you need to go through the reasons for the decision (if provided), and explain why you disagree. Only the reasons within the LPA's decision and the reasons put forward by you at application stage should be included in your Statement of Case. You should not introduce any new reasons for the appeal. Please refer to our Procedural Guide for further information.",
"new-appeal-what-procedure-hint": "Appeals dealt with under Part 4 of The Town and Country Planning (Referred Applications and Appeals Procedure) (Wales) Regulations 2017 can be considered on the basis of written representation, a hearing, an inquiry or combined proceedings. In accordance with the Town and Country Planning (Determination of Procedure) (Wales) Order 2017, the Planning and Environment Decisions Wales will make a determination as to the most appropriate procedure and will review it throughout the process.",
"new-appeal-cost-application-hint": "You must submit a statement below that clearly explains why you think unreasonable behaviour has occurred and how this has caused unnecessary or wasted expense.",
@@ -98,5 +102,14 @@
"new-appeal-complete-back-link": "Back to My Portal",
"new-appeal-multiline-pid": "Do not include personal or financial information.",
"new-appeal-statement-case-error": "Submit your Statement of Case or select Yes to attach a separate Statement of Case Document",
- "new-appeal-costs-application-error": "Submit a Costs application or select Yes to attach a separate Costs application"
+ "new-appeal-costs-application-error": "Submit a Costs application or select Yes to attach a separate Costs application",
+ "application-form": "Application form",
+ "description-of-development-change-confirmation": "Description of development change confirmation",
+ "relevant-ownership-certificate": "Relevant Ownership certificate",
+ "statement-of-case": "Statement of Case",
+ "cost-application": "Cost Application",
+ "planning-obligation-(s106/unilateral)": "Planning obligation (S106/Unilateral)",
+ "site-location-plan": "Site Location Plan",
+ "registration-of-application-letter": "Registration of Application letter",
+ "previously-added-files": "Previously added files"
}
\ No newline at end of file
diff --git a/pages/api/auth/[...nextauth].js b/pages/api/auth/[...nextauth].js
index fdc2a342..6fdcd6ea 100644
--- a/pages/api/auth/[...nextauth].js
+++ b/pages/api/auth/[...nextauth].js
@@ -172,12 +172,12 @@ const authOptions = (locale, req, res) => {
const personalisation = {
"emailAddress": email,
- "signInLink":
- locale == "cy"
- ? url.split("&token")[0] +
- "/cy&token" +
- url.split("&token")[1]
- : url,
+ "signInLink": url,
+ // locale == "cy"
+ // ? url.split("&token")[0] +
+ // "/cy&token" +
+ // url.split("&token")[1]
+ // : url,
"linkExpiry": 2 * 60 * 60,
};
diff --git a/pages/myportal/[appealtypes].js b/pages/myportal/[appealtypes].js
index 432849b8..c4975bb5 100644
--- a/pages/myportal/[appealtypes].js
+++ b/pages/myportal/[appealtypes].js
@@ -44,7 +44,7 @@ import {
setAwaitingSubmissionDetails,
setAwaitingSubmissionFromBlob,
} from "../../store/awaitingSubmission/action";
-import { setCurrentView } from "../../store/currentView/action";
+import { setCurrentView, setLocale } from "../../store/currentView/action";
import { setForm } from "../../store/formData/action";
import { wrapper } from "../../store/store";
import ServiceBanner from "../../components/myportal/servicebanner";
@@ -238,6 +238,9 @@ export const getServerSideProps = wrapper.getServerSideProps(
};
}
+ console.log(ctx.locale);
+ store.dispatch(setLocale(ctx.locale));
+
let loggedInUserIdent = thisSession.user.id;
let loggedInUserEmail = thisSession.user.email;
diff --git a/pages/myportal/index.js b/pages/myportal/index.js
index b8eb5d63..03cd5f14 100644
--- a/pages/myportal/index.js
+++ b/pages/myportal/index.js
@@ -34,7 +34,7 @@ import {
setAwaitingSubmissionDetails,
setAwaitingSubmissionFromBlob,
} from "../../store/awaitingSubmission/action";
-import { setShowReps } from "../../store/currentView/action";
+import { setShowReps, setLocale } from "../../store/currentView/action";
import { setMyCases, setMyCasesDetails } from "../../store/myCases/action";
import {
setMyRepresentations,
@@ -260,6 +260,8 @@ export const getServerSideProps = wrapper.getServerSideProps(
console.log("req locale :", ctx.locale);
+ store.dispatch(setLocale(ctx.locale));
+
const preferredLocale =
accountDetails.pinswg_preferredlanguage == "846040000"
? "cy"
diff --git a/store/currentView/action.js b/store/currentView/action.js
index 95dadefb..4e263ffa 100644
--- a/store/currentView/action.js
+++ b/store/currentView/action.js
@@ -11,6 +11,7 @@ export const currentViewActionTypes = {
SETREPRESENTATIONMESSAGESENT: "SETREPRESENTATIONMESSAGESENT",
SETREPRESENTATIONRESET: "SETREPRESENTATIONRESET",
SETSHOWLOGIN: "SETSHOWLOGIN",
+ SETLOCALE: "SETLOCALE",
};
export const getCurrentViewObj = () => (dispatch) => {
@@ -102,3 +103,10 @@ export const setShowReps = (showReps, showLogin) => (dispatch) => {
showReps: showReps,
});
};
+
+export const setLocale = (locale) => (dispatch) => {
+ return dispatch({
+ type: currentViewActionTypes.SETLOCALE,
+ locale: locale,
+ });
+};
diff --git a/store/currentView/reducer.js b/store/currentView/reducer.js
index e2bff8ac..41f10da2 100644
--- a/store/currentView/reducer.js
+++ b/store/currentView/reducer.js
@@ -11,6 +11,7 @@ const currentViewInitialState = {
currentPage: 1,
showReps: false,
showLogin: false,
+ locale: "",
};
export default function reducer(state = currentViewInitialState, action) {
@@ -72,6 +73,11 @@ export default function reducer(state = currentViewInitialState, action) {
showReps: action.showReps,
showLogin: action.showLogin,
};
+ case currentViewActionTypes.SETLOCALE:
+ return {
+ ...state,
+ locale: action.locale,
+ };
default:
return state;
}