Escape apostrophes

"The java.text.MessageFormat class uses the apostrophe (\u0027) as an escape character. Consequently, you need to write two consecutive apostrophes in your translation if you wish to display a single apostrophe"
This commit is contained in:
lol768 2015-04-25 22:59:33 +01:00
parent ecfdd75e36
commit de38826897

View File

@ -57,7 +57,7 @@ public final class LocaleLoader {
public static String formatString(String string, Object... messageArguments) {
if (messageArguments != null) {
MessageFormat formatter = new MessageFormat("");
formatter.applyPattern(string);
formatter.applyPattern(string.replace("'", "''"));
string = formatter.format(messageArguments);
}