govuk_publishing_components 23.12.2 → 23.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/govuk_publishing_components/take-action-amber.svg +4 -0
  3. data/app/assets/images/govuk_publishing_components/take-action-green.svg +4 -0
  4. data/app/assets/images/govuk_publishing_components/take-action-red.svg +4 -0
  5. data/app/assets/javascripts/govuk_publishing_components/components/header.js +3 -0
  6. data/app/assets/javascripts/govuk_publishing_components/components/layout-header.js +5 -0
  7. data/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js +32 -36
  8. data/app/assets/javascripts/govuk_publishing_components/modules.js +1 -1
  9. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +0 -1
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_contextual-sidebar.scss +34 -17
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_document-list.scss +14 -8
  12. data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +35 -44
  13. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-footer.scss +5 -0
  14. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +19 -7
  15. data/app/assets/stylesheets/govuk_publishing_components/components/print/_govspeak.scss +5 -0
  16. data/app/models/govuk_publishing_components/component_doc.rb +1 -1
  17. data/app/views/govuk_publishing_components/components/_button.html.erb +1 -0
  18. data/app/views/govuk_publishing_components/components/_contextual_sidebar.html.erb +2 -8
  19. data/app/views/govuk_publishing_components/components/_document_list.html.erb +2 -1
  20. data/app/views/govuk_publishing_components/components/_layout_footer.html.erb +9 -4
  21. data/app/views/govuk_publishing_components/components/_layout_header.html.erb +3 -2
  22. data/app/views/govuk_publishing_components/components/_step_by_step_nav.html.erb +2 -2
  23. data/app/views/govuk_publishing_components/components/_subscription-links.html.erb +3 -0
  24. data/app/views/govuk_publishing_components/components/_subscription_links.html.erb +82 -0
  25. data/app/views/govuk_publishing_components/components/_translation-nav.html.erb +3 -0
  26. data/app/views/govuk_publishing_components/components/_translation_nav.html.erb +30 -0
  27. data/app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_cta.html.erb +21 -0
  28. data/app/views/govuk_publishing_components/components/docs/contextual_sidebar.yml +60 -1
  29. data/app/views/govuk_publishing_components/components/docs/document_list.yml +32 -7
  30. data/app/views/govuk_publishing_components/components/docs/layout_header.yml +32 -0
  31. data/app/views/govuk_publishing_components/components/docs/meta_tags.yml +99 -1
  32. data/app/views/govuk_publishing_components/components/docs/subscription-links.yml +3 -0
  33. data/app/views/govuk_publishing_components/components/docs/subscription_links.yml +100 -0
  34. data/app/views/govuk_publishing_components/components/docs/translation-nav.yml +3 -1
  35. data/app/views/govuk_publishing_components/components/docs/translation_nav.yml +137 -0
  36. data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb +11 -6
  37. data/config/initializers/assets.rb +3 -0
  38. data/config/locales/cy.yml +6 -1
  39. data/config/locales/en.yml +8 -3
  40. data/lib/govuk_publishing_components/presenters/contextual_navigation.rb +124 -2
  41. data/lib/govuk_publishing_components/presenters/meta_tags.rb +2 -0
  42. data/lib/govuk_publishing_components/version.rb +1 -1
  43. data/node_modules/govuk-frontend/govuk/all.js +57 -0
  44. data/node_modules/govuk-frontend/govuk/components/_all.scss +1 -0
  45. data/node_modules/govuk-frontend/govuk/components/accordion/fixtures.json +25 -10
  46. data/node_modules/govuk-frontend/govuk/components/back-link/fixtures.json +12 -6
  47. data/node_modules/govuk-frontend/govuk/components/back-link/macro-options.json +4 -4
  48. data/node_modules/govuk-frontend/govuk/components/breadcrumbs/fixtures.json +34 -13
  49. data/node_modules/govuk-frontend/govuk/components/breadcrumbs/macro-options.json +1 -0
  50. data/node_modules/govuk-frontend/govuk/components/button/fixtures.json +74 -31
  51. data/node_modules/govuk-frontend/govuk/components/character-count/fixtures.json +72 -15
  52. data/node_modules/govuk-frontend/govuk/components/character-count/macro-options.json +1 -1
  53. data/node_modules/govuk-frontend/govuk/components/checkboxes/fixtures.json +145 -52
  54. data/node_modules/govuk-frontend/govuk/components/checkboxes/macro-options.json +2 -2
  55. data/node_modules/govuk-frontend/govuk/components/date-input/fixtures.json +84 -34
  56. data/node_modules/govuk-frontend/govuk/components/date-input/macro-options.json +1 -1
  57. data/node_modules/govuk-frontend/govuk/components/date-input/template.njk +1 -1
  58. data/node_modules/govuk-frontend/govuk/components/details/fixtures.json +34 -14
  59. data/node_modules/govuk-frontend/govuk/components/error-message/fixtures.json +21 -10
  60. data/node_modules/govuk-frontend/govuk/components/error-message/macro-options.json +1 -0
  61. data/node_modules/govuk-frontend/govuk/components/error-summary/_index.scss +2 -12
  62. data/node_modules/govuk-frontend/govuk/components/error-summary/fixtures.json +86 -25
  63. data/node_modules/govuk-frontend/govuk/components/fieldset/fixtures.json +20 -10
  64. data/node_modules/govuk-frontend/govuk/components/file-upload/fixtures.json +60 -13
  65. data/node_modules/govuk-frontend/govuk/components/footer/fixtures.json +37 -18
  66. data/node_modules/govuk-frontend/govuk/components/footer/macro-options.json +8 -5
  67. data/node_modules/govuk-frontend/govuk/components/header/fixtures.json +36 -18
  68. data/node_modules/govuk-frontend/govuk/components/header/macro-options.json +2 -2
  69. data/node_modules/govuk-frontend/govuk/components/hint/fixtures.json +17 -8
  70. data/node_modules/govuk-frontend/govuk/components/input/fixtures.json +130 -40
  71. data/node_modules/govuk-frontend/govuk/components/input/macro-options.json +1 -1
  72. data/node_modules/govuk-frontend/govuk/components/inset-text/fixtures.json +17 -8
  73. data/node_modules/govuk-frontend/govuk/components/label/fixtures.json +20 -11
  74. data/node_modules/govuk-frontend/govuk/components/label/macro-options.json +1 -1
  75. data/node_modules/govuk-frontend/govuk/components/notification-banner/README.md +15 -0
  76. data/node_modules/govuk-frontend/govuk/components/notification-banner/_index.scss +89 -0
  77. data/node_modules/govuk-frontend/govuk/components/notification-banner/_notification-banner.scss +2 -0
  78. data/node_modules/govuk-frontend/govuk/components/notification-banner/fixtures.json +212 -0
  79. data/node_modules/govuk-frontend/govuk/components/notification-banner/macro-options.json +68 -0
  80. data/node_modules/govuk-frontend/govuk/components/notification-banner/macro.njk +3 -0
  81. data/node_modules/govuk-frontend/govuk/components/notification-banner/notification-banner.js +61 -0
  82. data/node_modules/govuk-frontend/govuk/components/notification-banner/template.njk +47 -0
  83. data/node_modules/govuk-frontend/govuk/components/panel/fixtures.json +30 -13
  84. data/node_modules/govuk-frontend/govuk/components/phase-banner/fixtures.json +20 -9
  85. data/node_modules/govuk-frontend/govuk/components/radios/fixtures.json +167 -50
  86. data/node_modules/govuk-frontend/govuk/components/select/fixtures.json +97 -18
  87. data/node_modules/govuk-frontend/govuk/components/select/macro-options.json +1 -1
  88. data/node_modules/govuk-frontend/govuk/components/skip-link/fixtures.json +21 -9
  89. data/node_modules/govuk-frontend/govuk/components/summary-list/fixtures.json +118 -25
  90. data/node_modules/govuk-frontend/govuk/components/table/fixtures.json +92 -22
  91. data/node_modules/govuk-frontend/govuk/components/tabs/fixtures.json +75 -18
  92. data/node_modules/govuk-frontend/govuk/components/tabs/macro-options.json +1 -1
  93. data/node_modules/govuk-frontend/govuk/components/tag/fixtures.json +28 -14
  94. data/node_modules/govuk-frontend/govuk/components/textarea/fixtures.json +68 -17
  95. data/node_modules/govuk-frontend/govuk/components/warning-text/fixtures.json +19 -14
  96. data/node_modules/govuk-frontend/govuk/helpers/_links.scss +94 -0
  97. data/node_modules/govuk-frontend/govuk/settings/_colours-applied.scss +9 -0
  98. data/node_modules/govuk-frontend/govuk/settings/_typography-font.scss +3 -0
  99. data/node_modules/govuk-frontend/package.json +1 -1
  100. metadata +18 -4
  101. data/app/assets/stylesheets/govuk_publishing_components/components/_transition-countdown.scss +0 -125
  102. data/app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_related_links.html.erb +0 -6
@@ -1,16 +1,16 @@
1
1
  name: Document list
2
2
  description: An ordered list of documents including a document type, when updated and a link.
3
3
  body: |
4
- Outputs a list to documents, based on an array of document data. This may include:
4
+ Outputs a list to documents, based on an array of document data. A "document" in this context can be an asset (such as a ODT or other downloadable document) or a web page.
5
+
6
+ The component can display:
5
7
 
6
- * document title
7
- * link to the document
8
- * last updated date object
9
- * document type
8
+ * a document title
9
+ * a link to the document
10
+ * a last updated date object
11
+ * a document type
10
12
 
11
13
  Tracking can be added to the links by supplying optional data attributes for each.
12
-
13
- Documents are presented in an ordered list as the component expects that the ordering of the documents is relevant.
14
14
  accessibility_criteria: |
15
15
  The component must:
16
16
 
@@ -195,6 +195,23 @@ examples:
195
195
  public_updated_at: 2017-07-19 15:01:48
196
196
  document_type: 'Statistical data set'
197
197
  subtext: 'First published during the 1996 Conservative Government'
198
+ without_top_border_on_list_element:
199
+ description: Several interfaces across GOV.UK benefit from the semantics of the document list but have their own bespoke designs, sometimes meaning that the visual border element doesn't gel with said interface. Removing it using the below attribute allows for cleaner visual fidelity in this instances.
200
+ data:
201
+ remove_top_border: true
202
+ items:
203
+ - link:
204
+ text: 'Department for Education – Statistics at DfE'
205
+ path: '/government/organisations/department-for-education/about/statistics'
206
+ metadata:
207
+ public_updated_at: 2017-07-19 15:01:48
208
+ document_type: 'Corporate information'
209
+ - link:
210
+ text: 'State-funded school inspections and outcomes: management information'
211
+ path: '/government/organisations/department-for-education/about/statistics'
212
+ metadata:
213
+ public_updated_at: 2017-07-19 15:01:48
214
+ document_type: 'Statistical data set'
198
215
  highlighted_result:
199
216
  description: Highlight one or more of the items in the list. This is used on finders to provide a 'top result' for a search. The `highlight_text` parameter is optional.
200
217
  data:
@@ -280,3 +297,11 @@ examples:
280
297
  document_type: 'Data tryloywder'
281
298
  locale:
282
299
  document_type: 'cy'
300
+ with_full_size_description_text:
301
+ data:
302
+ items:
303
+ - link:
304
+ text: 'Become an apprentice'
305
+ path: '/become-an-apprentice'
306
+ description: 'Becoming an apprentice - what to expect, apprenticeship levels, pay and training, making an application, complaining about an apprenticeship.'
307
+ full_size_description: true
@@ -60,6 +60,38 @@ examples:
60
60
  - text: News and communications
61
61
  href: "item-6"
62
62
  active: true
63
+ with_custom_navigation_aria_label:
64
+ description: The navigation has `aria-label="Top level"` by default. This option is here for when the `aria-label` needs to be more descriptive than that.
65
+ data:
66
+ search_left: true
67
+ navigation_aria_label: "Departments and policy"
68
+ navigation_items:
69
+ - text: Departments
70
+ href: "item-1"
71
+ - text: Worldwide
72
+ href: "item-2"
73
+ - text: How government works
74
+ href: "item-3"
75
+ - text: Get involved
76
+ href: "item-4"
77
+ - text: Consultations
78
+ href: "item-4"
79
+ - text: Statistics
80
+ href: "item-5"
81
+ - text: News and communications
82
+ href: "item-6"
83
+ active: true
84
+ with_navigation_link_data_attributes:
85
+ description: Supports adding data attributes i.e for tracking
86
+ data:
87
+ navigation_items:
88
+ - text: Departments
89
+ href: "item-1"
90
+ data:
91
+ module: "a custom attribute"
92
+ something_else: "some other custom attribute"
93
+ - text: Worldwide
94
+ href: "item-2"
63
95
  full_width:
64
96
  description: |
65
97
  This is difficult to preview because the preview windows are constrained, but the header will stretch to the size of its container.
@@ -4,11 +4,43 @@ body: |
4
4
  This takes a content-store links hash like object which it can then turn into
5
5
  the correct analytics identifier metadata tags.
6
6
 
7
- The code which reads the meta tags can be found <a href="https://github.com/alphagov/static/blob/master/app/assets/javascripts/analytics/static-analytics.js#L76-L96">in static-analytics.js</a>.
7
+ These are additionally used by the <a href="https://github.com/alphagov/govuk-browser-extension">GOV.UK browser extension</a> to provide details about a given page.
8
+
9
+ The code which reads the meta tags can be found <a href="https://github.com/alphagov/govuk_publishing_components/blob/master/app/assets/javascripts/govuk_publishing_components/analytics/custom-dimensions.js">in custom-dimensions.js</a>.
8
10
  accessibility_criteria: |
9
11
  The analytics meta tags component should not be visible to any users.
10
12
  display_html: true
11
13
  examples:
14
+ with_core_tags:
15
+ data:
16
+ content_item:
17
+ document_type: "html_publication"
18
+ publishing_app: "whitehall"
19
+ schema_name: "html_publication"
20
+ content_id: "00000000-0000-0000-0000-00000000000"
21
+ navigation_page_type: "Taxon Page"
22
+ section: "business tax"
23
+ withdrawn_notice: true
24
+ with_content_history_tags:
25
+ description: |
26
+ The tags in this object will generate the `content-has-history` tag, set to true. This tag is triggered when either, within `content_item`:
27
+
28
+ 1. `public_updated_at` and `first_public_at` within `details` are both present and they aren't the same value
29
+ 2. `change_history` within `details` is present and it has a value of more than 1
30
+
31
+ See below example for specific details.
32
+ data:
33
+ content_item:
34
+ public_updated_at: "2021-01-15T12:30:45.000+00:00"
35
+ details:
36
+ first_public_at: "2020-11-03T09:15:00.000+00:00"
37
+ change_history: "5"
38
+ with_date_and_postcode_stripping_for_static_analytics:
39
+ data:
40
+ content_item:
41
+ local_assigns:
42
+ strip_dates_pii: true
43
+ strip_postcodes_pii: true
12
44
  with_organisations:
13
45
  data:
14
46
  content_item:
@@ -24,3 +56,69 @@ examples:
24
56
  links:
25
57
  world_locations:
26
58
  - analytics_identifier: WL3
59
+ with_political_tags:
60
+ data:
61
+ content_item:
62
+ details:
63
+ political: true
64
+ government:
65
+ current: true
66
+ slug: "2010-to-2015-conservative-and-liberal-democrat-coalition-government"
67
+ with_historic_political_tags:
68
+ data:
69
+ content_item:
70
+ details:
71
+ political: true
72
+ government:
73
+ current: false
74
+ slug: "2010-to-2015-conservative-and-liberal-democrat-coalition-government"
75
+ with_non-political_tags:
76
+ data:
77
+ content_item:
78
+ details:
79
+ political: false
80
+ government:
81
+ slug: "2010-to-2015-conservative-and-liberal-democrat-coalition-government"
82
+ with_taxonomy_added_via_document_type:
83
+ description: |
84
+ You can trigger taxonomy tag rendering by either including a `document_type` attributes of "taxon" or including the `parent_taxons` or `taxons` attributes under the `links` attribute.
85
+ data:
86
+ content_item:
87
+ content_id: "00000000-0000-0000-0000-000000000000"
88
+ document_type: "taxon"
89
+ base_path: "/example-of-taxons"
90
+ with_taxonomy_added_via_links:
91
+ data:
92
+ content_item:
93
+ links:
94
+ taxons:
95
+ - content_id: "11111111-1111-1111-1111-111111111111"
96
+ document_type: "taxon"
97
+ base_path: "/disabilities-benefits"
98
+ - content_id: "22222222-2222-2222-2222-222222222222"
99
+ document_type: "taxon"
100
+ base_path: "/childcare-parenting/childrens-social-care-providers"
101
+ links:
102
+ parent_taxons:
103
+ - content_id: "33333333-3333-3333-3333-333333333333"
104
+ document_type: "taxon"
105
+ base_path: "/childcare-parenting"
106
+ with_multiple_step_by_step_tags:
107
+ data:
108
+ content_item:
109
+ links:
110
+ part_of_step_navs:
111
+ - content_id: "00000000-0000-0000-0000-000000000000"
112
+ - content_id: "11111111-1111-1111-1111-111111111111"
113
+ with_primary_step_by_step_tag:
114
+ data:
115
+ content_item:
116
+ links:
117
+ part_of_step_navs:
118
+ - content_id: "00000000-0000-0000-0000-000000000000"
119
+ with_secondary_step_by_step_tag:
120
+ data:
121
+ content_item:
122
+ links:
123
+ secondary_to_step_navs:
124
+ - content_id: "22222222-2222-2222-2222-222222222222"
@@ -1,3 +1,6 @@
1
+ # DO NOT MAKE CHANGES TO THIS FILE
2
+ # It is a temporary copy of subscription_links.yml and will be deleted shortly
3
+
1
4
  name: Subscription links
2
5
  description: Links to ‘Get emails’ and ‘Subscribe to feed’
3
6
  body: |
@@ -0,0 +1,100 @@
1
+ name: Subscription links
2
+ description: Links to ‘Get emails’ and ‘Subscribe to feed’
3
+ body: |
4
+ <strong>NOTE: This component includes a h2 heading by default but can be suppressed by using `hide_heading` option (see below)<strong>
5
+ accessibility_criteria: |
6
+ Icons in subscription links must be presentational and ignored by screen readers.
7
+
8
+ Toggle elements in the component must:
9
+
10
+ - be usable with a keyboard
11
+ - be usable with touch
12
+ - be recognised by screen readers as a button
13
+ - announce to screen readers whether they are expanded or collapsed
14
+ - show hidden elements by default when Javascript is disabled
15
+ shared_accessibility_criteria:
16
+ - link
17
+ examples:
18
+ default:
19
+ data:
20
+ email_signup_link: '/foreign-travel-advice/singapore/email-signup'
21
+ feed_link: '/foreign-travel-advice/singapore.atom'
22
+ with_margin:
23
+ description: The component accepts a number for margin bottom from 0 to 9 (0px to 60px) using the [GOV.UK Frontend spacing scale](https://design-system.service.gov.uk/styles/spacing/#the-responsive-spacing-scale). It defaults to having no margin bottom, although some margin is supplied by the links themselves (so that when they stack on mobile there is space between them).
24
+ data:
25
+ email_signup_link: '/foreign-travel-advice/singapore/email-signup'
26
+ feed_link: '/foreign-travel-advice/singapore.atom'
27
+ margin_bottom: 9
28
+ with_only_email_signup_link:
29
+ data:
30
+ email_signup_link: '/foreign-travel-advice/singapore/email-signup'
31
+ with_only_feed_link:
32
+ data:
33
+ feed_link: '/foreign-travel-advice/singapore.atom'
34
+ with_custom_text:
35
+ data:
36
+ email_signup_link: '/foreign-travel-advice/singapore/email-signup'
37
+ email_signup_link_text: 'Get notifications'
38
+ feed_link: '/foreign-travel-advice/singapore.atom'
39
+ feed_link_text: 'View feed'
40
+ with_copyable_feed_link:
41
+ description: |
42
+ This option changes the feed link to a toggle control, which opens a hidden element containing an input prepopulated with the value passed to the component, usually a URL to an atom feed. This uses the [form input](/component-guide/input) component.
43
+
44
+ Note that this option overrides the feed_link option, so if both are passed feed_link is ignored. Note that a value for email_signup_link can also be passed as normal.
45
+ data:
46
+ email_signup_link: '/foreign-travel-advice/singapore/email-signup'
47
+ feed_link_box_value: 'https://www.gov.uk/government/organisations/attorney-generals-office.atom'
48
+ with_branding:
49
+ description: Organisation [colour branding](https://github.com/alphagov/govuk_publishing_components/blob/master/docs/component_branding.md) can be added to the component as shown.
50
+ data:
51
+ brand: 'attorney-generals-office'
52
+ email_signup_link: '/foreign-travel-advice/singapore/email-signup'
53
+ feed_link: '/foreign-travel-advice/singapore.atom'
54
+ with_tracking:
55
+ description: Data attributes can be passed for each link as shown.
56
+ data:
57
+ email_signup_link: '/foreign-travel-advice/singapore/email-signup'
58
+ email_signup_link_data_attributes: {
59
+ track_category: 'email_link_category',
60
+ track_action: 1.1,
61
+ track_label: 'email_link_label',
62
+ track_options: {
63
+ dimension28: 1,
64
+ dimension29: 'dimension29EmailLink'
65
+ }
66
+ }
67
+ feed_link_box_value: 'https://www.gov.uk/government/organisations/attorney-generals-office.atom'
68
+ feed_link_data_attributes: {
69
+ track_category: 'feed_link_category',
70
+ track_action: 1.2,
71
+ track_label: 'feed_link_label',
72
+ track_options: {
73
+ dimension28: 7,
74
+ dimension29: 'dimension29feedLink'
75
+ }
76
+ }
77
+ as_small_form:
78
+ data:
79
+ email_signup_link: '/foreign-travel-advice/singapore/email-signup'
80
+ feed_link: '/foreign-travel-advice/singapore.atom'
81
+ small_form: true
82
+ without_heading:
83
+ description: |
84
+ By default the component includes an h2 heading. The component could be used anywhere on the page and could mean that it produces invalid markup or make the site unaccessible.
85
+ data:
86
+ email_signup_link: '/foreign-travel-advice/singapore/email-signup'
87
+ feed_link: '/foreign-travel-advice/singapore.atom'
88
+ hide_heading: true
89
+ with_a_different_language:
90
+ data:
91
+ email_signup_link: '/foreign-travel-advice/singapore/email-signup'
92
+ email_signup_link_text: 'Recevez des notifications'
93
+ email_signup_link_text_locale: 'fr'
94
+ feed_link: '/foreign-travel-advice/singapore.atom'
95
+ feed_link_text: 'Flux RSS'
96
+ feed_link_text_locale: 'fr'
97
+ description: |
98
+ The component is used on translated pages that don't have a translation for the text strings. This means that it could display the fallback English string if the translate method can't find an appropriate translation. This makes sure that the `lang` can be set to ensure that browsers understand which parts of the page are in each language.
99
+
100
+ The `lang` attribute **must** be set to a [valid BCP47 string](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang#Language_tag_syntax). A valid code can be the two or three letter language code - for example, English is `en` or `eng`, Korean is `ko` or `kor` - but if in doubt please check.
@@ -1,3 +1,6 @@
1
+ # DO NOT MAKE CHANGES TO THIS FILE
2
+ # It is a temporary copy of translation_nav.yml and will be deleted shortly
3
+
1
4
  name: Translation navigation
2
5
  description: A list of links to available translations
3
6
  body: The active property indicates the current language.
@@ -134,4 +137,3 @@ examples:
134
137
  dimension29: 'dimension29Welsh'
135
138
  context:
136
139
  dark_background: true
137
-
@@ -0,0 +1,137 @@
1
+ name: Translation navigation
2
+ description: A list of links to available translations
3
+ body: The active property indicates the current language.
4
+ accessibility_criteria: |
5
+ The component must:
6
+
7
+ - be [a landmark with a navigation role](https://accessibility.blog.gov.uk/2016/05/27/using-navigation-landmarks/)
8
+ - have an accessible name in the current language, eg "Translations"
9
+
10
+ The translation links must:
11
+
12
+ - [identify the language of the text](https://www.w3.org/TR/UNDERSTANDING-WCAG20/meaning-other-lang-id.html#meaning-other-lang-id-examples-head)
13
+
14
+ [Watch a screen reader pronounce text differently based on lang attribute](https://bit.ly/screenreaderpronunciation)
15
+ shared_accessibility_criteria:
16
+ - link
17
+ examples:
18
+ default:
19
+ data:
20
+ translations:
21
+ - locale: 'en'
22
+ base_path: '/en'
23
+ text: 'English'
24
+ active: true
25
+ - locale: 'hi'
26
+ base_path: '/hi'
27
+ text: 'हिंदी'
28
+ multiple_translations:
29
+ data:
30
+ translations:
31
+ - locale: 'en'
32
+ base_path: '/en'
33
+ text: 'English'
34
+ active: true
35
+ - locale: 'fr'
36
+ base_path: '/fr'
37
+ text: 'Français'
38
+ - locale: 'hi'
39
+ base_path: '/hi'
40
+ text: 'हिंदी'
41
+ - locale: 'ja'
42
+ base_path: '/ja'
43
+ text: '日本語'
44
+ - locale: 'ur'
45
+ base_path: '/ur'
46
+ text: 'اردو'
47
+ - locale: 'zh'
48
+ base_path: '/zh'
49
+ text: '中文'
50
+ right_to_left:
51
+ data:
52
+ translations:
53
+ - locale: 'en'
54
+ base_path: '/en'
55
+ text: 'English'
56
+ - locale: 'ar'
57
+ base_path: '/ar'
58
+ text: 'العربية'
59
+ active: true
60
+ context:
61
+ right_to_left: true
62
+ with_branding:
63
+ description: Organisation [colour branding](https://github.com/alphagov/govuk_publishing_components/blob/master/docs/component_branding.md) can be added to the component as shown.
64
+ data:
65
+ brand: 'wales-office'
66
+ translations:
67
+ - locale: 'en'
68
+ base_path: '/en'
69
+ text: 'English'
70
+ active: true
71
+ - locale: 'cy'
72
+ base_path: '/cy'
73
+ text: 'Cymraeg'
74
+ with_no_top_margin:
75
+ data:
76
+ no_margin_top: true
77
+ translations:
78
+ - locale: 'en'
79
+ base_path: '/en'
80
+ text: 'English'
81
+ active: true
82
+ - locale: 'cy'
83
+ base_path: '/cy'
84
+ text: 'Cymraeg'
85
+ with_tracking:
86
+ description: Data attributes can be passed for each link as shown.
87
+ data:
88
+ translations:
89
+ - locale: 'en'
90
+ base_path: '/en'
91
+ text: 'English'
92
+ active: true
93
+ data_attributes:
94
+ track_category: 'categoryEnglish'
95
+ track_action: 1.1
96
+ track_label: 'labelEnglish'
97
+ track_options:
98
+ dimension28: 1
99
+ dimension29: 'dimension29English'
100
+ - locale: 'cy'
101
+ base_path: '/cy'
102
+ text: 'Cymraeg'
103
+ data_attributes:
104
+ track_category: 'categoryWelsh'
105
+ track_action: 1.2
106
+ track_label: 'labelWelsh'
107
+ track_options:
108
+ dimension28: 1
109
+ dimension29: 'dimension29Welsh'
110
+ inverse:
111
+ data:
112
+ inverse: true
113
+ translations:
114
+ - locale: 'en'
115
+ base_path: '/en'
116
+ text: 'English'
117
+ active: true
118
+ data_attributes:
119
+ track_category: 'categoryEnglish'
120
+ track_action: 1.1
121
+ track_label: 'labelEnglish'
122
+ track_options:
123
+ dimension28: 1
124
+ dimension29: 'dimension29English'
125
+ - locale: 'cy'
126
+ base_path: '/cy'
127
+ text: 'Cymraeg'
128
+ data_attributes:
129
+ track_category: 'categoryWelsh'
130
+ track_action: 1.2
131
+ track_label: 'labelWelsh'
132
+ track_options:
133
+ dimension28: 1
134
+ dimension29: 'dimension29Welsh'
135
+ context:
136
+ dark_background: true
137
+