1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-08-09 04:22:45 +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

@@ -33,6 +33,7 @@ use hyper::{
use mas_axum_utils::{
cookies::CookieManager, http_client_factory::HttpClientFactory, ErrorWrapper,
};
use mas_i18n::Translator;
use mas_keystore::{Encrypter, JsonWebKey, JsonWebKeySet, Keystore, PrivateKey};
use mas_matrix::{HomeserverConnection, MockHomeserverConnection};
use mas_policy::{InstantiateError, Policy, PolicyFactory};
@@ -319,6 +320,12 @@ impl FromRef<TestState> for Templates {
}
}
impl FromRef<TestState> for Arc<Translator> {
fn from_ref(input: &TestState) -> Self {
input.templates.translator()
}
}
impl FromRef<TestState> for Keystore {
fn from_ref(input: &TestState) -> Self {
input.key_store.clone()