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