Changeset 5173 in josm for trunk/src/org
- Timestamp:
- 2012-04-08T01:27:30+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
r5172 r5173 267 267 public static class PresetListEntry { 268 268 public String value; 269 public String value_context; 269 270 public String display_value; 270 271 public String short_description; … … 305 306 public String getDisplayValue(boolean translated) { 306 307 return translated 307 ? Utils.firstNonNull(locale_display_value, tr(display_value), tr (value))308 ? Utils.firstNonNull(locale_display_value, tr(display_value), trc(value_context, value)) 308 309 : Utils.firstNonNull(display_value, value); 309 310 } … … 581 582 int i = 0; 582 583 for (PresetListEntry e : lhm.values()) { 584 if (e.value_context == null) { 585 e.value_context = values_context; 586 } 583 587 display_array[i++] = e.getDisplayValue(true); 584 588 } … … 586 590 587 591 if (locale_text == null) { 588 if (text_context != null) { 589 locale_text = trc(text_context, fixPresetString(text)); 590 } else { 591 locale_text = tr(fixPresetString(text)); 592 } 592 locale_text = trc(text_context, fixPresetString(text)); 593 593 } 594 594 p.add(new JLabel(locale_text + ":"), GBC.std().insets(0, 0, 10, 0)); … … 625 625 } 626 626 for (int i = 0; i < value_array.length; i++) { 627 PresetListEntry e = new PresetListEntry(value_array[i]); 628 e.display_value = (locale_display_values == null) 629 ? (values_context == null ? tr(fixPresetString(display_array[i])) 630 : trc(values_context, fixPresetString(display_array[i]))) : display_array[i]; 631 if (short_descriptions_array != null) { 632 e.short_description = locale_short_descriptions == null ? tr(fixPresetString(short_descriptions_array[i])) 633 : fixPresetString(short_descriptions_array[i]); 634 } 635 lhm.put(value_array[i], e); 627 final PresetListEntry e = new PresetListEntry(value_array[i]); 628 e.locale_display_value = locale_display_values != null 629 ? display_array[i] 630 : trc(values_context, fixPresetString(display_array[i])); 631 if (short_descriptions_array != null) { 632 e.locale_short_description = locale_short_descriptions != null 633 ? short_descriptions_array[i] 634 : tr(fixPresetString(short_descriptions_array[i])); 635 } 636 lhm.put(value_array[i], e); 636 637 } 637 638
Note:
See TracChangeset
for help on using the changeset viewer.