From 697c2eb44745140f715ee42cc4e3d03618e5d40b Mon Sep 17 00:00:00 2001 From: Brett Heath-Wlaz Date: Fri, 25 Oct 2024 14:50:55 -0400 Subject: [PATCH] fix capitalization of early AM messages (#834) --- lib/content/audio/service_ended.ex | 11 +---------- .../message/early_am/destination_scheduled_time.ex | 3 ++- lib/content/message/early_am/destination_train.ex | 2 +- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/lib/content/audio/service_ended.ex b/lib/content/audio/service_ended.ex index 69ad40f74..a75bc7872 100644 --- a/lib/content/audio/service_ended.ex +++ b/lib/content/audio/service_ended.ex @@ -71,21 +71,12 @@ defmodule Content.Audio.ServiceEnded do defp tts_text(%Content.Audio.ServiceEnded{location: :platform, destination: destination}) do {:ok, destination_string} = Utilities.destination_to_ad_hoc_string(destination) - - service_ended = - "#{destination_string} service has ended for the night." - |> String.trim_leading() - |> String.capitalize() - - "This platform is closed. #{service_ended}" + "This platform is closed. #{destination_string} service has ended for the night." end defp tts_text(%Content.Audio.ServiceEnded{location: :direction, destination: destination}) do {:ok, destination_string} = Utilities.destination_to_ad_hoc_string(destination) - "#{destination_string} service has ended for the night." - |> String.trim_leading() - |> String.capitalize() end end end diff --git a/lib/content/message/early_am/destination_scheduled_time.ex b/lib/content/message/early_am/destination_scheduled_time.ex index dbff8edfd..8955464f6 100644 --- a/lib/content/message/early_am/destination_scheduled_time.ex +++ b/lib/content/message/early_am/destination_scheduled_time.ex @@ -12,7 +12,8 @@ defmodule Content.Message.EarlyAm.DestinationScheduledTime do destination: destination, scheduled_time: scheduled_time }) do - "#{String.capitalize(PaEss.Utilities.destination_to_sign_string(destination))} due #{Content.Utilities.render_datetime_as_time(scheduled_time)}" + destination_string = PaEss.Utilities.destination_to_sign_string(destination) + "#{destination_string} due #{Content.Utilities.render_datetime_as_time(scheduled_time)}" end end end diff --git a/lib/content/message/early_am/destination_train.ex b/lib/content/message/early_am/destination_train.ex index 3ed52f084..c8f350f5a 100644 --- a/lib/content/message/early_am/destination_train.ex +++ b/lib/content/message/early_am/destination_train.ex @@ -8,7 +8,7 @@ defmodule Content.Message.EarlyAm.DestinationTrain do defimpl Content.Message do def to_string(%Content.Message.EarlyAm.DestinationTrain{destination: destination}) do - "#{String.capitalize(PaEss.Utilities.destination_to_sign_string(destination))} train" + "#{PaEss.Utilities.destination_to_sign_string(destination)} train" end end end