Skip to content

Commit f8f94f2

Browse files
Merge pull request #1430 from alphagov/pass-in-licence-html
Localise licence in footer
2 parents 52b6318 + 3ebf9ae commit f8f94f2

4 files changed

Lines changed: 25 additions & 1 deletion

File tree

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
1-
<%= govuk_footer meta_items_title: t("footer.helpful_links"), meta_items: meta_links %>
1+
<%= govuk_footer(meta_items_title: t("footer.helpful_links"), copyright_text: t("footer.copyright"), meta_items: meta_links) do |footer| %>
2+
<%= footer.with_meta_licence_html do %>
3+
<svg aria-hidden="true" focusable="false" class="govuk-footer__licence-logo" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 483.2 195.7" height="17" width="41">
4+
<path fill="currentColor" d="M421.5 142.8V.1l-50.7 32.3v161.1h112.4v-50.7zm-122.3-9.6A47.12 47.12 0 0 1 221 97.8c0-26 21.1-47.1 47.1-47.1 16.7 0 31.4 8.7 39.7 21.8l42.7-27.2A97.63 97.63 0 0 0 268.1 0c-36.5 0-68.3 20.1-85.1 49.7A98 98 0 0 0 97.8 0C43.9 0 0 43.9 0 97.8s43.9 97.8 97.8 97.8c36.5 0 68.3-20.1 85.1-49.7a97.76 97.76 0 0 0 149.6 25.4l19.4 22.2h3v-87.8h-80l24.3 27.5zM97.8 145c-26 0-47.1-21.1-47.1-47.1s21.1-47.1 47.1-47.1 47.2 21 47.2 47S123.8 145 97.8 145" />
5+
</svg>
6+
7+
<%= t("footer.licence", link: govuk_footer_link_to(t("footer.licence_link_text"), t("footer.licence_link_url"))).html_safe %>
8+
<% end %>
9+
<% end %>

config/locales/cy.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,11 @@ cy:
316316
footer:
317317
accessibility_statement: Datganiad hygyrchedd
318318
cookies: Cwcis
319+
copyright: "© Hawlfraint y Goron"
319320
helpful_links: Helpful links
321+
licence: Mae’r holl gynnwys ar gael o dan y %{link}, ac eithrio lle nodir yn wahanol
322+
licence_link_text: Trwydded Llywodraeth Agored v3.0
323+
licence_link_url: https://www.nationalarchives.gov.uk/doc/open-government-licence-cymraeg/version/3/
320324
privacy_policy: Preifatrwydd
321325
form:
322326
check_your_answers:

config/locales/en.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,11 @@ en:
316316
footer:
317317
accessibility_statement: Accessibility statement
318318
cookies: Cookies
319+
copyright: "© Crown copyright"
319320
helpful_links: Helpful links
321+
licence: All content is available under the %{link}, except where otherwise stated
322+
licence_link_text: Open Government Licence v3.0
323+
licence_link_url: https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/
320324
privacy_policy: Privacy
321325
form:
322326
check_your_answers:

spec/components/footer_component/view_spec.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
it "includes the cookies link without a language query parameter" do
1919
expect(page).to have_link("Cookies", href: cookies_path)
2020
end
21+
22+
it "includes the licence link" do
23+
expect(page).to have_link(I18n.t("footer.licence_link_text"), href: I18n.t("footer.licence_link_url"))
24+
end
2125
end
2226

2327
context "when the locale is cy" do
@@ -34,6 +38,10 @@
3438
it "includes the cookies link with a language query parameter" do
3539
expect(page).to have_link(I18n.t("footer.cookies", locale: :cy), href: cookies_path(locale: "cy"))
3640
end
41+
42+
it "includes the licence link in Welsh" do
43+
expect(page).to have_link(I18n.t("footer.licence_link_text", locale: :cy), href: I18n.t("footer.licence_link_url", locale: :cy))
44+
end
3745
end
3846

3947
context "when a form is present for the request" do

0 commit comments

Comments
 (0)