Enum internationalization exception
<p>I have an enum and I tried to internationalize it like:</p>

<pre><code>public enum ActivityEnum {
PROJECT_CREATED, PROJECT_EDITED, PROJECT_DONATION;

@Override
public String toString() {
    switch (this) {
    case PROJECT_CREATED:
        return Messages.get("activity.project.created");
    case PROJECT_EDITED:
        return Messages.get("activity.project.edited");
    case PROJECT_DONATION:
        return Messages.get("activity.project.donation");
        default: return super.toString();
    }
}

private ActivityEnum activityEnum;

public ActivityEnum getActivityEnum() {
    return activityEnum;
}

public void setActivityEnum(ActivityEnum activityEnum) {
    this.activityEnum = activityEnum;
}
</code></pre>

<p>}</p>

<p>Now, please note that the keys defined in my messages.properties contains string formatters like:</p>

<pre><code>activity.project.created = User &lt;%s&gt; created project &lt;%s&gt;
</code></pre>

<p>Well, the issue is that when I do something with this enum in other places in the code, it throws an exception like:</p>

<pre><code>MissingFormatArgumentException occured : Format specifier 's'
</code></pre>

<p>so basically it wants that when I get the key in <code>toString</code> enum class, to apply also the args for formatting but this I only do later where I use that enum...</p>

<pre><code>activity.summary = String.format(activityEnum.toString(), args);
</code></pre>

<p>Can you please give me a suggestion of how to handle this?</p>

<p><strong>UPDATE</strong>:</p>

<p>If I use the classic way, all works nice:</p>

<pre><code>PROJECT_CREATED("User &lt;%s&gt; created project &lt;%s&gt;"), PROJECT_EDITED(
        "User &lt;%s&gt; edited project &lt;%s&gt;"), PROJECT_DONATION(
        "User &lt;%s&gt; made a donation of &lt;%d&gt; to project &lt;%s&gt;");
</code></pre>

<p>but this is without internationalization.</p>
