Index: /trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java	(revision 4169)
+++ /trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java	(revision 4170)
@@ -279,7 +279,7 @@
                 if (text != null) {
                     if(text_context != null) {
-                        locale_text = trc(text_context, text);
+                        locale_text = trc(text_context, text.replaceAll("'","''"));
                     } else {
-                        locale_text = tr(text);
+                        locale_text = tr(text.replaceAll("'","''"));
                     }
                 }
@@ -334,7 +334,7 @@
             if(locale_text == null) {
                 if(text_context != null) {
-                    locale_text = trc(text_context, text);
+                    locale_text = trc(text_context, text.replaceAll("'","''"));
                 } else {
-                    locale_text = tr(text);
+                    locale_text = tr(text.replaceAll("'","''"));
                 }
             }
@@ -467,9 +467,9 @@
                 PresetListEntry e = new PresetListEntry(value_array[i]);
                 e.display_value = (locale_display_values == null)
-                ? (values_context == null ? tr(display_array[i])
-                        : trc(values_context, display_array[i])) : display_array[i];
+                ? (values_context == null ? tr(display_array[i].replaceAll("'","''"))
+                        : trc(values_context, display_array[i].replaceAll("'","''"))) : display_array[i];
                 if (short_descriptions_array != null) {
-                    e.short_description = locale_short_descriptions == null ? tr(short_descriptions_array[i])
-                            : short_descriptions_array[i];
+                    e.short_description = locale_short_descriptions == null ? tr(short_descriptions_array[i].replaceAll("'","''"))
+                            : short_descriptions_array[i].replaceAll("'","''");
                 }
                 lhm.put(value_array[i], e);
@@ -524,7 +524,7 @@
             if(locale_text == null) {
                 if(text_context != null) {
-                    locale_text = trc(text_context, text);
+                    locale_text = trc(text_context, text.replaceAll("'","''"));
                 } else {
-                    locale_text = tr(text);
+                    locale_text = tr(text.replaceAll("'","''"));
                 }
             }
@@ -743,8 +743,8 @@
                 PresetListEntry e = new PresetListEntry(value_array[i]);
                 e.display_value = (locale_display_values == null)
-                ? (values_context == null ? tr(display_array[i])
-                        : trc(values_context, display_array[i])) : display_array[i];
+                ? (values_context == null ? tr(display_array[i].replaceAll("'","''"))
+                        : trc(values_context, display_array[i].replaceAll("'","''"))) : display_array[i];
                 if (short_descriptions_array != null) {
-                    e.short_description = locale_short_descriptions == null ? tr(short_descriptions_array[i])
+                    e.short_description = locale_short_descriptions == null ? tr(short_descriptions_array[i].replaceAll("'","''"))
                             : short_descriptions_array[i];
                 }
@@ -772,7 +772,7 @@
             if (locale_text == null) {
                 if(text_context != null) {
-                    locale_text = trc(text_context, text);
+                    locale_text = trc(text_context, text.replaceAll("'","''"));
                 } else {
-                    locale_text = tr(text);
+                    locale_text = tr(text.replaceAll("'","''"));
                 }
             }
@@ -914,7 +914,7 @@
             if(locale_text == null) {
                 if(text_context != null) {
-                    locale_text = trc(text_context, text);
+                    locale_text = trc(text_context, text.replaceAll("'","''"));
                 } else {
-                    locale_text = tr(text);
+                    locale_text = tr(text.replaceAll("'","''"));
                 }
             }
@@ -937,7 +937,7 @@
                     locale_text = tr("More information about this feature");
                 } else if(text_context != null) {
-                    locale_text = trc(text_context, text);
+                    locale_text = trc(text_context, text.replaceAll("'","''"));
                 } else {
-                    locale_text = tr(text);
+                    locale_text = tr(text.replaceAll("'","''"));
                 }
             }
@@ -1002,7 +1002,7 @@
                 if (text != null) {
                     if(text_context != null) {
-                        locale_text = trc(text_context, text);
+                        locale_text = trc(text_context, text.replaceAll("'","''"));
                     } else {
-                        locale_text = tr(text);
+                        locale_text = tr(text.replaceAll("'","''"));
                     }
                 }
@@ -1103,7 +1103,7 @@
         if(locale_name == null) {
             if(name_context != null) {
-                locale_name = trc(name_context, name);
+                locale_name = trc(name_context, name.replaceAll("'","''"));
             } else {
-                locale_name = tr(name);
+                locale_name = tr(name.replaceAll("'","''"));
             }
         }
