Changeset 13343 in josm


Ignore:
Timestamp:
2018-01-20T15:42:45+01:00 (9 months ago)
Author:
Klumbumbus
Message:

see #15719 - improve/unify validator messages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/data/validator/numeric.mapcss

    r13035 r13343  
    5656
    5757*[height][height !~ /^(([0-9]+\.?[0-9]*( (m|ft))?)|([1-9][0-9]*\'((10|11|[0-9])((\.[0-9]+)?)\")?))$/] {
    58   throwWarning: tr("{0}: meters is default; period is separator; if units, put space then unit", "height");
     58  throwWarning: tr("unusual value of {0}: meters is default; point is separator; if units, put space then unit", "{0.key}");
    5959  assertMatch: "node height=medium";
    6060  assertMatch: "node height=-5";
     
    6767
    6868*[maxheight][maxheight !~ /^(([1-9][0-9]*(\.[0-9]+)?( (m|ft))?)|([0-9]+\'(([0-9]|10|11)(\.[0-9]*)?\")?)|none|default)$/] {
    69   throwWarning: tr("{0}: meters is default; period is separator; if units, put space then unit", "maxheight");
     69  throwWarning: tr("unusual value of {0}: meters is default; point is separator; if units, put space then unit", "{0.key}");
    7070  assertMatch: "node maxheight=something";
    7171  assertMatch: "node maxheight=-5";
     
    8080
    8181way[width][width !~ /^(([0-9]+\.?[0-9]*( [a-z]+)?)|([0-9]+\'([0-9]+\.?[0-9]*\")?))$/] {
    82   throwWarning: tr("{0}: meters is default; period is separator; if units, put space then unit", "width");
     82  throwWarning: tr("unusual value of {0}: meters is default; point is separator; if units, put space then unit", "{0.key}");
    8383  assertMatch: "way width=something";
    8484  assertMatch: "way width=-5";
     
    9292
    9393*[maxwidth][maxwidth !~ /^(([0-9]+\.?[0-9]*( (m|ft))?)|([0-9]+\'[0-9]+\.?[0-9]*\"))$/] {
    94   throwWarning: tr("{0}: meters is default; period is separator; if units, put space then unit", "maxwidth");
     94  throwWarning: tr("unusual value of {0}: meters is default; point is separator; if units, put space then unit", "{0.key}");
    9595  assertMatch: "way maxwidth=something";
    9696  assertMatch: "way maxwidth=-5";
     
    101101}
    102102*[maxweight][maxweight !~ /^(([0-9]+\.?[0-9]*( (t|kg|lbs))?)|([0-9]+\'[0-9]+\.?[0-9]*\"))$/] {
    103   throwWarning: tr("{0}: tonne is default; period is separator; if units, put space then unit", "maxweight");
     103  throwWarning: tr("unusual value of {0}: tonne is default; point is separator; if units, put space then unit", "{0.key}");
    104104  assertMatch: "way maxweight=something";
    105105  assertMatch: "way maxweight=-5";
     
    112112way[maxspeed:forward][maxspeed:forward !~ /^(signals|none|unposted|variable|walk|[1-9][0-9]*( [a-z]+)?|[A-Z][A-Z]:(urban|rural|living_street|motorway))$/],
    113113way[maxspeed:backward][maxspeed:backward !~ /^(signals|none|unposted|variable|walk|[1-9][0-9]*( [a-z]+)?|[A-Z][A-Z]:(urban|rural|living_street|motorway))$/] {
    114   throwWarning: tr("unusual {0} format", "maxspeed");
     114  throwWarning: tr("unusual value of {0}", "{0.key}");
    115115  assertMatch: "way maxspeed=something";
    116116  assertMatch: "way maxspeed=-50";
     
    128128
    129129*[distance][distance !~ /^(([0-9]+\.?[0-9]*( (m|km|mi|nmi))?)|([0-9]+\'[0-9]+\.?[0-9]*\"))$/] {
    130   throwWarning: tr("{0}: kilometers is default; period is separator; if units, put space then unit", "distance");
     130  throwWarning: tr("unusual value of {0}: kilometers is default; point is separator; if units, put space then unit", "{0.key}");
    131131  assertMatch: "way distance=something";
    132132  assertMatch: "way distance=-5";
     
    145145   with the values 'perennial' and 'intermittent'; the vast majority are 0, 16.7, 50 and 60 */
    146146way[frequency][frequency !~ /^(0|[1-9][0-9]*(\.[0-9]+)?)( (kHz|MHz|GHz|THz))?$/] {
    147   throwWarning: tr("unusual {0} specification", "frequency");
     147  throwWarning: tr("unusual value of {0}", "{0.key}");
    148148  assertMatch: "way frequency=something";
    149149  assertNoMatch: "way frequency=0"; /* DC */
     
    155155
    156156way[gauge][gauge !~ /^([1-9][0-9]{1,3}(;[1-9][0-9]{1,3})*|broad|standard|narrow)$/] {
    157   throwWarning: tr("unusual train track gauge; use mm with no separator");
     157  throwWarning: tr("unusual value of {0}", "{0.key}");
    158158  assertMatch: "way gauge=something";
    159159  assertNoMatch: "way gauge=1435";
     
    165165/* the numbers for percentage and degrees include could probably be bracketed a bit more precisely */
    166166way[incline][incline !~ /^(up|down|-?([0-9]+?(\.[1-9]%)?|100)[%°]?)$/] {
    167   throwWarning: tr("unusual incline; use percentages/degrees or up/down");
     167  throwWarning: tr("unusual value of {0}", "{0.key}");
     168  suggestAlternative: "x%";
     169  suggestAlternative: "x°";
     170  suggestAlternative: "up";
     171  suggestAlternative: "down";
    168172  assertMatch: "way incline=extreme";
    169173  assertNoMatch: "way incline=up";
     
    195199}
    196200*[admin_level][admin_level !~ /^(1|2|3|4|5|6|7|8|9|10|11|12)$/] {
    197   throwWarning: tr("unusual value of {0}", "{1.key}");
     201  throwWarning: tr("unusual value of {0}", "{0.key}");
    198202  assertMatch: "node admin_level=0";
    199203  assertMatch: "node admin_level=-1";
     
    205209*[direction][direction<0],
    206210*[direction][direction>=360] {
    207   throwWarning: tr("unusual value of {0}", "{1.key}");
     211  throwWarning: tr("unusual value of {0}", "{0.key}");
    208212  assertMatch: "node direction=-10";
    209213  assertMatch: "node direction=360";
     
    211215}
    212216*[direction][direction !~ /^([0-9][0-9]?[0-9]?|north|east|south|west|N|E|S|W|NE|SE|SW|NW|NNE|ENE|ESE|SSE|SSW|WSW|WNW|NNW|forward|backward|both|clockwise|anti-clockwise|anticlockwise|up|down)(-([0-9][0-9]?[0-9]?|N|E|S|W|NE|SE|SW|NW|NNE|ENE|ESE|SSE|SSW|WSW|WNW|NNW))?(;([0-9][0-9]?[0-9]?|N|E|S|W|NE|SE|SW|NW|NNE|ENE|ESE|SSE|SSW|WSW|WNW|NNW)-([0-9][0-9]?[0-9]?|N|E|S|W|NE|SE|SW|NW|NNE|ENE|ESE|SSE|SSW|WSW|WNW|NNW))*$/] {
    213   throwWarning: tr("unusual value of {0}", "{1.key}");
     217  throwWarning: tr("unusual value of {0}", "{0.key}");
    214218  assertMatch: "node direction=north-down";
    215219  assertMatch: "node direction=rome";
Note: See TracChangeset for help on using the changeset viewer.