6

私の国際的なリソースでは、コードは

:

post_badge_format = You've earned the "{0}" badge for {1}.

私のJavaで

コード:

String messageContent = MessageFormat.format(messageType, paramValues);

messageContent の期待値は次のようになります。

You've earned the "XXX" badge for XXX.

しかし、messageContent の実際の値は次のようになります。

You've earned the "{0}" badge for {1}.

なんで?

4

2 に答える 2

0

ActionSupport を使用する必要があります。

public String getText(String aTextName, List args)

ActionSupport から拡張されていると仮定したアクションで、これを次のように置き換えます。

String messageContent = getText(messageType, paramValues);
于 2013-10-18T14:12:13.170 に答える