Changeset 8872 in josm


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

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

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/data/defaultpresets.xml

    r8869 r8872  
    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">
     
    45874587            <text key="operator" text="Operator" />
    45884588            <text key="ref" text="Reference number" />
    4589             <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" />
     4589            <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" />
    45904590            <combo key="post_box:type" text="Type" values="pillar,lamp,wall,meter" values_context="post_box" />
    45914591            <check key="drive_through" text="Drive through" />
     
    47704770            <reference ref="fee" />
    47714771            <text key="operator" text="Operator" />
    4772             <combo key="opening_hours" text="Operation times" values="24/7" />
     4772            <combo key="opening_hours" text="Operation times" values="24/7" values_no_i18n="true" />
    47734773        </item> <!-- Sanitary Dump Station -->
    47744774        <separator/>
     
    57075707            <space />
    57085708            <key key="highway" value="street_lamp" />
    5709             <combo key="opening_hours" text="Operation times" values="Mo-Fr 22:00-05:00" />
     5709            <combo key="opening_hours" text="Operation times" values="Mo-Fr 22:00-05:00" values_no_i18n="true" />
    57105710        </item> <!-- Street Lamp -->
    57115711        <item name="Monitoring Station" icon="presets/monitoring_station.png" type="node,closedway" preset_name_label="true">
  • trunk/data/tagging-preset.xsd

    r8310 r8872  
    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" />
  • 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.