Skip to content

Commit

Permalink
CIV-16333 Welsh translation for response GA (#5336)
Browse files Browse the repository at this point in the history
* amend welsh

* amend welsh translation

* fix welsh translation

* fix welsh translation

* add welsh translation on response journey

* fix lint

* fix unit test

* add unit test

* add unit tests

* remove necessary test

* fix EN issue

* fix welsh translation

* fix welsh translation

---------

Co-authored-by: jors95-moj <[email protected]>
Co-authored-by: sankhajuria <[email protected]>
  • Loading branch information
3 people authored Jan 15, 2025
1 parent 3b089af commit abfe18f
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 20 deletions.
28 changes: 22 additions & 6 deletions src/main/modules/i18n/locales/cy.json
Original file line number Diff line number Diff line change
Expand Up @@ -2687,7 +2687,7 @@
"ADDITIONAL_DOCUMENTS": {
"ADDITIONAL_DOCUMENTS_CAPTION": "Uwchlwytho dogfennau ychwanegol",
"ADDITIONAL_DOCUMENTS_ROW1": "Dylech ond uwchlwytho dogfennau sy’n berthnasol i’ch cais, er enghraifft, os yw’r barnwr wedi gorchymyn gwrandawiad ac wedi'ch cyfarwyddo i ddarparu dogfennau cyn hyn.",
"ADDITIONAL_DOCUMENTS_ROW2": "Cyn i chi uwchlwytho’r ddogfen bydd angen i chi ddisgrifio’r math o ddogfen rydych chi’n ei huwchlwytho, er enghraifft, Bwndel, datgani ad tyst neu atodlen gostau.",
"ADDITIONAL_DOCUMENTS_ROW2": "Cyn i chi uwchlwytho’r ddogfen bydd angen i chi ddisgrifio’r math o ddogfen rydych chi’n ei huwchlwytho, er enghraifft, Bwndel, datganiad tyst neu atodlen gostau.",
"JUDGE_WILL_REVIEW": "Bydd barnwr yn adolygu’r dogfennau ychwanegol rydych wedi’u huwchlwytho. Byddwch yn cael diweddariad gyda’u penderfyniad neu’r camau nesaf.",
"TYPE_OF_DOCUMENT_HINT": "Er enghraifft, contract, derbynneb anfoneb, e-bost, neges testun, llun, neges ar y cyfryngau cymdeithasol",
"TYPE_OF_DOCUMENT": "Math o ddogfen",
Expand All @@ -2710,8 +2710,23 @@
"WITHOUT_NOTICE": "Cyflwynwyd eich cais heb roi rhybudd i’r partïon eraill."
},
"AGREE_TO_ORDER": {
"MADE_AWARE": "Os nad ydych wedi cael gwybod am y cais hwn gan y partïon eraill, dewiswch ‘Nac ydw’",
"RESPOND_TO": "Ymateb i gais i {{applicationType}}",
"MADE_AWARE": "Os nad ydych wedi cael gwybod am y cais hwn gan y partïon eraill, dewiswch ‘Nac ydy’",
"RESPOND_TO": {
"SET_ASIDE_JUDGEMENT": "Ymateb i gais i rhoi dyfarniad o’r naill du (ei ddileu)",
"AMEND_A_STMT_OF_CASE": "Ymateb i gais i gwneud newid i’ch hawliad neu’r amddiffyniad rydych wedi’i gyflwyno",
"ADJOURN_HEARING": "Ymateb i gais i newid dyddiad gwrandawiad",
"CONFIRM_CCJ_DEBT_PAID": "Ymateb i gais i cadarnhewch eich bod wedi talu dyled dyfarniad",
"UNLESS_ORDER": "Ymateb i gais i’r llys i orfodi sancsiwn ar y partïon eraill oni bai eu bod yn cyflawni gweithred benodol",
"EXTEND_TIME": "Ymateb i gais i mwy o amser i wneud yr hyn sy’n ofynnol dan orchymyn llys",
"OTHER": "Ymateb i gais i’r llys i wneud rhywbeth nad yw wedi’i nodi ar y rhestr hon",
"STAY_THE_CLAIM": "Ymateb i gais i’r llys i atal hawliad",
"VARY_ORDER": "Ymateb i gais i ailystyried gorchymyn",
"RELIEF_FROM_SANCTIONS": "Ymateb i gais i rhyddhad o gosb rydych wedi’i chael gan y llys",
"SETTLE_BY_CONSENT": "Ymateb i gais i’r llys i wneud gorchymyn i setlo'r hawliad drwy gydsyniad",
"STRIKE_OUT": "Ymateb i gais i’r llys i ddileu achos y partïon eraill yn gyfan gwbl, neu ddileu rhan ohono, heb gynnal treial",
"SUMMARY_JUDGEMENT": "Ymateb i gais i’r llys i wneud dyfarniad diannod mewn achos",
"VARY_PAYMENT_TERMS_OF_JUDGMENT": "Ymateb i gais i amrywio dyfarniad"
},
"RESPOND_TO_MULTIPLE": "Ymateb i gais",
"TITLE": "Mae’r partïon eraill wedi dweud eich bod wedi cytuno i’r gorchymyn maent wedi gwneud cais amdano. A yw hyn yn gywir?"
},
Expand Down Expand Up @@ -2903,7 +2918,7 @@
"IMPOSE_SANCTION": "Y llys i orfodi sancsiwn ar y partïon eraill oni bai eu bod yn cyflawni gweithred benodol",
"MORE_TIME": "Mwy o amser i wneud yr hyn sy’n ofynnol dan orchymyn llys",
"NOT_ON_LIST": "Y llys i wneud rhywbeth nad yw wedi’i nodi ar y rhestr hon",
"PAUSE": "Y llys i oedi hawliad",
"PAUSE": "Y llys i atal hawliad",
"RECONSIDER": "Ailystyried gorchymyn",
"RELIEF_PENALTY": "Rhyddhad o gosb rydych wedi’i chael gan y llys",
"SETTLING": "Llys i wneud gorchymyn i setlo'r hawliad drwy gydsyniad",
Expand Down Expand Up @@ -3220,6 +3235,7 @@
},
"UNAVAILABLE_HEARING_DATES": {
"ADD_ANOTHER_DATE": "Ychwanegu dyddiad neu ystod o ddyddiadau arall",
"GA_ADD_ANOTHER_DATE": "Ychwanegu dyddiad arall neu ystod o ddyddiadau eraill",
"FROM": "Oddi wrth",
"IMPORTANT_EVENTS": "Dylai’r rhain ond fod yn ddyddiadau digwyddiadau pwysig fel apwyntiadau meddygol, gwrandawiadau llys eraill neu wyliau rydych eisoes wedi trefnu.",
"LONGER_PERIOD": "Cyfnod hirach o amser",
Expand Down Expand Up @@ -3285,7 +3301,7 @@
"DOCUMENTS_FROM_COURT": "Dogfennau gan y llys",
"DOCUMENT_TYPES": {
"SUPPORTING_EVIDENCE": "Tystiolaeth ategol",
"RESPOND_EVIDENCE": "Tystiolaeth yr atebydd"
"RESPOND_EVIDENCE": "Tystiolaeth ymateb"
},
"EITHER_PARTIES": "Gall ceisiadau ac ymatebion gael eu gwneud gan y naill barti neu’r llall mewn achos",
"HEARING_NOTICE" : "Hysbysiad o Wrandawiad",
Expand Down Expand Up @@ -5300,7 +5316,7 @@
"ADDITIONAL_APPLICATION_ASK_SETTLING": "Ni allwch ddewis \"Gofyn i’r llys wneud gorchymyn i setlo’n hawliad drwy gydsyniad\" fel cais ychwanegol",
"ADDITIONAL_APPLICATION_ASK_VARY_JUDGMENT": "Ni allwch ddewis \"Gofyn i amrywio dyfarniad\" fel cais ychwanegol",
"ADDITIONAL_APPLICATION_CCJ_DEBT": "You cannot apply to confirm you've paid a county court (CCJ) debt as there is no active judgment",
"AGREE_TO_ORDER_NOT_SELECTED": "Mae arnoch angen dweud wrthym os ydych wedi cytuno i'r gorchymyn y gofynnwyd amdano. Dewiswch opsiwn: Ydw neu Nac ydw",
"AGREE_TO_ORDER_NOT_SELECTED": "Mae arnoch angen dweud wrthym os ydych wedi cytuno i'r gorchymyn y gofynnwyd amdano. Dewiswch opsiwn: Ydy neu Nac ydy",
"APPLICATION_FROM_OTHER_PARTY_EMPTY_OPTION": "Mae arnoch angen dweud wrthym os yw’r partïon eraill wedi cytuno i’r cais hwn. Dewiswch opsiwn: Do neu Naddo",
"APPLICATION_FROM_OTHER_PARTY_OPTION_NO_SELECTED": "Rhaid i’r atebydd gytuno ar setlo drwy gydsyniad cyn gwneud y cais.",
"APPLY_HELP_WITH_FEES": "Mae angen i chi ddweud wrthym os ydych am wneud cais am help i dalu ffioedd. Dewis opsiwn Ydw neu Nac ydw",
Expand Down
18 changes: 17 additions & 1 deletion src/main/modules/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2711,7 +2711,22 @@
},
"AGREE_TO_ORDER": {
"MADE_AWARE": "If you have not been made aware of this application by the other parties, select 'No'.",
"RESPOND_TO": "Respond to an application to {{applicationType}}",
"RESPOND_TO": {
"SET_ASIDE_JUDGEMENT": "Respond to an application to set aside (remove) a judgment",
"AMEND_A_STMT_OF_CASE": "Respond to an application to make a change to your claim or defence that you've submitted",
"ADJOURN_HEARING": "Respond to an application to change a hearing date",
"CONFIRM_CCJ_DEBT_PAID": "Respond to an application to Confirm you've paid a judgment debt",
"UNLESS_ORDER": "Respond to an application to court to impose a sanction on the other parties unless they do a specific action",
"EXTEND_TIME": "Respond to an application to more time to do what is required by a court order",
"OTHER": "Respond to an application to court to do something that's not on this list",
"STAY_THE_CLAIM": "Respond to an application to court to pause a claim",
"VARY_ORDER": "Respond to an application to reconsider an order",
"RELIEF_FROM_SANCTIONS": "Respond to an application to relief from a penalty you've been given by the court",
"SETTLE_BY_CONSENT": "Respond to an application to court to make an order settling the claim by consent",
"STRIKE_OUT": "Respond to an application to court to strike out all or part of the other parties' case without a trial",
"SUMMARY_JUDGEMENT": "Respond to an application to court to make a summary judgment on a case",
"VARY_PAYMENT_TERMS_OF_JUDGMENT": "Respond to an application to vary a judgment"
},
"RESPOND_TO_MULTIPLE": "Respond to an application",
"TITLE": "The other parties have said that you've agreed to the order they've requested. Is this correct?"
},
Expand Down Expand Up @@ -3220,6 +3235,7 @@
},
"UNAVAILABLE_HEARING_DATES": {
"ADD_ANOTHER_DATE": "Add another date or date range",
"GA_ADD_ANOTHER_DATE": "Add another date or date range",
"FROM": "From",
"IMPORTANT_EVENTS": "These should only be the dates of important events like medical appointments, other court hearings, or holidays you've already booked.",
"LONGER_PERIOD": "A longer period of time",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import {
ApplicationTypeOption,
ApplicationTypeOptionSelection,
getApplicationTypeOptionByTypeAndDescription,
} from 'common/models/generalApplication/applicationType';
import { YesNo, YesNoUpperCamelCase } from 'common/form/models/yesNo';
import { t } from 'i18next';
Expand Down Expand Up @@ -32,6 +30,7 @@ import {
} from 'common/models/generalApplication/applicationSummary';
import { dateTimeFormat } from 'common/utils/dateUtils';
import { Claim } from 'models/claim';
import {displayToEnumKey} from 'services/translation/convertToCUI/cuiTranslation';

const { Logger } = require('@hmcts/nodejs-logging');
const logger = Logger.getLogger('claimantResponseService');
Expand All @@ -54,9 +53,8 @@ export function getRespondToApplicationCaption(generalAppTypes: ApplicationTypeO
if (generalAppTypes?.length > 1) {
return t('PAGES.GENERAL_APPLICATION.AGREE_TO_ORDER.RESPOND_TO_MULTIPLE', { lng: getLng(lng) });
}
const applicationType = t(getApplicationTypeOptionByTypeAndDescription(getLast(generalAppTypes),ApplicationTypeOptionSelection.BY_APPLICATION_TYPE ), {lng: getLng(lng)}).toLowerCase();
return t('PAGES.GENERAL_APPLICATION.AGREE_TO_ORDER.RESPOND_TO',
{ lng: getLng(lng), interpolation: { escapeValue: false }, applicationType});
const applicationType = getLast(generalAppTypes);
return t(`PAGES.GENERAL_APPLICATION.AGREE_TO_ORDER.RESPOND_TO.${applicationType}`,{ lng: getLng(lng) });
}

export function getUnavailableHearingDateCaption(lng: string): string {
Expand Down Expand Up @@ -159,11 +157,17 @@ export const buildRespondentApplicationSummaryRow = (claimId: string, lng:string
const isApplicant = application.case_data.parentClaimantIsApplicant === YesNoUpperCamelCase.NO;
const status = getApplicationStatus(isApplicant, application.state);
const createDate = getApplicationCreatedDate(ccdClaim, application.id);
const type = displayToEnumKey(application.case_data?.applicationTypes);
let typeString = t(`PAGES.GENERAL_APPLICATION.SUMMARY.APPLICATION_TYPE_CCD.${type}`, {lng});
if (application.case_data?.applicationTypes.includes(',')) {
const types = application.case_data?.applicationTypes.split(',').map((applicationType: string) => displayToEnumKey(applicationType.trim()));
typeString = types.map(tp => t(`PAGES.GENERAL_APPLICATION.SUMMARY.APPLICATION_TYPE_CCD.${tp}`, {lng})).join(', ');
}
return {
state: t(`PAGES.GENERAL_APPLICATION.SUMMARY.STATES.${application.state}`, {lng}),
status: t(`PAGES.GENERAL_APPLICATION.SUMMARY.${status}`, {lng}),
statusColor: StatusColor[status],
types: application.case_data?.applicationTypes,
types: typeString,
id: application.id,
createdDate: dateTimeFormat(createDate, lng),
applicationUrl: getViewApplicationUrl(claimId, ccdClaim, application, index),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
{{ unavailableDateRow(unavailableDate, 'PAGES.GENERAL_APPLICATION.UNAVAILABLE_HEARING_DATES.SELECT', 0, form.errorFor, t, {hidden:true, noJs: true}, today, false) }}
{% endfor %}
{{ govukButton({
text: t('PAGES.GENERAL_APPLICATION.UNAVAILABLE_HEARING_DATES.ADD_ANOTHER_DATE'),
text: t('PAGES.GENERAL_APPLICATION.UNAVAILABLE_HEARING_DATES.GA_ADD_ANOTHER_DATE'),
classes: "append-row",
name: 'action',
value: 'add_another-unavailableDates'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -544,15 +544,44 @@ describe('General Application Response service', () => {
state: t('PAGES.GENERAL_APPLICATION.SUMMARY.STATES.AWAITING_RESPONDENT_RESPONSE'),
status: t('PAGES.GENERAL_APPLICATION.SUMMARY.TO_DO'),
statusColor: 'govuk-tag--red',
types: 'Vary order',
types: 'PAGES.GENERAL_APPLICATION.SUMMARY.APPLICATION_TYPE_CCD.VARY_ORDER',
id: '6789',
createdDate: '29 May 2024, 2:39:28 pm',
applicationUrl: '/case/12345/response/general-application/6789/view-application?index=1',
} as ApplicationSummary);
});

it('returns row in awaiting judicial decision state', () => {
it('returns row awaiting respondent response state', () => {
const appResponse = applicationResponse(ApplicationState.AWAITING_RESPONDENT_RESPONSE,false, false, true);
const ccdClaim = new Claim();
ccdClaim.caseRole = CaseRole.DEFENDANT;
ccdClaim.generalApplications = [
{
'id': 'test',
'value': {
'caseLink': {
'CaseReference': '6789',
},
'generalAppSubmittedDateGAspec': new Date('2024-05-29T14:39:28.483971'),
},
},
];

expect(buildRespondentApplicationSummaryRow('12345', 'en', ccdClaim)(appResponse, 0))
.toStrictEqual({
state: t('PAGES.GENERAL_APPLICATION.SUMMARY.STATES.AWAITING_RESPONDENT_RESPONSE'),
status: t('PAGES.GENERAL_APPLICATION.SUMMARY.TO_DO'),
statusColor: 'govuk-tag--red',
types: 'PAGES.GENERAL_APPLICATION.SUMMARY.APPLICATION_TYPE_CCD.VARY_ORDER',
id: '6789',
createdDate: '29 May 2024, 2:39:28 pm',
applicationUrl: '/case/12345/response/general-application/6789/view-application?index=1',
} as ApplicationSummary);
});

it('returns row in awaiting judicial decision state with multiples applications type', () => {
const appResponse = applicationResponse(ApplicationState.APPLICATION_SUBMITTED_AWAITING_JUDICIAL_DECISION,false, false, true);
appResponse.case_data.applicationTypes = 'Vary order, Extend time';
const ccdClaim = new Claim();
ccdClaim.caseRole = CaseRole.DEFENDANT;
ccdClaim.generalApplications = [
Expand All @@ -572,7 +601,7 @@ describe('General Application Response service', () => {
state: t('PAGES.GENERAL_APPLICATION.SUMMARY.STATES.APPLICATION_SUBMITTED_AWAITING_JUDICIAL_DECISION'),
status: t('PAGES.GENERAL_APPLICATION.SUMMARY.IN_PROGRESS'),
statusColor: 'govuk-tag--green',
types: 'Vary order',
types: 'PAGES.GENERAL_APPLICATION.SUMMARY.APPLICATION_TYPE_CCD.VARY_ORDER, PAGES.GENERAL_APPLICATION.SUMMARY.APPLICATION_TYPE_CCD.EXTEND_TIME',
id: '6789',
createdDate: '29 May 2024, 2:39:28 pm',
applicationUrl: '/case/12345/response/general-application/6789/view-application?index=1',
Expand Down Expand Up @@ -601,7 +630,7 @@ describe('General Application Response service', () => {
state: t('PAGES.GENERAL_APPLICATION.SUMMARY.STATES.APPLICATION_SUBMITTED_AWAITING_JUDICIAL_DECISION'),
status: t('PAGES.GENERAL_APPLICATION.SUMMARY.IN_PROGRESS'),
statusColor: 'govuk-tag--green',
types: 'Vary order',
types: 'PAGES.GENERAL_APPLICATION.SUMMARY.APPLICATION_TYPE_CCD.VARY_ORDER',
id: '6789',
createdDate: '29 May 2024, 2:39:28 pm',
applicationUrl: '/case/12345/general-application/6789/view-application?index=1',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -478,8 +478,8 @@ describe('translateCCDCaseDataToCUIModel', () => {

// When
const claim = translateCCDCaseDataToCUIModel(input);

//Then
expect(claim.respondentGaAppDetails).toEqual([{ generalAppTypes: ['STRIKE_OUT'], gaApplicationId: '1234567', caseState: 'awaiting respondent response', generalAppSubmittedDateGAspec: dateString }]);
});
});
});

0 comments on commit abfe18f

Please sign in to comment.