International resources

In my international resources, the code

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

In my java

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

The expected value of messageContent should look like this:

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

But the actual value of messageContent looks like this:

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

Why?

+6
source share
2 answers

In international resources, the code should look like this:

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

You must use ActionSupport:

public String getText (String aTextName, Argument List)

In your actions, assuming it is being distributed from ActionSupport, replace it with the following:

 String messageContent = getText(messageType, paramValues); 
0
source

Source: https://habr.com/ru/post/956210/


All Articles