All Struts modules are compatible with a multi language project. JFW offers a little more to make
the use of the various locales simpler in actions .
The method used for managing the locales is
initLocale.
This method sets the locale based on this logic:
If a parameter with name LOCALE_KEY exists in request then
the value of this parameter is used to set the locale. The value
of the parameters is a language as defined here (ISO 639-1).
If exists in session, an attribute under key LOCALE_KEY then the locale is already set
and nothing more must be done.
If cookie jfw_locale exists in request then the value in
the cookie is used.
If key default_language is defined in jfw.properties then
this value is used. To get the default application locale, the method getLocale
of class com.jfw.util.JFWLocale is used.
If all other methods failed, the getLocale method of Struts is called.
The first successful step of the previous steps sets the locale and stops the process.
Setting the locale is a multistep process: