govuk_publishing_components 27.14.2 → 27.18.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/analytics/custom-dimensions.js +52 -26
  3. data/app/assets/javascripts/govuk_publishing_components/analytics/ecommerce.js +25 -25
  4. data/app/assets/javascripts/govuk_publishing_components/analytics/explicit-cross-domain-links.js +49 -48
  5. data/app/assets/javascripts/govuk_publishing_components/analytics/page-content.js +74 -65
  6. data/app/assets/javascripts/govuk_publishing_components/components/cookie-banner.js +0 -1
  7. data/app/assets/javascripts/govuk_publishing_components/components/single-page-notification-button.js +25 -11
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_big-number.scss +10 -2
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +17 -115
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +24 -14
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_single-page-notification-button.scss +8 -0
  12. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss +8 -4
  13. data/app/assets/stylesheets/govuk_publishing_components/components/mixins/_grid-helper.scss +141 -0
  14. data/app/views/govuk_publishing_components/components/_button.html.erb +1 -1
  15. data/app/views/govuk_publishing_components/components/_cookie_banner.html.erb +1 -1
  16. data/app/views/govuk_publishing_components/components/_intervention.html.erb +21 -4
  17. data/app/views/govuk_publishing_components/components/_search.html.erb +1 -0
  18. data/app/views/govuk_publishing_components/components/_single_page_notification_button.html.erb +1 -1
  19. data/app/views/govuk_publishing_components/components/_success_alert.html.erb +4 -1
  20. data/app/views/govuk_publishing_components/components/docs/intervention.yml +11 -0
  21. data/app/views/govuk_publishing_components/components/docs/layout_for_public.yml +1 -1
  22. data/app/views/govuk_publishing_components/components/docs/radio.yml +40 -33
  23. data/app/views/govuk_publishing_components/components/docs/search.yml +3 -0
  24. data/app/views/govuk_publishing_components/components/docs/success_alert.yml +6 -0
  25. data/app/views/govuk_publishing_components/components/layout_header/_header_logo.html.erb +1 -1
  26. data/config/i18n-tasks.yml +8 -0
  27. data/config/locales/ar.yml +134 -131
  28. data/config/locales/az.yml +131 -131
  29. data/config/locales/be.yml +136 -130
  30. data/config/locales/bg.yml +135 -131
  31. data/config/locales/bn.yml +132 -131
  32. data/config/locales/cs.yml +136 -131
  33. data/config/locales/cy.yml +129 -125
  34. data/config/locales/da.yml +132 -131
  35. data/config/locales/de.yml +135 -131
  36. data/config/locales/dr.yml +133 -131
  37. data/config/locales/el.yml +131 -131
  38. data/config/locales/en.yml +17 -14
  39. data/config/locales/es-419.yml +131 -131
  40. data/config/locales/es.yml +131 -131
  41. data/config/locales/et.yml +134 -131
  42. data/config/locales/fa.yml +130 -131
  43. data/config/locales/fi.yml +133 -131
  44. data/config/locales/fr.yml +130 -130
  45. data/config/locales/gd.yml +133 -131
  46. data/config/locales/gu.yml +131 -131
  47. data/config/locales/he.yml +131 -131
  48. data/config/locales/hi.yml +131 -131
  49. data/config/locales/hr.yml +133 -131
  50. data/config/locales/hu.yml +134 -131
  51. data/config/locales/hy.yml +135 -131
  52. data/config/locales/id.yml +132 -131
  53. data/config/locales/is.yml +131 -131
  54. data/config/locales/it.yml +131 -131
  55. data/config/locales/ja.yml +128 -131
  56. data/config/locales/ka.yml +134 -131
  57. data/config/locales/kk.yml +131 -131
  58. data/config/locales/ko.yml +13 -17
  59. data/config/locales/lt.yml +136 -131
  60. data/config/locales/lv.yml +135 -131
  61. data/config/locales/ms.yml +131 -131
  62. data/config/locales/mt.yml +133 -131
  63. data/config/locales/nl.yml +131 -131
  64. data/config/locales/no.yml +131 -131
  65. data/config/locales/pa-pk.yml +128 -132
  66. data/config/locales/pa.yml +131 -131
  67. data/config/locales/pl.yml +135 -131
  68. data/config/locales/ps.yml +128 -131
  69. data/config/locales/pt.yml +131 -131
  70. data/config/locales/ro.yml +132 -131
  71. data/config/locales/ru.yml +135 -131
  72. data/config/locales/si.yml +131 -131
  73. data/config/locales/sk.yml +136 -131
  74. data/config/locales/sl.yml +138 -131
  75. data/config/locales/so.yml +131 -131
  76. data/config/locales/sq.yml +131 -131
  77. data/config/locales/sr.yml +133 -131
  78. data/config/locales/sv.yml +131 -131
  79. data/config/locales/sw.yml +131 -131
  80. data/config/locales/ta.yml +132 -131
  81. data/config/locales/th.yml +130 -131
  82. data/config/locales/tk.yml +132 -131
  83. data/config/locales/tr.yml +132 -131
  84. data/config/locales/uk.yml +138 -131
  85. data/config/locales/ur.yml +128 -131
  86. data/config/locales/uz.yml +133 -131
  87. data/config/locales/vi.yml +131 -131
  88. data/config/locales/zh-hk.yml +130 -131
  89. data/config/locales/zh-tw.yml +130 -131
  90. data/config/locales/zh.yml +130 -131
  91. data/lib/govuk_publishing_components/presenters/button_helper.rb +24 -0
  92. data/lib/govuk_publishing_components/presenters/intervention_helper.rb +20 -2
  93. data/lib/govuk_publishing_components/presenters/single_page_notification_button_helper.rb +3 -1
  94. data/lib/govuk_publishing_components/version.rb +1 -1
  95. metadata +3 -2
@@ -1,48 +1,51 @@
1
1
  ---
2
2
  zh:
3
3
  common:
4
- translations:
4
+ translations: 翻译
5
5
  components:
6
6
  accordion:
7
- hide:
8
- hide_all:
9
- show:
10
- show_all:
11
- this_section_visually_hidden:
7
+ hide: 隐藏
8
+ hide_all: 隐藏所有小节
9
+ show: 显示
10
+ show_all: 显示所有小节
11
+ this_section_visually_hidden: " 本小节"
12
12
  article_schema:
13
- scoped_search_description:
13
+ scoped_search_description: 在 %{title} 内搜索
14
14
  attachment:
15
- opendocument_html:
16
- order_a_copy:
15
+ opendocument_html: 本文件是 <a href='https://www.gov.uk/guidance/using-open-document-formats-odf-in-your-organisation' target=%{target} class='govuk-link'>开放式文本</a> 格式
16
+ order_a_copy: 订购副本
17
17
  page:
18
- one:
19
- other:
20
- reference:
21
- request_format_cta:
22
- request_format_details_html:
23
- request_format_text:
18
+ one: 1页
19
+ other: "%{count} 页"
20
+ reference: 参考号:%{reference}
21
+ request_format_cta: 申请可访问格式。
22
+ request_format_details_html: '如果您使用辅助技术(如屏幕阅读器),并需要更易于访问的格式,请发送电子邮件 <a href=''mailto:%{alternative_format_contact_email}'' target=''_blank'' class=''govuk-link''>%{alternative_format_contact_email}</a>。请告诉我们您需要什么格式。如果您能说出自己使用的辅助技术,这对我们很有帮助。 '
23
+ request_format_text: 此文件可能不适合辅助技术用户使用。
24
24
  back_link:
25
- back:
25
+ back: 向后
26
26
  character_count:
27
- body:
27
+ body: 您最多可以输入 %{number} 个 %{type}
28
28
  type:
29
- characters:
30
- words:
29
+ characters: 字符
30
+ words: 单词
31
31
  checkboxes:
32
- or:
32
+ or:
33
33
  contents_list:
34
- contents:
34
+ contents: 目录
35
35
  contextual_sidebar:
36
- pretitle:
36
+ pretitle: 也是部分
37
37
  cookie_banner:
38
38
  buttons:
39
- accept_cookies:
40
- reject_cookies:
41
- confirmation_message:
42
- confirmation_message_link:
43
- hide:
39
+ accept_cookies: 接受额外cookies
40
+ reject_cookies: 拒绝额外cookies
41
+ confirmation_message_html: 您可以随时 %{link}。
42
+ confirmation_message_link: 更改您的cookie设置
43
+ hide: 隐藏此消息
44
44
  text:
45
- title:
45
+ - 我们使用一些基本的cookie以使本网站运作。
46
+ - 我们希望设置额外的cookie,以了解您如何使用GOV.UK,记住您的设置,并改善政府服务。
47
+ - 我们也使用其他网站设置的cookie,以帮助我们提供其服务的内容。
48
+ title: GOV.UK上的Cookies
46
49
  devolved_nations:
47
50
  applies_to:
48
51
  connectors:
@@ -51,69 +54,59 @@ zh:
51
54
  england:
52
55
  northern_ireland:
53
56
  scotland:
57
+ type:
58
+ consultation:
59
+ detailed_guide:
60
+ guidance:
61
+ publication:
54
62
  wales:
55
63
  feedback:
56
- close:
57
- dont_include_personal_info:
58
- email_address:
59
- help_us_improve_govuk:
60
- is_not_useful:
61
- is_this_page_useful:
62
- is_useful:
63
- maybe:
64
- more_about_visit:
65
- 'no':
66
- send:
67
- send_me_survey:
68
- something_wrong:
69
- thank_you_for_feedback:
70
- what_doing:
71
- what_wrong:
72
- 'yes':
64
+ close: 关闭
65
+ dont_include_personal_info: 不要包含个人或财务信息,比如您的国家保险号或信用卡信息。
66
+ email_address: 电子邮箱地址
67
+ help_us_improve_govuk: 帮助我们改善GOV.UK
68
+ is_not_useful: 这个页面没有用
69
+ is_this_page_useful: 这个页面有用吗?
70
+ is_useful: 这个页面很有用
71
+ maybe: 可能
72
+ more_about_visit: 为了帮助我们改进GOV.UK,我们想了解更多关于您今天访问的信息。我们会给您发一个反馈表格的链接。只需2分钟即可填完。别担心,我们不会给您发垃圾邮件或将您的电子邮件地址分享给任何人。
73
+ 'no':
74
+ send: 发送
75
+ send_me_survey: 将调查表发给我
76
+ something_wrong: 报告此页面的问题
77
+ thank_you_for_feedback: 非常感谢您的反馈
78
+ what_doing: 您在干什么?
79
+ what_wrong: 发生了哪些错误?
80
+ 'yes':
73
81
  government_navigation:
74
- consultations:
75
- departments:
76
- get-involved:
77
- how-government-works:
78
- news_and_communications:
79
- statistics:
80
- worldwide:
81
- intervention:
82
- description:
83
- dismiss_link_text:
84
- dismiss_post_link:
85
- title:
82
+ consultations: 咨询
83
+ departments: 部门
84
+ get-involved: 参与
85
+ how-government-works: 政府如何运营
86
+ news_and_communications: 新闻和通讯
87
+ statistics: 统计数据
88
+ worldwide: 全世界
86
89
  layout_footer:
87
- copyright_html:
88
- licence_html:
89
- support_links:
90
+ copyright_html: <a class="govuk-footer__link govuk-footer__copyright-logo" href="http://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/copyright-and-re-use/crown-copyright/">© Crown版权所有</a>
91
+ licence_html: 除另有说明外,所有内容均可在 <a class="govuk-footer__link" href="https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/" rel="license">开放政府许可证第3.0版</a>获取
92
+ support_links: 支持链接
90
93
  layout_for_public:
91
94
  account_layout:
92
95
  feedback:
93
96
  banners:
94
- footer_intro:
95
- footer_link:
96
- footer_outro:
97
- phase_intro:
98
- phase_link:
99
- phase_outro:
100
- title:
97
+ phase_banner_html:
101
98
  navigation:
102
- destroy_user_session:
103
99
  menu_bar:
104
100
  account:
105
101
  link_text:
106
102
  manage:
107
103
  link_text:
108
- security:
109
- link_text:
110
- user_root_path:
111
104
  layout_header:
112
- hide_button:
113
- menu:
114
- search_button:
115
- show_button:
116
- top_level:
105
+ hide_button: 隐藏搜索
106
+ menu: 菜单
107
+ search_button: 搜索GOV.UK
108
+ show_button: 显示搜索
109
+ top_level: 最高级
117
110
  layout_super_navigation_header:
118
111
  logo_link_title:
119
112
  logo_text:
@@ -128,77 +121,83 @@ zh:
128
121
  popular_links_heading:
129
122
  search_text:
130
123
  metadata:
131
- from:
132
- history:
133
- last_updated:
134
- part_of:
135
- published:
136
- see_all_updates:
137
- toggle_less:
138
- toggle_more:
124
+ from:
125
+ history: 历史
126
+ last_updated: 上次更新
127
+ part_of: 一部分
128
+ published: 已发布
129
+ see_all_updates: 查看全部更新
130
+ toggle_less: 显示更少
131
+ toggle_more: "+ %{number}更多"
139
132
  modal_dialogue:
140
- close_modal:
133
+ close_modal: 关闭模态对话
141
134
  notice:
142
135
  banner_title:
143
136
  organisation_schema:
144
- all_content_search_description:
137
+ all_content_search_description: 查找 %{organisation} 的全部内容
145
138
  previous_and_next_navigation:
146
- pagination:
139
+ pagination: 分页
147
140
  print_link:
148
- text:
141
+ text: 打印本页面
149
142
  radio:
150
- or:
143
+ or:
151
144
  related_footer_navigation:
152
- collections:
153
- policies:
154
- statistical_data_sets:
155
- topical_events:
145
+ collections: 待整理
146
+ policies: 策略
147
+ statistical_data_sets: 统计数据集
148
+ topical_events: 局部事件
156
149
  related_navigation:
157
- collections:
158
- external_links:
159
- policies:
160
- publishers:
161
- related_contacts:
162
- related_content:
163
- related_external_links:
164
- related_guides:
165
- statistical_data_sets:
166
- topical_events:
167
- topics:
150
+ collections: 待整理
151
+ external_links: 网页上的其它地方
152
+ policies: 策略
153
+ publishers: 发布者
154
+ related_contacts: 其他联系人
155
+ related_content: 相关内容
156
+ related_external_links: 网页上的其它地方
157
+ related_guides: 详细指南
158
+ statistical_data_sets: 统计数据集
159
+ topical_events: 局部事件
160
+ topics: 探索本主题
168
161
  transition:
169
- link_path:
170
- link_text:
171
- title:
172
- world_locations:
162
+ hub_page_link_path: "/transition-check/questions"
163
+ hub_page_link_text: 获得个性化的操作列表
164
+ hub_page_title: 英国脱欧检查程序
165
+ link_path: "/brexit"
166
+ link_text: 检查您需要做的事情
167
+ title: 英国脱欧
168
+ world_locations: 世界地点
173
169
  search_box:
174
- input_title:
175
- label:
176
- search_button:
170
+ input_title: 搜索
171
+ label: 搜索GOV.UK
172
+ search_button: 搜索
177
173
  show_password:
178
- announce_hide:
179
- announce_show:
180
- hide:
181
- hide_password:
182
- show:
183
- show_password:
174
+ announce_hide: 您的密码已隐藏
175
+ announce_show: 您的密码已显示
176
+ hide: 隐藏
177
+ hide_password: 隐藏密码
178
+ show: 显示
179
+ show_password: 显示密码
180
+ single_page_notification_button:
181
+ subscribe_text:
182
+ unsubscribe_text:
184
183
  skip_link:
185
- text:
184
+ text: 跳过主要内容
186
185
  step_by_step_nav:
187
- hide:
188
- hide_all:
189
- show:
190
- show_all:
186
+ hide: 隐藏
187
+ hide_all: 隐藏全部步骤
188
+ show: 显示
189
+ show_all: 显示全部步骤
191
190
  step_by_step_nav_related:
192
- part_of:
191
+ part_of: 一部分
193
192
  subscription_links:
194
- email_signup_link_text:
195
- feed_link_label:
196
- feed_link_text:
197
- subscriptions:
193
+ email_signup_link_text: 获取电子邮件
194
+ feed_link_label: 将此URL复制并粘贴到推送阅读器
195
+ feed_link_text: 订阅推送
196
+ subscriptions: 订阅
198
197
  success_alert:
199
- success:
198
+ success: 成功
200
199
  summary_list:
201
- delete:
202
- edit:
200
+ delete: 删除
201
+ edit: 更改
203
202
  tabs:
204
- contents:
203
+ contents: 目录
@@ -11,6 +11,7 @@ module GovukPublishingComponents
11
11
  :rel,
12
12
  :data_attributes,
13
13
  :margin_bottom,
14
+ :id,
14
15
  :inline_layout,
15
16
  :target,
16
17
  :type,
@@ -49,16 +50,39 @@ module GovukPublishingComponents
49
50
  @value = local_assigns[:value]
50
51
  @classes = local_assigns[:classes]
51
52
  @aria_label = local_assigns[:aria_label]
53
+ @info_text_id = "info-text-id-#{SecureRandom.hex(4)}"
54
+ @button_id = "button-id-#{SecureRandom.hex(4)}"
52
55
  end
53
56
 
54
57
  def link?
55
58
  href.present?
56
59
  end
57
60
 
61
+ def info_text?
62
+ info_text.present?
63
+ end
64
+
65
+ def aria_labelledby
66
+ if info_text?
67
+ text = "#{@button_id} "
68
+ text << @info_text_id
69
+ text
70
+ end
71
+ end
72
+
73
+ def info_text_options
74
+ options = { class: info_text_classes }
75
+ options[:aria] = { hidden: true } if info_text?
76
+ options[:id] = @info_text_id if info_text?
77
+ options
78
+ end
79
+
58
80
  def html_options
59
81
  options = { class: css_classes }
60
82
  options[:role] = "button" if link?
61
83
  options[:type] = button_type
84
+ options[:id] = @button_id if info_text?
85
+ options[:aria] = { labelledby: aria_labelledby }
62
86
  options[:rel] = rel if rel
63
87
  options[:data] = data_attributes if data_attributes
64
88
  options[:title] = title if title
@@ -1,10 +1,17 @@
1
1
  module GovukPublishingComponents
2
2
  module Presenters
3
3
  class InterventionHelper
4
- attr_reader :query_string
5
-
6
4
  def initialize(local_assigns)
5
+ @accessible_text_suffix = I18n.t("components.intervention.accessible_link_text_suffix")
7
6
  @query_string = local_assigns[:query_string]
7
+ @suggestion_link_text = local_assigns[:suggestion_link_text]
8
+ @suggestion_link_url = local_assigns[:suggestion_link_url]
9
+ end
10
+
11
+ def accessible_text
12
+ @suggestion_link_text << @accessible_text_suffix unless @suggestion_link_text.include?(@accessible_text_suffix)
13
+
14
+ @suggestion_link_text
8
15
  end
9
16
 
10
17
  def dismiss_link
@@ -14,6 +21,17 @@ module GovukPublishingComponents
14
21
  "?hide-intervention=true"
15
22
  end
16
23
  end
24
+
25
+ def security_attr
26
+ rel = "noopener noreferrer"
27
+ rel << " external" unless @suggestion_link_url.start_with?("/", "https://gov.uk", "https://www.gov.uk")
28
+
29
+ rel
30
+ end
31
+
32
+ private
33
+
34
+ attr_reader :accessible_text_suffix, :query_string, :suggestion_link_text, :suggestion_link_url
17
35
  end
18
36
  end
19
37
  end
@@ -1,7 +1,7 @@
1
1
  module GovukPublishingComponents
2
2
  module Presenters
3
3
  class SinglePageNotificationButtonHelper
4
- attr_reader :already_subscribed, :data_attributes, :base_path, :js_enhancement, :button_type, :button_location
4
+ attr_reader :already_subscribed, :data_attributes, :base_path, :js_enhancement, :button_type, :button_location, :classes
5
5
 
6
6
  def initialize(local_assigns)
7
7
  @local_assigns = local_assigns
@@ -11,6 +11,8 @@ module GovukPublishingComponents
11
11
  @base_path = @local_assigns[:base_path] || nil
12
12
  @button_location = button_location_is_valid? ? @local_assigns[:button_location] : nil
13
13
  @button_type = @local_assigns[:already_subscribed] ? "Unsubscribe" : "Subscribe"
14
+ @classes = %w[gem-c-single-page-notification-button]
15
+ @classes << "js-personalisation-enhancement" if js_enhancement
14
16
  end
15
17
 
16
18
  def data
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "27.14.2".freeze
2
+ VERSION = "27.18.0".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_publishing_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 27.14.2
4
+ version: 27.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-25 00:00:00.000000000 Z
11
+ date: 2021-12-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config
@@ -635,6 +635,7 @@ files:
635
635
  - app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss
636
636
  - app/assets/stylesheets/govuk_publishing_components/components/mixins/_css3.scss
637
637
  - app/assets/stylesheets/govuk_publishing_components/components/mixins/_govuk-template-link-focus-override.scss
638
+ - app/assets/stylesheets/govuk_publishing_components/components/mixins/_grid-helper.scss
638
639
  - app/assets/stylesheets/govuk_publishing_components/components/mixins/_margins.scss
639
640
  - app/assets/stylesheets/govuk_publishing_components/components/mixins/_media-down.scss
640
641
  - app/assets/stylesheets/govuk_publishing_components/components/mixins/_prefixed-transform.scss