Skip to content

Commit

Permalink
Merge pull request #1035 from hmcts/feature/rst-1884-welsh
Browse files Browse the repository at this point in the history
Add Welsh to maintenance notice
  • Loading branch information
Sivvoy committed May 13, 2019
2 parents 67e1a4d + e5f9edc commit bb026aa
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/helpers/maintenance_notice_helper.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
module MaintenanceNoticeHelper
def maintenance_notice
(start_time, end_time) = ENV['SHOW_DOWNTIME_BANNER'].split(',').
map { |d| Time.zone.parse(d.strip).strftime("%l%P") }
(start_time, end_time) = ENV['SHOW_DOWNTIME_BANNER'].split(',').map do |d|
Time.zone.parse(d.strip).strftime("%l%P")
end

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

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

end
5 changes: 5 additions & 0 deletions config/locales/cy/cy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ cy:
language: English
locale: en

maintenance:
notice_string: Ni fydd y gwasanaeth hwn ar gael o %{start_time} tan %{end_time} ar %{day}.

number:
currency:
format:
Expand Down Expand Up @@ -958,3 +961,5 @@ cy:
address_post_code:
blank: Rhowch god post yr atebydd ychwanegol
invalid: "Rhowch god post DU dilys. Os ydych chi'n byw dramor, rhowch SW55 9QT"
date:
month_names: [~, Ionawr, Chwefror, Mawrth, Ebrill, Mai, Mehefin, Gorffennaf, Awst, Medi, Hydref, Tachwedd, Rhagfyr]
3 changes: 3 additions & 0 deletions config/locales/en/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ en:
language: Cymraeg
locale: cy

maintenance:
notice_string: We're planning maintenance of this service. It will be unavailable from %{start_time} to %{end_time} on %{day}.

number:
currency:
format:
Expand Down

0 comments on commit bb026aa

Please sign in to comment.