Spring WebFlux Rest API internationalization i18n

Eric Anicet
4 min readApr 17, 2023

The purpose of this story is to explain how to configure and handles internationalization in a Spring WebFlux Rest API.

Photo by Lucas George Wendt on Unsplash

· Prerequisites
· Overview
· What is Internationalization?
· Getting Started
MessageSource Bean
Custom class for LocaleContextResolver
MessageTranslator class
Translation files
· Testing
· Conclusion
· References

Prerequisites

This is the list of all the prerequisites for following this story:

  • Java 17
  • Spring Boot / Starter WebFlux 3.0.5
  • Maven 3.6.3
  • Postman

Overview

When you produce public APIs, you don’t know which clients will consume your services, so it’s important to standardize your API’s return messages so you can communicate effectively with your consumers.

The Java Platform provides a rich set of APIs for developing global applications. These internationalization APIs are based on the Unicode standard and include the ability to…

--

--