Skip to content

Commit 069b679

Browse files
committed
Add localization for design system component defaults
So that we can add Welsh translations, localize the content for components that came from the defaults
1 parent afdff4d commit 069b679

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

app/components/cookie_banner_component/view.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<%= govuk_cookie_banner(html_attributes: {hidden: true, data: { module: "cookie-banner" }}) do |banner| %>
1+
<%= govuk_cookie_banner(html_attributes: {hidden: true, data: { module: "cookie-banner" }}, aria_label: t("cookie_banner.aria_label")) do |banner| %>
22
<%= banner.with_message(heading_text: t("cookie_banner.heading")) do |message| %>
33
<% message.with_action { content_tag(:button, t("cookie_banner.accept"), type:"button", class:"govuk-button", data: {function: "accept-cookies", module: "govuk-button"}) } %>
44
<% message.with_action { content_tag(:button, t("cookie_banner.reject"), type:"button", class:"govuk-button", data: {function: "reject-cookies", module: "govuk-button"}) } %>

app/controllers/forms/check_your_answers_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def page_to_row(page)
5757
{
5858
key: { text: helpers.sanitize(question_name) },
5959
value: { text: page.show_answer },
60-
actions: [{ href: change_link(page), visually_hidden_text: helpers.strip_tags(question_name) }],
60+
actions: [{ text: I18n.t("govuk_components.govuk_summary_list.change"), href: change_link(page), visually_hidden_text: helpers.strip_tags(question_name) }],
6161
}
6262
end
6363

config/locales/en.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ en:
107107
title: Success
108108
cookie_banner:
109109
accept: Accept analytics cookies
110+
aria_label: Cookie banner
110111
content: We’d like to use analytics cookies so we can understand how you use this website and make improvements.
111112
heading: Cookies on GOV.UK Forms
112113
policy_link: How we use cookies
@@ -172,6 +173,9 @@ en:
172173
remove_file_guidance: You can remove this file if you need to upload a different one.
173174
your_file: Your file
174175
gov_uk_forms: GOV.UK Forms
176+
govuk_components:
177+
govuk_summary_list:
178+
change: Change
175179
govuk_design_system_formbuilder:
176180
default_check_box_divider_text: or
177181
default_error_summary_title: There is a problem

0 commit comments

Comments
 (0)