Skip to content

Incorrect title in mapcss rules with different texts in placeholders #1530

Open
@Famlam

Description

@Famlam

The JOSM numeric mapcss rules contain

way[maxspeed][maxspeed !~ /^(signals|none|unposted|variable|walk|[1-9][0-9]*( [a-z]+)?|[A-Z][A-Z]:(urban|rural|living_street|motorway))$/],
way[maxspeed:forward][maxspeed:forward !~ /^(signals|none|unposted|variable|walk|[1-9][0-9]*( [a-z]+)?|[A-Z][A-Z]:(urban|rural|living_street|motorway))$/],
way[maxspeed:backward][maxspeed:backward !~ /^(signals|none|unposted|variable|walk|[1-9][0-9]*( [a-z]+)?|[A-Z][A-Z]:(urban|rural|living_street|motorway))$/] {
  throwWarning: tr("unusual value of {0}: {1} is default; only positive values; point is decimal separator; if units, put space then unit", "{0.key}", tr("km/h"));
  [...and some asserts...]
}

In Osmose, this is converted to text:
unusual value of {TAG}: {km/h} is default; only positive values; point is decimal separator; if units, put space then unit
https://github.com/osm-fr/osmose-backend/blob/5fa6916a95a58359958fec05885fcdb4580975ce/plugins/Josm_numeric.py#L1724

However, the definition of 'class 9006026' has as title:
unusual value of {TAG}: {kilometers} is default; only positive values; point is decimal separator; if units, put space then unit
https://github.com/osm-fr/osmose-backend/blob/5fa6916a95a58359958fec05885fcdb4580975ce/plugins/Josm_numeric.py#L32

kilometers in the title should be km/h

Leading to two conflicting messages in the warning:
image
https://osmose.openstreetmap.fr/nl/issue/0b9c7dce-a69e-471b-5088-c1e4179583ae

I suspect the grouping into classes is done based on the text before substituting the {n} placeholders?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions