There is quit non-trivial menu on UI.
Its items named in loop this way:
loop start
<li>
<h:commandLink action="#{menuItem.getGlobalTransitionName()}">#{resourceBundle.getMessage(menuItem.id,null,menuItem.id,null)}
</h:commandLink>
</li>
loop end
call to resourceBundle performed above,where default locale is set – it’s hardcoded to null value,so resolved to En always:
#{resourceBundle.getMessage(menuItem.id,null,menuItem.id,null)}
What I’ve tried:
1. this invokes parsing error:
#{resourceBundle.getMessage(menuItem.id,null,menuItem.id,${externalContext.locale})}
2. this invokes error as well:
#{resourceBundle.getMessage(menuItem.id,null,menuItem.id,#{resourceBundle.locale})}
how can I pass really used locale there?
Nesting EL expressions is indeed invalid. Don’t do that. Plus,
ExternalContextdoesn’t have agetLocale()method. You want to use#{facesContext.viewRoot.locale}instead.