Spring Boot supports Internationalization (i18n) by allowing applications to display messages in multiple languages based on the user's locale or language preference. It uses locale-specific resource files and automatically resolves the appropriate language at runtime.
Consider an e-commerce application used by customers in different countries.
Welcome to our application
Bienvenue dans notre application
Willkommen in unserer Anwendung
The application displays messages according to the user's selected language without changing the application code.
messages.properties
welcome.message=Welcome to our application
messages_fr.properties
welcome.message=Bienvenue dans notre application
messages_de.properties
welcome.message=Willkommen in unserer Anwendung@Autowired
private MessageSource messageSource;String message = messageSource.getMessage(
"welcome.message",
null,
Locale.FRANCE);1. MessageSource
2. LocaleResolver
3. LocaleChangeInterceptor
http://localhost:8080/home?lang=fr
This changes the application language to French.
@Bean
public LocaleResolver localeResolver() {
SessionLocaleResolver resolver =
new SessionLocaleResolver();
resolver.setDefaultLocale(
Locale.ENGLISH);
return resolver;
}Spring Boot automatically loads the correct file based on the user's locale.
in their preferred language.
A concise interview answer is: Spring Boot supports internationalization using locale-specific message property files, MessageSource for loading messages, and LocaleResolver for determining the user's language preference. Based on the user's locale, Spring Boot automatically displays messages in the appropriate language, making applications suitable for global users.
Last updated: 11 November 2026
Previous question: Can we create a non-web application in Spring Boot?
Next question: What is Spring Boot DevTools used for?