This is a sample spring-boot project to demonstrate how to support localization for rest API's
Blog post - https://www.rajith.me/2020/10/rest-api-localization-using-spring-boot.html
- Java 8
- Apache Maven 3.5.0 or higher
- Clone the project
- Build the project
mvn clean install
- Run the application
java -jar target/localization-1.0.0-SNAPSHOT.jar
curl -X GET 'http://localhost:8080/api/v1/menu'
["Hot Pot","Sichuan Pork","Braised Pork Balls in Gravy","Shrimp vermicelli"]
curl -X GET -H "Accept-Language: zh" 'http://localhost:8080/api/v1/menu'
["火锅","四川猪肉","肉汁炖猪肉丸","虾粉条"]
For further reference, please consider the following sections:
https://blog.usejournal.com/spring-boot-rest-internationalization-9ab3fce2489