pub trait LocaleResolver: Send + Sync {
// Required method
fn resolve(&self, parts: &Parts) -> Option<String>;
}Expand description
Trait for extracting the active locale from a request.
Implementations are tried in order within the locale chain built by
EngineBuilder::locale_resolvers.
The first resolver that returns Some wins; if all resolvers return None,
TemplateConfig::default_locale is used.
The resolved locale is stored in the request’s TemplateContext
under the key "locale" and is available in every template as {{ locale }}.