myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stojan Peshov" <goodusern...@gmail.com>
Subject Re: [Tobago] How to substitute into the Tobago resource bundle messages?
Date Wed, 12 Mar 2008 08:14:43 GMT
Or, you could always rely on the getter like this:

public String getLocalizedTitle(){
            Locale locale = FacesContext.getCurrentInstance
().getViewRoot().getLocale();
            MessageFormat detail = new MessageFormat(title, locale);
            Object[] args = {getLoggedUserName()};
            return detail.format(args);
}

I use this in my applications

Regards,
Stojan


On Tue, Mar 11, 2008 at 11:59 PM, Volker Weber <v.weber@inexso.de> wrote:

> Hi Tim,
> You could create very complex value bindings :-)
> We have something like this, and more complex ones in one app:
> value="#{bundle.editUser}#{empty controller.user ? '' : ' ( '}#{empty
> controller.user ? '' : controller.user.name}#{empty controller.user ?
> '' : ' ) '}"
>
> But i like the idea of formating such values/labels with MessageFormat
> and params.
>
> Regards,
>
>  Volker
>

Mime
View raw message