Search code examples
internationalizationseamseam2

Use message bundle in Java class with Seam with a parametric proprerty


The same question Use message bundle in Java class with Seam but what when you need use a parametric property like:

message.property = Some message with {0} this parameter.

How should I use the map for doing that?

Thanks.


Solution

  • This was my solution

    @In
    private Map<String, String> messages;
    String property = messages.get("property.key");
    MessageFormat.format(property, params);
    

    Thx https://stackoverflow.com/users/115541/mac.