Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,31 @@ public TimeZone getTimeZone() {

/**
* Change the current locale to the specified one.
* <p><strong>Note:</strong> Unlike the Spring MVC counterpart, this method only
* updates the locale within the scope of the current {@code RequestContext} instance
* for view rendering purposes. It does <em>not</em> delegate to a
* {@link org.springframework.web.server.i18n.LocaleContextResolver} and the change
* is not persisted beyond the current rendering cycle. For a durable locale change
* across requests in WebFlux, configure a
* {@link org.springframework.web.server.i18n.LocaleContextResolver} and update it
* from a {@link org.springframework.web.server.WebFilter} or handler method instead.
* @param locale the new locale
* @see #changeLocale(java.util.Locale, java.util.TimeZone)
*/
public void changeLocale(Locale locale) {
this.locale = locale;
}

/**
* Change the current locale to the specified locale and time zone context.
* <p><strong>Note:</strong> Unlike the Spring MVC counterpart, this method only
* updates the locale and time zone within the scope of the current
* {@code RequestContext} instance for view rendering purposes. It does <em>not</em>
* delegate to a {@link org.springframework.web.server.i18n.LocaleContextResolver}
* and the change is not persisted beyond the current rendering cycle.
* @param locale the new locale
* @param timeZone the new time zone
* @see #changeLocale(java.util.Locale)
*/
public void changeLocale(Locale locale, TimeZone timeZone) {
this.locale = locale;
Expand Down