Servlet Internationalization (i18n)

It means we are enabling a web site to provide content translated into the different language or nationality.

To implement internationalization we need to create property file with name for example: msg_en_US for English

We can load particular resource(msg.properties) file as follows:

ResourceBundle bundle = ResourceBundle.getBundle("msg", locale);

Locale specify the language. We can get locale as:

Locale locale = request.getLocale();

And after loading the bundle we can use below code to get values:

out.println("Name: " + bundle.getString("lbl_name"));