Browse Source

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"
lol768 10 years ago
parent
commit
de38826897
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/main/java/com/gmail/nossr50/locale/LocaleLoader.java

+ 1 - 1
src/main/java/com/gmail/nossr50/locale/LocaleLoader.java

@@ -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);
         }