Add uk time to english messages
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
messages:
|
||||
next_appointment: "Next meeting: %{weekday}, %{date}"
|
||||
appointment_today: "Next meeting is today at %{start_time}"
|
||||
next_appointment: "Next meeting: %{weekday}, %{date} (%{uk_time} UK time)"
|
||||
appointment_today: "Next meeting is today at %{start_time} (%{uk_time} UK time)"
|
||||
starting_now: "The meeting starts now"
|
||||
|
||||
@@ -169,6 +169,11 @@ pub async fn fetch_and_announce_appointment(
|
||||
.with_timezone(&Europe::Berlin)
|
||||
.format("%d.%m.%Y %H:%M");
|
||||
|
||||
let uk_time_str = appointment
|
||||
.start
|
||||
.with_timezone(&Europe::London)
|
||||
.format("%H:%M");
|
||||
|
||||
let weekday = match chat_info.locale.as_str() {
|
||||
"de" => match appointment.start.weekday() {
|
||||
chrono::Weekday::Mon => "Montag",
|
||||
@@ -194,7 +199,8 @@ pub async fn fetch_and_announce_appointment(
|
||||
"messages.next_appointment",
|
||||
locale = &chat_info.locale,
|
||||
weekday = &weekday,
|
||||
date = &date_str.to_string()
|
||||
date = &date_str.to_string(),
|
||||
uk_time = &uk_time_str.to_string()
|
||||
),
|
||||
)
|
||||
.await?;
|
||||
|
||||
@@ -167,7 +167,12 @@ async fn check_task(bot: &Throttle<Bot>, reminder_time: NaiveTime, db: &Database
|
||||
text: t!(
|
||||
"messages.appointment_today",
|
||||
locale = &chat_info.locale,
|
||||
start_time = &appointment.start.format("%H:%M").to_string()
|
||||
start_time = &appointment.start.format("%H:%M").to_string(),
|
||||
uk_time = &appointment
|
||||
.start
|
||||
.with_timezone(&Europe::London)
|
||||
.format("%H:%M")
|
||||
.to_string()
|
||||
),
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user