April 2018
Intermediate to advanced
202 pages
4h 48m
English
Vaadin automatically sets the Locale reported by the browser. You can get this Locale by calling the UI::getLocale() method and the UI::setLocale(Locale) method to set the Locale for the current user. The example application in this chapter uses the locale reported by the browser. There's no need do anything else except add the resource bundle using the helper Messages class. The example application does this in a static block in the UI implementation (the VaadinUI class):
static {
Messages.addBundle("messages");
}
In more complex scenarios, you should use an event listener such as ServletContextListener to add the resource bundle when the context starts, for example.
Read now
Unlock full access