This example application demonstrates implementing internationalization and localization in a Vaadin Spring Boot project. Locales supported are English, Finnish and French.
Among the classes under the com.vaadin.example package
Application.javais responsible for running the applicationGreetService.javasupplies localized greetingsMainView.javais the main view, and an entry point for the applicationServiceInitListener.javacustomises start-up process by setting a locale for the applicationSimpleI18NProvider.javais a simple implementation of aI18NProvider
Resource bundles with the name labelsbundle, which contain the actual translations, are located under the /resources folder.
Import the project to the IDE of your choosing as a Maven project.
Run the application using mvn spring-boot:run or by running the Application class directly from your IDE.
Open http://localhost:8080/ in your browser.
If you want to run the application locally in the production mode, run mvn spring-boot:run -Pproduction.
- A tutorial on I18N localization at official docs I18N localization
- A tutorial on internationalization in Vaadin Flow Internationalization in Vaadin Flow