Q:

Multiple locales / bundles in one view

We have a UI in JSF 2.0 that is divided in two parts: one is in the user locale, and the other in a chosen locale. By example, if the user is a french guy who decides to choose english, some components of the page are in french, some others are in english.
Is it possible to achieve this?
The simple f:loadBundle doesn't accept any locale and use the one defined in its parent f:view, so it seems we can only define one locale per view.
Maybe we can use multiple f:view? We tried a bit and the server didn't complain that much, but the JavaDoc says that f:view is "Container for all JavaServer Faces core and custom component actions used on a page", so I don't guess it should be safe to do it that way.

A:

That's not possible through the <f:loadBundle> means. You can indeed have only one locale throughout the entire view and it's not allowed to nest <f:view> tags (technically it will work, but the nested tag will just be ignored). 
Your best bet is to create a managed bean which extends ResourceBundle, wraps the bundle in the desired locale and delegates the calls to it. Something like this:
@ManagedBean
@RequestScoped
public class BundleBean extends ResourceBundle {

    private ResourceBundle wrapped;

    public BundleBean() {
        // You can get/supply the locale as a parameter or property.
        // Again, just a basic kickoff example.
        wrapped = ResourceBundle.getBundle("com.example.i18n.text", new Locale("fr"));
    }

    @Override
    protected Object handleGetObject(String key) {
        return wrapped.getObject(key);
    }

    @Override
    public Enumeration<String> getKeys() {
        return wrapped.getKeys();
    }

}

You can use it the usual way:
#{bundleBean.someKey}
#{bundleBean['some.key.with.periods']}

