Skip to content

Commit 2f0c782

Browse files
committed
Add in-page-content language switcher example
1 parent 83ce8b1 commit 2f0c782

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

  • packages/govuk-frontend-review/src/views/full-page-examples/language-switcher-in-page
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
title: Apply for a driving licence
3+
name: Language switcher in page
4+
scenario: |
5+
You want to switch the page content between English and Welsh.
6+
---
7+
8+
{% extends "layouts/full-page-example.njk" %}
9+
10+
{% from "govuk/components/language-switcher/macro.njk" import govukLanguageSwitcher %}
11+
12+
{% set pageTitle = example.title %}
13+
14+
{% block pageTitle %}{{ pageTitle }} - GOV.UK{% endblock %}
15+
16+
{% block containerStart %}
17+
{{ govukLanguageSwitcher({
18+
ariaLabel: "Language switcher",
19+
items: [
20+
{
21+
text: "English",
22+
lang: "en",
23+
current: true
24+
},
25+
{
26+
text: "Cymraeg",
27+
lang: "cy",
28+
href: "#/cy"
29+
}
30+
]
31+
}) }}
32+
{% endblock %}
33+
34+
{% block content %}
35+
<div class="govuk-grid-row">
36+
<div class="govuk-grid-column-two-thirds">
37+
38+
<h1 class="govuk-heading-xl">{{ pageTitle }}</h1>
39+
40+
<p class="govuk-body govuk-!-margin-top-6">
41+
Use the language switcher to move to the same page in another language.
42+
</p>
43+
</div>
44+
</div>
45+
{% endblock %}

0 commit comments

Comments
 (0)