Changeset 8872 in josm for trunk/src/org


Ignore:
Timestamp:
2015-10-14T22:44:32+02:00 (4 years ago)
Author:
simon04
Message:

fix #11696 - Option to prevent translation of values in presets

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/ComboMultiSelect.java

    r8863 r8872  
    9797    /** The context used for translating {@link #values} */
    9898    public String values_context;
     99    /** Disabled internationalisation for value to avoid mistakes, see #11696 */
     100    public boolean values_no_i18n;
    99101    public String display_values;
    100102    /** The localized version of {@link #display_values}. */
     
    387389        }
    388390
    389         final String displ = Utils.firstNonNull(locale_display_values, display_values);
    390         String[] display_array = displ == null ? value_array : splitEscaped(delChar, displ);
     391        String[] display_array = value_array;
     392        if (!values_no_i18n) {
     393            final String displ = Utils.firstNonNull(locale_display_values, display_values);
     394            display_array = displ == null ? value_array : splitEscaped(delChar, displ);
     395        }
    391396
    392397        final String descr = Utils.firstNonNull(locale_short_descriptions, short_descriptions);
     
    408413        for (int i = 0; i < value_array.length; i++) {
    409414            final PresetListEntry e = new PresetListEntry(value_array[i]);
    410             e.locale_display_value = locale_display_values != null
     415            e.locale_display_value = locale_display_values != null || values_no_i18n
    411416                    ? display_array[i]
    412417                    : trc(values_context, fixPresetString(display_array[i]));
Note: See TracChangeset for help on using the changeset viewer.