Skip to content

Commit

Permalink
BAU: a11y statement inset text tweak
Browse files Browse the repository at this point in the history
Tweak the way the webchat accessibility statement paragraph is displayed
on the contact triage page.
The inset text used to have several paragraphs which were stored as an
array in the translation files. This has since been updated so there is
one paragraph only, which means the current solution is a bit
overengineered.
Some small style updates: use em dash instead of a regular hyphen and
move the full stop outside of the anchor tag.
  • Loading branch information
danacotoran committed Jun 19, 2024
1 parent e5f3797 commit 315fe77
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 19 deletions.
7 changes: 2 additions & 5 deletions src/components/contact-govuk-one-login/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
{% endfor %}

<p class="govuk-body contact-reference">
{{'pages.contact.refCodeBlock.refCode' | translate}}
{{ 'pages.contact.refCodeBlock.refCode' | translate }}
<strong class="contact-reference__code">{{ referenceCode }}</strong>
</p>
{% endset %}
Expand Down Expand Up @@ -127,10 +127,7 @@
<p class="govuk-body"><button type="button" class="launch-webchat-link" data-launch-webchat hidden>{{ 'pages.contact.section3.webchat.linkText' | translate }}</button></p>

{% set accessibilityTextHtml %}
{% set insetTextParagraphs = 'pages.contact.section3.webchat.accessibility-statement.insetText.paragraphs' | translate({ returnObjects: true }) %}
{% for paragraph in insetTextParagraphs %}
<p class="govuk-body">{{ paragraph | safe | replace('[accessibilityStatementLinkHref]', accessibilityStatementUrl ) }}</p>
{% endfor %}
<p class="govuk-body">{{ 'pages.contact.section3.webchat.accessibilityStatementParagraph' | translate | safe | replace('[accessibilityStatementLinkHref]', accessibilityStatementUrl ) }}</p>
{% endset %}

{{ govukInsetText({
Expand Down
8 changes: 1 addition & 7 deletions src/locales/cy/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -522,13 +522,7 @@
"Mae'r cynorthwyydd digidol bob amser ar gael."
],
"linkText": "Defnyddio gwe-sgwrs",
"accessibility-statement": {
"insetText": {
"paragraphs": [
"Nid yw ein gwe-sgwrs yn gwbl hygyrch eto - rydym yn gweithio i’w wella. Gallwch ddarganfod <a class=\"govuk-link\" href=\"[accessibilityStatementLinkHref]?lng=cy#webchat-accessibility\">mwy am y cyfyngiadau a sut rydym yn eu cywiro.</a>"
]
}
}
"accessibilityStatementParagraph": "Nid yw ein gwe-sgwrs yn gwbl hygyrch eto — rydym yn gweithio i’w wella. Gallwch ddarganfod <a class=\"govuk-link\" href=\"[accessibilityStatementLinkHref]?lng=cy#webchat-accessibility\">mwy am y cyfyngiadau a sut rydym yn eu cywiro</a>."
},
"phone": {
"heading": "Ffôn",
Expand Down
8 changes: 1 addition & 7 deletions src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -638,13 +638,7 @@
"The digital assistant is always available."
],
"linkText": "Use webchat",
"accessibility-statement": {
"insetText": {
"paragraphs": [
"Our webchat is not fully accessible yet - we’re working to improve it. You can find out <a class=\"govuk-link\" href=\"[accessibilityStatementLinkHref]?lng=en#webchat-accessibility\">more about the limitations and how we’re fixing them.</a>"
]
}
}
"accessibilityStatementParagraph": "Our webchat is not fully accessible yet — we’re working to improve it. You can find out <a class=\"govuk-link\" href=\"[accessibilityStatementLinkHref]?lng=en#webchat-accessibility\">more about the limitations and how we’re fixing them</a>."
},
"phone": {
"heading": "Phone",
Expand Down

0 comments on commit 315fe77

Please sign in to comment.