1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-08-07 17:03:01 +03:00

handlers/templates: infer the language from the Accept-Language browser header

This commit is contained in:
Quentin Gliech
2023-10-04 18:13:57 +02:00
parent 873651a780
commit 1feafc1d13
25 changed files with 253 additions and 76 deletions

View File

@@ -53,6 +53,7 @@ mas-email = { path = "../email" }
mas-graphql = { path = "../graphql" }
mas-handlers = { path = "../handlers", default-features = false }
mas-http = { path = "../http", default-features = false, features = ["axum", "client"] }
mas-i18n = { path = "../i18n" }
mas-iana = { path = "../iana" }
mas-keystore = { path = "../keystore" }
mas-listener = { path = "../listener" }

View File

@@ -23,6 +23,7 @@ use mas_handlers::{
passwords::PasswordManager, ActivityTracker, BoundActivityTracker, CookieManager, ErrorWrapper,
HttpClientFactory, MatrixHomeserver, MetadataCache, SiteConfig,
};
use mas_i18n::Translator;
use mas_keystore::{Encrypter, Keystore};
use mas_policy::{Policy, PolicyFactory};
use mas_router::UrlBuilder;
@@ -152,6 +153,12 @@ impl FromRef<AppState> for Templates {
}
}
impl FromRef<AppState> for Arc<Translator> {
fn from_ref(input: &AppState) -> Self {
input.templates.translator()
}
}
impl FromRef<AppState> for Keystore {
fn from_ref(input: &AppState) -> Self {
input.key_store.clone()