Translate an error message

This commit is contained in:
Greg Burri 2025-04-30 19:29:35 +02:00
parent 2b7e88ae95
commit 3bc17cea79
6 changed files with 18 additions and 7 deletions

View file

@ -10,11 +10,11 @@ use serde::Deserialize;
use crate::{
app::{AppState, Context, Result},
consts,
data::db,
html_templates::*,
log::Log,
ron_utils,
translation::Sentence,
};
pub mod fragments;
@ -98,7 +98,10 @@ pub async fn dev_panel(
} else {
Ok((
StatusCode::UNAUTHORIZED,
Html(MessageTemplate::new(consts::NOT_AUTHORIZED_MESSAGE, context).render()?),
Html(
MessageTemplate::new(context.tr.t(Sentence::ActionNotAuthorized), context)
.render()?,
),
)
.into_response())
}
@ -145,7 +148,10 @@ pub async fn logs(
} else {
Ok((
StatusCode::UNAUTHORIZED,
Html(MessageTemplate::new(consts::NOT_AUTHORIZED_MESSAGE, context).render()?),
Html(
MessageTemplate::new(context.tr.t(Sentence::ActionNotAuthorized), context)
.render()?,
),
)
.into_response())
}