class WebFluxLocaleFilter implements WebFilter {
    @Override
    @NonNull
    public Mono<Void> filter(@NonNull ServerWebExchange exchange, WebFilterChain chain) {
        return chain
                .filter(exchange)
                .as(LocaleUtils::transform)
                .contextWrite(LocaleUtils.useLocale(getLocaleContext(exchange)));
    }

    public Locale getLocaleContext(ServerWebExchange exchange) {<FILL_FUNCTION_BODY>}
}

        String lang = exchange.getRequest()
                              .getQueryParams()
                              .getFirst(":lang");
        if (StringUtils.hasText(lang)) {
            return Locale.forLanguageTag(lang);
        }
        Locale locale = exchange.getLocaleContext().getLocale();
        if (locale == null) {
            return Locale.getDefault();
        }
        return locale;
    
<no_super_class>