Changeset 4182 in josm
- Timestamp:
- 2011-06-29T09:45:16+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
r4172 r4182 279 279 if (text != null) { 280 280 if(text_context != null) { 281 locale_text = trc(text_context, text.replaceAll("'","''"));281 locale_text = trc(text_context, fixPresetString(text)); 282 282 } else { 283 locale_text = tr( text.replaceAll("'","''"));283 locale_text = tr(fixPresetString(text)); 284 284 } 285 285 } … … 334 334 if(locale_text == null) { 335 335 if(text_context != null) { 336 locale_text = trc(text_context, text.replaceAll("'","''"));336 locale_text = trc(text_context, fixPresetString(text)); 337 337 } else { 338 locale_text = tr( text.replaceAll("'","''"));338 locale_text = tr(fixPresetString(text)); 339 339 } 340 340 } … … 467 467 PresetListEntry e = new PresetListEntry(value_array[i]); 468 468 e.display_value = (locale_display_values == null) 469 ? (values_context == null ? tr( display_array[i].replaceAll("'","''"))470 : trc(values_context, display_array[i].replaceAll("'","''"))) : display_array[i];469 ? (values_context == null ? tr(fixPresetString(display_array[i])) 470 : trc(values_context, fixPresetString(display_array[i]))) : display_array[i]; 471 471 if (short_descriptions_array != null) { 472 e.short_description = locale_short_descriptions == null ? tr( short_descriptions_array[i].replaceAll("'","''"))473 : short_descriptions_array[i].replaceAll("'","''");472 e.short_description = locale_short_descriptions == null ? tr(fixPresetString(short_descriptions_array[i])) 473 : fixPresetString(short_descriptions_array[i]); 474 474 } 475 475 lhm.put(value_array[i], e); … … 524 524 if(locale_text == null) { 525 525 if(text_context != null) { 526 locale_text = trc(text_context, text.replaceAll("'","''"));526 locale_text = trc(text_context, fixPresetString(text)); 527 527 } else { 528 locale_text = tr( text.replaceAll("'","''"));528 locale_text = tr(fixPresetString(text)); 529 529 } 530 530 } … … 743 743 PresetListEntry e = new PresetListEntry(value_array[i]); 744 744 e.display_value = (locale_display_values == null) 745 ? (values_context == null ? tr( display_array[i].replaceAll("'","''"))746 : trc(values_context, display_array[i].replaceAll("'","''"))) : display_array[i];745 ? (values_context == null ? tr(fixPresetString(display_array[i])) 746 : trc(values_context, fixPresetString(display_array[i]))) : display_array[i]; 747 747 if (short_descriptions_array != null) { 748 e.short_description = locale_short_descriptions == null ? tr( short_descriptions_array[i].replaceAll("'","''"))748 e.short_description = locale_short_descriptions == null ? tr(fixPresetString(short_descriptions_array[i])) 749 749 : short_descriptions_array[i]; 750 750 } … … 772 772 if (locale_text == null) { 773 773 if(text_context != null) { 774 locale_text = trc(text_context, text.replaceAll("'","''"));774 locale_text = trc(text_context, fixPresetString(text)); 775 775 } else { 776 locale_text = tr( text.replaceAll("'","''"));776 locale_text = tr(fixPresetString(text)); 777 777 } 778 778 } … … 914 914 if(locale_text == null) { 915 915 if(text_context != null) { 916 locale_text = trc(text_context, text.replaceAll("'","''"));916 locale_text = trc(text_context, fixPresetString(text)); 917 917 } else { 918 locale_text = tr( text.replaceAll("'","''"));918 locale_text = tr(fixPresetString(text)); 919 919 } 920 920 } … … 937 937 locale_text = tr("More information about this feature"); 938 938 } else if(text_context != null) { 939 locale_text = trc(text_context, text.replaceAll("'","''"));939 locale_text = trc(text_context, fixPresetString(text)); 940 940 } else { 941 locale_text = tr( text.replaceAll("'","''"));941 locale_text = tr(fixPresetString(text)); 942 942 } 943 943 } … … 1002 1002 if (text != null) { 1003 1003 if(text_context != null) { 1004 locale_text = trc(text_context, text.replaceAll("'","''"));1004 locale_text = trc(text_context, fixPresetString(text)); 1005 1005 } else { 1006 locale_text = tr( text.replaceAll("'","''"));1006 locale_text = tr(fixPresetString(text)); 1007 1007 } 1008 1008 } … … 1103 1103 if(locale_name == null) { 1104 1104 if(name_context != null) { 1105 locale_name = trc(name_context, name.replaceAll("'","''"));1105 locale_name = trc(name_context, fixPresetString(name)); 1106 1106 } else { 1107 locale_name = tr( name.replaceAll("'","''"));1107 locale_name = tr(fixPresetString(name)); 1108 1108 } 1109 1109 } … … 1486 1486 } 1487 1487 1488 private static String fixPresetString(String s) { 1489 return s == null ? s : s.replaceAll("'","''"); 1490 } 1491 1488 1492 public static Command createCommand(Collection<OsmPrimitive> sel, List<Tag> changedTags) { 1489 1493 List<Command> cmds = new ArrayList<Command>();
Note:
See TracChangeset
for help on using the changeset viewer.