Skip to content

Commit

Permalink
fix capitalization of early AM messages (#834)
Browse files Browse the repository at this point in the history
  • Loading branch information
panentheos authored Oct 25, 2024
1 parent a38c463 commit 697c2eb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
11 changes: 1 addition & 10 deletions lib/content/audio/service_ended.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion lib/content/message/early_am/destination_scheduled_time.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion lib/content/message/early_am/destination_train.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 697c2eb

Please sign in to comment.