Internationalization

When we develop applications, we would want them to be usable in multiple locales. You would want the text that is shown to the user to be customized based on the location and language of the user. This is called internationalization. Internationalization, i18n, is also called Localization.

It can be implemented using two approaches:

  • SessionLocaleResolver
  • CookieLocaleResolver

In the case of SessionLocaleResolver, the locale chosen by the user is stored in the user session and, therefore, is valid for the user session only. However, in the case of a CookieLocaleResolver, the locale chosen is stored as a cookie.

Get Mastering Spring 5.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.