2
0
Эх сурвалжийг харах

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 жил өмнө
parent
commit
de38826897

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