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 năm trước cách đây
mục cha
commit
de38826897
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  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);
         }