updated translations for lpas

This commit is contained in:
2021-10-01 11:08:24 +01:00
parent bea8579ef6
commit c061650fe4
7 changed files with 74 additions and 29 deletions
+25 -8
View File
@@ -7,6 +7,7 @@ import BuildRow from "./buildrow";
import { reduxForm, formValueSelector, Field } from "redux-form";
import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
import jsonpath from "jsonpath";
import transLookup from "../../data/lookuptranslations.json";
import data from "../../data/collections.json";
import {
@@ -90,7 +91,7 @@ let CreateCase = (props) => {
//onChange={(e) => props.onChangeSelectLPA(e)}
>
<option value="" disabled defaultValue>
Select...
{t("common:drop-down-select")}
</option>
{_.isEmpty(optionsObj)
? ""
@@ -100,7 +101,15 @@ let CreateCase = (props) => {
key={key}
value={optionsObj[key].accountid}
>
{optionsObj[key].name}
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
optionsObj[key]
.name +
'")].value_cy'
)
: optionsObj[key].name}
</option>
);
})}
@@ -151,7 +160,7 @@ let CreateCase = (props) => {
//onChange={(e) => props.onChangeSelectAppealType(e)}
>
<option value="" disabled defaultValue>
Select...
{t("common:drop-down-select")}
</option>
{_.isEmpty(optionsObj)
? ""
@@ -190,6 +199,14 @@ let CreateCase = (props) => {
optionsObj[key].value
)
? ""
: router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
optionsObj[key]
.value +
'")].value_cy'
)
: optionsObj[key].value}
</option>
);
@@ -248,8 +265,8 @@ let CreateCase = (props) => {
component={RenderLPAList}
optionsObj={lpaOptionsObj}
validate={[required]}
label="Select your local planning authority"
errorMsg="Local authority is required"
label={t("newappeal:select-lpa-label")}
errorMsg={t("newappeal:select-lpa-label-error-msg")}
/>
<Field
@@ -257,8 +274,8 @@ let CreateCase = (props) => {
component={RenderAppealTypeList}
optionsObj={appealOptionsObj}
validate={[required]}
label="Select an appeal type"
errorMsg="Appeal type is required"
label={t("newappeal:select-appeal-type-label")}
errorMsg={t("newappeal:select-appeal-type-label-error-msg")}
/>
<button
@@ -266,7 +283,7 @@ let CreateCase = (props) => {
className="govuk-button"
data-module="govuk-button"
>
Continue
{t("common:continue-button")}
</button>
</form>
);