2013-10-18 10 views
6

、コードが国際資源私の国際的な資源で

です:messageContentの期待値がこれを好きなはずです

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

You've earned the "XXX" badge for XXX. 
私のjava

コードで

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

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

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

なぜですか?

+1

デバッグしようとしましたか? 'paramValues'は正しいですか? – Henry

答えて

3

、コードはこれを好む必要があります。

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

あなたはActionSupport使用する必要があります。それはこれでそれを置き換えるActionSupportから延びていると仮定すると、あなたのアクションで

public String getText(String aTextName, List args)

を:国際資源で

String messageContent = getText(messageType, paramValues);