Skip to content

Commit 4f93b4c

Browse files
Add translated examples page
1 parent f598e06 commit 4f93b4c

2 files changed

Lines changed: 88 additions & 0 deletions

File tree

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
{% extends "layouts/page.njk" %}
2+
3+
{% set title = "Translated examples" %}
4+
5+
{% block content %}
6+
<h1 class="nhsuk-heading-xl">{{ title }}</h1>
7+
8+
<div class="nhsuk-grid-row">
9+
<div class="nhsuk-grid-column-two-thirds">
10+
11+
<p class="nhsuk-body-l">
12+
These examples only illustrate how our components display translated text.
13+
We do not guarantee that they are accurate.
14+
</p>
15+
16+
<hr class="nhsuk-section-break nhsuk-section-break--l nhsuk-section-break--visible">
17+
18+
{{ characterCount({
19+
label: {
20+
text: "Allwch chi roi mwy o fanylion?",
21+
classes: "nhsuk-label--l",
22+
isPageHeading: true
23+
},
24+
hint: {
25+
text: "Peidiwch â chynnwys gwybodaeth bersonol, fel eich enw, dyddiad geni na rhif y GIG"
26+
},
27+
name: "with-translations-maxlength",
28+
maxlength: 200,
29+
textareaDescriptionText: "Gallwch ddefnyddio hyd at %{count} nod",
30+
charactersUnderLimitText: {
31+
one: "Mae gennych %{count} nod ar ôl",
32+
two: "Mae gennych %{count} nod ar ôl",
33+
few: "Mae gennych %{count} nod ar ôl",
34+
many: "Mae gennych %{count} nod ar ôl",
35+
other: "Mae gennych %{count} nod ar ôl"
36+
},
37+
charactersAtLimitText: "Mae gennych 0 nod ar ôl",
38+
charactersOverLimitText: {
39+
one: "Mae gennych %{count} nod yn ormod",
40+
two: "Mae gennych %{count} nod yn ormod",
41+
few: "Mae gennych %{count} nod yn ormod",
42+
many: "Mae gennych %{count} nod yn ormod",
43+
other: "Mae gennych chi %{count} nod yn ormod"
44+
}
45+
}) }}
46+
47+
{{ characterCount({
48+
label: {
49+
text: "Allwch chi roi mwy o fanylion?",
50+
classes: "nhsuk-label--l",
51+
isPageHeading: true
52+
},
53+
hint: {
54+
text: "Peidiwch â chynnwys gwybodaeth bersonol, fel eich enw, dyddiad geni na rhif y GIG"
55+
},
56+
name: "with-translations-maxwords",
57+
maxwords: 10,
58+
textareaDescriptionText: "Gallwch ddefnyddio hyd at %{count} nod",
59+
wordsUnderLimitText: {
60+
one: "Mae gennych %{count} gair ar ôl",
61+
two: "Mae gennych %{count} air ar ôl",
62+
few: "Mae gennych %{count} o eiriau ar ôl",
63+
many: "Mae gennych %{count} o eiriau ar ôl",
64+
other: "Mae gennych %{count} o eiriau ar ôl"
65+
},
66+
wordsAtLimitText: "Mae gennych 0 gair ar ôl",
67+
wordsOverLimitText: {
68+
one: "Mae gennych %{count} gair yn ormod",
69+
two: "Mae gennych %{count} air yn ormod",
70+
few: "Mae gennych %{count} o eiriau yn ormod",
71+
many: "Mae gennych %{count} o eiriau yn ormod",
72+
other: "Mae gennych %{count} o eiriau yn ormod"
73+
}
74+
}) }}
75+
76+
<div class="nhsuk-button-group">
77+
{{ button({
78+
text: "Cadw a pharhau"
79+
}) }}
80+
</div>
81+
82+
</div>
83+
</div>
84+
{% endblock %}

packages/nhsuk-frontend-review/src/index.njk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@
9494
href: "examples/task-list-multiple-sections/",
9595
text: "Task list with multiple sections"
9696
},
97+
{
98+
href: "examples/translated/",
99+
text: "Translated examples"
100+
},
97101
{
98102
href: "examples/typography/",
99103
text: "Typography and spacing examples"

0 commit comments

Comments
 (0)