Hello,

I have the following in my faces-config.xml file:
<locale-config>
            <default-locale>fr</default-locale>
            <supported-locale>en</supported-locale>
            <supported-locale>fr</supported-locale>
        </locale-config>

and would like the default-locale "fr" to be set once for my application on startup. After that I would like this locale to be forced on all my views like here:

<f:view locale="...">

where ... stands for the unknown way of passing the locale to fview. I know I can set the ViewRoot locale upon the user login like so:  context.getViewRoot().setLocale(userLocale); where userLocale is a persistent property of the given user. However, here two issues remain: 1) how do I pass this information to f:view? 2) it still does not address the subject, because I would like the "fr" locale to be used even if user does not login.

(I know of one way to achieve this - have a backing bean to provide this info. However it means that all of my backing beans have to be locale-aware. Alternatively, I could have a default ("fr") locale backing bean set on the startupt and then use it in all of my pages. Then, how does one initializes this bean based on the information in the faces-config.xml file. That's the question.)

Thanks.

Z

Reply via email to