hellofile_zh_CN.properties
hello=\u4F60\u597D \: {0}
Test2.java
package com.test.i18n;
import java.text.MessageFormat;
import java.util.Locale;
import java.util.ResourceBundle;
public class Test2 {
public static void main(String[] args) {
Locale locale = Locale.getDefault();
ResourceBundle bundle = ResourceBundle.getBundle("hellofile", locale);
String value = bundle.getString("hello");
String result = MessageFormat.format(value, new String[] { "世界" });
System.out.println(result);
}
}