Skip to content

Commit bb026aa

Browse files
author
Sivvoy
authored
Merge pull request #1035 from hmcts/feature/rst-1884-welsh
Add Welsh to maintenance notice
2 parents 67e1a4d + e5f9edc commit bb026aa

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
module MaintenanceNoticeHelper
22
def maintenance_notice
3-
(start_time, end_time) = ENV['SHOW_DOWNTIME_BANNER'].split(',').
4-
map { |d| Time.zone.parse(d.strip).strftime("%l%P") }
3+
(start_time, end_time) = ENV['SHOW_DOWNTIME_BANNER'].split(',').map do |d|
4+
Time.zone.parse(d.strip).strftime("%l%P")
5+
end
56

6-
day = Time.zone.parse(ENV['SHOW_DOWNTIME_BANNER'].split(',').last.strip).strftime("%e %B %Y")
7+
day = I18n.localize(Time.zone.parse(ENV['SHOW_DOWNTIME_BANNER'].split(',').last.strip), format: "%e %B %Y")
78

8-
"We're planning maintenance of this service. It will be unavailable from #{start_time} to #{end_time} on #{day}."
9+
t('maintenance.notice_string', start_time: start_time, end_time: end_time, day: day)
910
end
1011

1112
end

config/locales/cy/cy.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ cy:
2424
language: English
2525
locale: en
2626

27+
maintenance:
28+
notice_string: Ni fydd y gwasanaeth hwn ar gael o %{start_time} tan %{end_time} ar %{day}.
29+
2730
number:
2831
currency:
2932
format:
@@ -958,3 +961,5 @@ cy:
958961
address_post_code:
959962
blank: Rhowch god post yr atebydd ychwanegol
960963
invalid: "Rhowch god post DU dilys. Os ydych chi'n byw dramor, rhowch SW55 9QT"
964+
date:
965+
month_names: [~, Ionawr, Chwefror, Mawrth, Ebrill, Mai, Mehefin, Gorffennaf, Awst, Medi, Hydref, Tachwedd, Rhagfyr]

config/locales/en/en.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ en:
3434
language: Cymraeg
3535
locale: cy
3636

37+
maintenance:
38+
notice_string: We're planning maintenance of this service. It will be unavailable from %{start_time} to %{end_time} on %{day}.
39+
3740
number:
3841
currency:
3942
format:

0 commit comments

Comments
 (0)