spring-framework / org.springframework.web.server.i18n / FixedLocaleContextResolver

FixedLocaleContextResolver

open class FixedLocaleContextResolver : LocaleContextResolver

LocaleContextResolver implementation that always returns a fixed default locale and optionally time zone. Default is the current JVM's default locale.

Note: Does not support setLocale(Context), as the fixed locale and time zone cannot be changed.

Author
Sebastien Deleuze

Since
5.0

Constructors

<init>

FixedLocaleContextResolver()

Create a default FixedLocaleResolver, exposing a configured default locale (or the JVM's default locale as fallback).

FixedLocaleContextResolver(locale: Locale)

Create a FixedLocaleResolver that exposes the given locale.

FixedLocaleContextResolver(locale: Locale, timeZone: TimeZone)

Create a FixedLocaleResolver that exposes the given locale and time zone.

Functions

resolveLocaleContext

open fun resolveLocaleContext(exchange: ServerWebExchange): LocaleContext

setLocaleContext

open fun setLocaleContext(exchange: ServerWebExchange, localeContext: LocaleContext): Unit