浏览代码

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 年之前
父节点
当前提交
de38826897
共有 1 个文件被更改,包括 1 次插入1 次删除
  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);
         }