Ticket #11696: 11696.patch

File 11696.patch, 4.8 KB (added by simon04, 3 years ago)
  • data/defaultpresets.xml

    diff --git a/data/defaultpresets.xml b/data/defaultpresets.xml
    index 8f9bf10..5b0dfaf 100644
    a b  
    119119        <combo key="service_times" text="Service Times" delimiter="|" values="18:00|sunset,sunrise|Su 09:30,11:00|Sa,Su,PH 09:00|Sa 18:00; Su 10:45|Fr 08:00-18:00; Apr 10-15 off; Jun 07:00-20:00; Aug off; Dec 24 08:00-24:00|Sa 10:00+|week 1-53/2 Fr 09:00-12:00; week 2-52/2 We 09:00-12:00" />
    120120    </chunk>
    121121    <chunk id="oh">
    122         <combo key="opening_hours" text="Opening Hours" delimiter="|" values="24/7|08:30-12:30,15:30-20:00|Sa-Su 00:00-24:00|Mo-Fr 08:30-20:00; Sa,Su 08:00-15:00; PH off|Mo-Fr 08:30-20:00, Tu-Su 08:00-15:00; Sa 08:00-12:00|Mo-Su 08:00-18:00; Apr 10-15 off; Jun 08:00-14:00; Aug off; Dec 25 off|sunrise-sunset|Su 10:00+|week 1-53/2 Fr 09:00-12:00; week 2-52/2 We 09:00-12:00" />
     122        <combo key="opening_hours" text="Opening Hours" delimiter="|" values="24/7|08:30-12:30,15:30-20:00|Sa-Su 00:00-24:00|Mo-Fr 08:30-20:00; Sa,Su 08:00-15:00; PH off|Mo-Fr 08:30-20:00, Tu-Su 08:00-15:00; Sa 08:00-12:00|Mo-Su 08:00-18:00; Apr 10-15 off; Jun 08:00-14:00; Aug off; Dec 25 off|sunrise-sunset|Su 10:00+|week 1-53/2 Fr 09:00-12:00; week 2-52/2 We 09:00-12:00" values_no_i18n="true" />
    123123    </chunk>
    124124    <chunk id="wheelchair">
    125125        <combo key="wheelchair" text="Wheelchairs" values="yes,limited,no" />
     
    45554555            <key key="amenity" value="post_box" />
    45564556            <text key="operator" text="Operator" />
    45574557            <text key="ref" text="Reference number" />
    4558             <combo key="collection_times" text="Collection times" delimiter="|" values="Mo-Sa 09:00|Mo-Fr 17:30; Sa 12:00|Mo-Fr 15:00,19:00; Sa 15:10; Su 10:30" />
     4558            <combo key="collection_times" text="Collection times" delimiter="|" values="Mo-Sa 09:00|Mo-Fr 17:30; Sa 12:00|Mo-Fr 15:00,19:00; Sa 15:10; Su 10:30" values_no_i18n="true" />
    45594559            <check key="drive_through" text="Drive through" />
    45604560        </item> <!-- Post Box -->
    45614561        <item name="Telephone" icon="presets/telephone.png" type="node" preset_name_label="true">
  • data/tagging-preset.xsd

    diff --git a/data/tagging-preset.xsd b/data/tagging-preset.xsd
    index e8b7ca6..b776445 100644
    a b  
    203203                <attribute name="values" type="string" />
    204204                <attribute name="values_from" type="string" />
    205205                <attribute name="values_context" type="string" />
     206                <attribute name="values_no_i18n" type="boolean" />
    206207                <attribute name="display_values" type="string" />
    207208                <attribute name="values_searchable" type="boolean" />
    208209                <attribute name="default" type="string" />
  • src/org/openstreetmap/josm/gui/tagging/TaggingPresetItems.java

    diff --git a/src/org/openstreetmap/josm/gui/tagging/TaggingPresetItems.java b/src/org/openstreetmap/josm/gui/tagging/TaggingPresetItems.java
    index 96a4149..6ed776c 100644
    a b public String toString() { 
    991991        public String values_from;
    992992        /** The context used for translating {@link #values} */
    993993        public String values_context;
     994        /** Disabled internationalisation for value to avoid mistakes, see #11696 */
     995        public boolean values_no_i18n;
    994996        public String display_values;
    995997        /** The localized version of {@link #display_values}. */
    996998        public String locale_display_values;
    private void initListEntriesFromAttributes() { 
    11151117                value_array = splitEscaped(delChar, values);
    11161118            }
    11171119
    1118             final String displ = Utils.firstNonNull(locale_display_values, display_values);
    1119             String[] display_array = displ == null ? value_array : splitEscaped(delChar, displ);
     1120            String[] display_array = value_array;
     1121            if (!values_no_i18n) {
     1122                final String displ = Utils.firstNonNull(locale_display_values, display_values);
     1123                display_array = displ == null ? value_array : splitEscaped(delChar, displ);
     1124            }
    11201125
    11211126            final String descr = Utils.firstNonNull(locale_short_descriptions, short_descriptions);
    11221127            String[] short_descriptions_array = descr == null ? null : splitEscaped(delChar, descr);
    private void initListEntriesFromAttributes() { 
    11361141            final List<PresetListEntry> entries = new ArrayList<>(value_array.length);
    11371142            for (int i = 0; i < value_array.length; i++) {
    11381143                final PresetListEntry e = new PresetListEntry(value_array[i]);
    1139                 e.locale_display_value = locale_display_values != null
     1144                e.locale_display_value = locale_display_values != null || values_no_i18n
    11401145                        ? display_array[i]
    11411146                        : trc(values_context, fixPresetString(display_array[i]));
    11421147                if (short_descriptions_array != null) {