That's extremely wrong. There shouldn't be any code
looking at "requestLocale". File an issue and I'll fix the code ASAP.
-- Adam
On 8/18/07, Luka Surija <[EMAIL PROTECTED]> wrote:
> Can someone explain me why MenuModel isn't working with locale as any
> other JSF component?
>
> code snippet from org.apache.myfaces.trinidadinternal.menu.MenuUtils:
> ...
> static void loadBundle(String resBundle, ThreadLocal<String> key)
> {
> FacesContext facesContext = FacesContext.getCurrentInstance();
> Map<String, Object> applicationMap =
> facesContext.getExternalContext().getApplicationMap();
>
> // Get the request Locale
> Locale requestLocale =
> facesContext.getExternalContext().getRequestLocale();
>
> // Make sure it is not null
> if (requestLocale == null)
> {
> requestLocale = facesContext.getViewRoot().getLocale();
> if (requestLocale == null)
> {
> requestLocale = facesContext.getApplication().getDefaultLocale();
> }
> }
>
> ....
>
> I've almost gone crazy because of that until I've checked how
> resourceBundle is managed for MenuModel.
>
> Usually <f:view locale="#{main.locale}" >
> should be the first place where to put locale to some page (view), and
> all components inside this view should use locale from resourceBundle
> defined by getViewRoot().getLocale(). So my question is why MenuModel
> uses different approach?
>
>
>
>
> --
> Luka Ĺ urija
> [EMAIL PROTECTED]
> +385 98 434 061
>
> I.Y. tim d.o.o.
> www.iytim.hr
> [EMAIL PROTECTED]
>
>
>