You've already forked authentication-service
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:
@@ -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" }
|
||||
|
@@ -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()
|
||||
|
Reference in New Issue
Block a user