From dc892e5ef90b25703acfa474ae21d785690e25d9 Mon Sep 17 00:00:00 2001 From: Kimberly Grey Date: Mon, 30 May 2022 14:12:07 +0100 Subject: [PATCH 1/5] Add parameter to localise mobile menu toggle button Adds the `menuButton` parameter to customise the text of the menu toggle button that appears on narrow screens. --- src/govuk/components/header/header.yaml | 19 +++++++++++++++++++ src/govuk/components/header/template.njk | 2 +- src/govuk/components/header/template.test.js | 14 ++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/govuk/components/header/header.yaml b/src/govuk/components/header/header.yaml index 0058649cbc..7ac0614005 100644 --- a/src/govuk/components/header/header.yaml +++ b/src/govuk/components/header/header.yaml @@ -56,6 +56,10 @@ params: type: string required: false description: Text for the `aria-label` attribute of the button that toggles the navigation. Defaults to 'Show or hide menu'. +- name: menuButtonText + type: string + required: false + description: Text for the button that toggles the navigation. This should be the shortest useful text that describes the button's purpose. Defaults to 'Menu'. - name: containerClasses type: string required: false @@ -131,6 +135,21 @@ examples: text: Navigation item 3 - href: '#4' text: Navigation item 4 + +- name: with custom menu button text + description: Button translated into Welsh + data: + menuButtonText: Dewislen + navigation: + - href: '#1' + text: Eitem llywio 1 + active: true + - href: '#2' + text: Eitem llywio 2 + - href: '#3' + text: Eitem llywio 3 + - href: '#4' + text: Eitem llywio 4 - name: with custom menu button label data: diff --git a/src/govuk/components/header/template.njk b/src/govuk/components/header/template.njk index d6e4cd2baa..0892e5a58e 100644 --- a/src/govuk/components/header/template.njk +++ b/src/govuk/components/header/template.njk @@ -61,7 +61,7 @@ {% endif %} {% if params.navigation %}