govuk_publishing_components 57.1.0 → 57.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/images/govuk_publishing_components/intervention/hmrc.svg +5 -0
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-core.js +4 -0
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-event-tracker.js +22 -0
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-form-tracker.js +72 -12
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-specialist-link-tracker.js +2 -2
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/pii-remover.js +10 -0
- data/app/assets/javascripts/govuk_publishing_components/components/add-another.js +57 -7
- data/app/assets/javascripts/govuk_publishing_components/components/reorderable-list.js +24 -4
- data/app/assets/stylesheets/govuk_publishing_components/components/_intervention.scss +17 -0
- data/app/controllers/govuk_publishing_components/audit_controller.rb +0 -1
- data/app/models/govuk_publishing_components/audit_comparer.rb +0 -1
- data/app/views/govuk_publishing_components/components/_add_another.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_intervention.html.erb +7 -2
- data/app/views/govuk_publishing_components/components/_reorderable_list.html.erb +24 -2
- data/app/views/govuk_publishing_components/components/_select.html.erb +6 -2
- data/app/views/govuk_publishing_components/components/docs/add_another.yml +25 -0
- data/app/views/govuk_publishing_components/components/docs/intervention.yml +10 -0
- data/app/views/govuk_publishing_components/components/docs/reorderable_list.yml +16 -0
- data/app/views/govuk_publishing_components/components/docs/select.yml +25 -0
- data/config/locales/ar.yml +12 -3
- data/config/locales/az.yml +12 -3
- data/config/locales/be.yml +12 -3
- data/config/locales/bg.yml +12 -3
- data/config/locales/bn.yml +12 -3
- data/config/locales/cs.yml +12 -3
- data/config/locales/cy.yml +14 -5
- data/config/locales/da.yml +12 -3
- data/config/locales/de.yml +12 -3
- data/config/locales/dr.yml +12 -3
- data/config/locales/el.yml +12 -3
- data/config/locales/en.yml +16 -7
- data/config/locales/es-419.yml +12 -3
- data/config/locales/es.yml +12 -3
- data/config/locales/et.yml +12 -3
- data/config/locales/fa.yml +12 -3
- data/config/locales/fi.yml +12 -3
- data/config/locales/fr.yml +12 -3
- data/config/locales/gd.yml +12 -3
- data/config/locales/gu.yml +12 -3
- data/config/locales/he.yml +12 -3
- data/config/locales/hi.yml +12 -3
- data/config/locales/hr.yml +12 -3
- data/config/locales/hu.yml +12 -3
- data/config/locales/hy.yml +12 -3
- data/config/locales/id.yml +12 -3
- data/config/locales/is.yml +12 -3
- data/config/locales/it.yml +12 -3
- data/config/locales/ja.yml +12 -3
- data/config/locales/ka.yml +12 -3
- data/config/locales/kk.yml +12 -3
- data/config/locales/ko.yml +12 -3
- data/config/locales/lt.yml +12 -3
- data/config/locales/lv.yml +12 -3
- data/config/locales/ms.yml +12 -3
- data/config/locales/mt.yml +12 -3
- data/config/locales/ne.yml +12 -6
- data/config/locales/nl.yml +12 -3
- data/config/locales/no.yml +12 -3
- data/config/locales/pa-pk.yml +12 -3
- data/config/locales/pa.yml +12 -3
- data/config/locales/pl.yml +12 -3
- data/config/locales/ps.yml +12 -3
- data/config/locales/pt.yml +12 -3
- data/config/locales/ro.yml +12 -3
- data/config/locales/ru.yml +12 -3
- data/config/locales/si.yml +12 -3
- data/config/locales/sk.yml +12 -3
- data/config/locales/sl.yml +12 -3
- data/config/locales/so.yml +12 -3
- data/config/locales/sq.yml +12 -3
- data/config/locales/sr.yml +12 -3
- data/config/locales/sv.yml +12 -3
- data/config/locales/sw.yml +12 -3
- data/config/locales/ta.yml +12 -3
- data/config/locales/th.yml +12 -3
- data/config/locales/tk.yml +12 -3
- data/config/locales/tr.yml +12 -3
- data/config/locales/uk.yml +12 -3
- data/config/locales/ur.yml +12 -3
- data/config/locales/uz.yml +12 -3
- data/config/locales/vi.yml +12 -3
- data/config/locales/zh-hk.yml +12 -3
- data/config/locales/zh-tw.yml +12 -3
- data/config/locales/zh.yml +12 -3
- data/lib/govuk_publishing_components/presenters/devolved_nations_helper.rb +14 -13
- data/lib/govuk_publishing_components/presenters/select_helper.rb +5 -3
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +2 -1
data/config/locales/zh.yml
CHANGED
@@ -58,18 +58,27 @@ zh:
|
|
58
58
|
devolved_nations:
|
59
59
|
applies_to:
|
60
60
|
aria_label:
|
61
|
-
connectors:
|
62
|
-
last_word:
|
63
|
-
two_words:
|
64
61
|
england:
|
62
|
+
end:
|
63
|
+
middle:
|
64
|
+
start:
|
65
65
|
northern_ireland:
|
66
|
+
end:
|
67
|
+
middle:
|
68
|
+
start:
|
66
69
|
scotland:
|
70
|
+
end:
|
71
|
+
middle:
|
72
|
+
start:
|
67
73
|
type:
|
68
74
|
consultation:
|
69
75
|
detailed_guide:
|
70
76
|
guidance:
|
71
77
|
publication:
|
72
78
|
wales:
|
79
|
+
end:
|
80
|
+
middle:
|
81
|
+
start:
|
73
82
|
feedback:
|
74
83
|
close: 关闭
|
75
84
|
dont_include_personal_info: 不要包含个人或财务信息,比如您的国家保险号或信用卡信息。
|
@@ -9,20 +9,21 @@ module GovukPublishingComponents
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def applicable_nations_title_text(use_english_translation = nil)
|
12
|
-
@national_applicability
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
.to_sentence(
|
17
|
-
two_words_connector: get_translation("components.devolved_nations.connectors.two_words", use_english_translation),
|
18
|
-
last_word_connector: get_translation("components.devolved_nations.connectors.last_word", use_english_translation),
|
19
|
-
)
|
12
|
+
nation_keys = @national_applicability
|
13
|
+
.select { |_, v| v[:applicable] == true }
|
14
|
+
.map { |k, _| k }
|
15
|
+
nation_keys.each_with_index.map { |k, i| name_for_position(k, i, nation_keys.count, use_english_translation) }.join
|
20
16
|
end
|
21
17
|
|
22
|
-
def
|
23
|
-
|
24
|
-
|
25
|
-
|
18
|
+
def name_for_position(nation, position, total, use_english_translation)
|
19
|
+
key = if position.zero?
|
20
|
+
:start
|
21
|
+
elsif position == (total - 1)
|
22
|
+
:end
|
23
|
+
else
|
24
|
+
:middle
|
25
|
+
end
|
26
|
+
I18n.t("components.devolved_nations.#{nation}.#{key}", locale: use_english_translation ? :en : nil)
|
26
27
|
end
|
27
28
|
|
28
29
|
def ga4_applicable_nations_title_text(remove_connector_word = nil)
|
@@ -40,7 +41,7 @@ module GovukPublishingComponents
|
|
40
41
|
end
|
41
42
|
|
42
43
|
def alternative_content_text(name)
|
43
|
-
nation = I18n.t("components.devolved_nations.#{name}")
|
44
|
+
nation = I18n.t("components.devolved_nations.#{name}.start")
|
44
45
|
|
45
46
|
if I18n.exists?("components.devolved_nations.type.#{@content_type}")
|
46
47
|
I18n.t("components.devolved_nations.type.#{@content_type}", nation:)
|
@@ -44,13 +44,15 @@ module GovukPublishingComponents
|
|
44
44
|
[
|
45
45
|
option[:text],
|
46
46
|
option[:value],
|
47
|
-
|
47
|
+
options_extra_attributes(option[:data_attributes], option[:disabled]),
|
48
48
|
]
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
|
-
def
|
53
|
-
|
52
|
+
def options_extra_attributes(attributes, disabled)
|
53
|
+
attrs = {}
|
54
|
+
attrs[:disabled] = true if disabled
|
55
|
+
return attrs if attributes.nil?
|
54
56
|
|
55
57
|
attrs = {}
|
56
58
|
attributes.each do |key, value|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: govuk_publishing_components
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 57.
|
4
|
+
version: 57.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GOV.UK Dev
|
@@ -437,6 +437,7 @@ files:
|
|
437
437
|
- app/assets/images/govuk_publishing_components/image-card-srcset/cop26-320.jpg
|
438
438
|
- app/assets/images/govuk_publishing_components/image-card-srcset/cop26-480.jpg
|
439
439
|
- app/assets/images/govuk_publishing_components/image-card-srcset/cop26.jpg
|
440
|
+
- app/assets/images/govuk_publishing_components/intervention/hmrc.svg
|
440
441
|
- app/assets/images/govuk_publishing_components/take-action-amber.svg
|
441
442
|
- app/assets/images/govuk_publishing_components/take-action-green.svg
|
442
443
|
- app/assets/images/govuk_publishing_components/take-action-red.svg
|