Skip to content

Commit

Permalink
Merge pull request #14 from govuk-one-login/olh-2459-add-hmrc-transla…
Browse files Browse the repository at this point in the history
…tions

OLH-2459 update script and run to support HMRC
  • Loading branch information
saralk authored Feb 19, 2025
2 parents 98a8cab + af664de commit 5997ff3
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion clients/dfeApplyForTeacherTraining.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const dfeApplyForTeacherTraining: Client = {
description: "Apply for a teacher training course to teach in England.",
linkText: "Go to your Apply for teacher training account",
linkUrl:
"https://www.apply-for-teacher-training.service.gov.uk/candidate/",
"https://www.apply-for-teacher-training.service.gov.uk/candidate/account",
},
},
};
Expand Down
9 changes: 9 additions & 0 deletions clients/hmrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,21 @@ const hmrc: Client = {
header: "A service run by HM Revenue and Customs (HMRC)",
linkText: "Find the HMRC service you need",
linkUrl: "https://www.gov.uk/government/organisations/hm-revenue-customs",
hintText: "For example services about tax, childcare, or state pensions.",
paragraph1:
"At the moment, GOV.UK One Login cannot show you which HMRC service you’ve used.",
paragraph2: "We’re working to make this possible.",
},
cy: {
header: "Gwasanaeth a weithredir gan Gyllid a Thollau EF (CThEF)",
linkText: "Dod o hyd i wasanaeth CThEF rydych ei angen",
linkUrl:
"https://www.gov.uk/government/organisations/hm-revenue-customs.cy",
hintText:
"Er enghraifft gwasanaethau am dreth, gofal plant, neu bensiynau'r wladwriaeth.",
paragraph1:
"Ar hyn o bryd, ni all GOV.UK One Login ddangos i chi pa wasanaeth CThEF rydych wedi'i ddefnyddio.",
paragraph2: "Rydym yn gweithio i wneud hyn yn bosibl.",
},
},
};
Expand Down
3 changes: 3 additions & 0 deletions interfaces/client.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ interface Translations {
description?: string;
linkText: string;
linkUrl: EnvironmentValue<string>;
hintText?: string;
paragraph1?: string;
paragraph2?: string;
}

interface BaseClient {
Expand Down
3 changes: 3 additions & 0 deletions interfaces/translations.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ export interface Translation {
description?: string;
link_text: string;
link_href: string;
hint_text?: string;
paragraph1?: string;
paragraph2?: string;
}

export type TranslationsObject = Record<string, Translation>;
11 changes: 4 additions & 7 deletions scripts/generate
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
#!/usr/bin/env bun
import { writeFileSync, readFileSync } from "fs";
import { Client } from "../interfaces/client.interface";
import { Translation } from '../interfaces/translations.interface'
import {
getAllowedAccountListClientIDs,
clientsToShowInSearchProd,
hmrcClientIds,
rsaAllowList,
} from "../../di-account-management-frontend/src/config";

interface Translation {
header: string;
description?: string;
link_text: string;
link_href: string;
}

interface IDs {
production: string;
integration: string;
Expand Down Expand Up @@ -88,6 +82,9 @@ function transformTranslate(
description: client.description,
linkText: client.link_text,
linkUrl: generateLinkObject(ids, language),
...client.hint_text && { hintText: client.hint_text },
...client.paragraph1 && { paragraph1: client.paragraph1 },
...client.paragraph2 && { paragraph2: client.paragraph2 },
};
}

Expand Down

0 comments on commit 5997ff3

Please sign in to comment.