Ticket #20467: tr20467.patch
File tr20467.patch, 2.1 KB (added by , 4 years ago) |
---|
-
src/org/openstreetmap/josm/data/osm/DefaultNameFormatter.java
1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.data.osm; 3 3 4 import static org.openstreetmap.josm.tools.I18n.marktr; 4 5 import static org.openstreetmap.josm.tools.I18n.tr; 5 6 import static org.openstreetmap.josm.tools.I18n.trc; 6 7 import static org.openstreetmap.josm.tools.I18n.trcLazy; … … 231 232 n = way.get("ref"); 232 233 } 233 234 if (n == null) { 234 n = way.hasKey("highway") ? tr("highway") : 235 way.hasKey("railway") ? tr("railway") : 236 way.hasKey("waterway") ? tr("waterway") : 237 way.hasKey("landuse") ? tr("landuse") : null; 235 for (String key : Arrays.asList(marktr("highway"), marktr("railway"), marktr("waterway"), marktr("landuse"))) { 236 if (way.hasKey(key) && !way.isKeyFalse(key)) { 237 /* I18N: first is highway, railway, waterway or landuse type, second is the type itself */ 238 n = way.isKeyTrue(key) ? tr(key) : tr("{0} ({1})", trcLazy(key, way.get(key)), tr(key)); 239 break; 240 } 241 } 238 242 } 239 243 if (n == null) { 240 244 n = formatAddress(way); 241 245 } 242 if (n == null && way.hasKey("building") ) {243 n = tr("building");246 if (n == null && way.hasKey("building") && !way.isKeyFalse("building")) { 247 n = way.isKeyTrue("building") ? tr("building") : tr("{0} (building)", trc("building", way.get("building"))); 244 248 } 245 249 if (n == null || n.isEmpty()) { 246 250 n = String.valueOf(way.getId());