Changeset 3887 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2011-02-10T20:32:52+01:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java
r3389 r3887 108 108 name = node.getName(); 109 109 } 110 if(name == null) 111 { 112 String s; 113 if((s = node.get("addr:housename")) != null) { 114 /* I18n: name of house as parameter */ 115 name = tr("House {0}", s); 116 } 117 if(name == null && (s = node.get("addr:housenumber")) != null) { 118 String t = node.get("addr:street"); 119 if(t != null) { 120 /* I18n: house number, street as parameter, number should remain 121 before street for better visibility */ 122 name = tr("House number {0} at {1}", s, t); 123 } 124 else { 125 /* I18n: house number as parameter */ 126 name = tr("House number {0}", s); 127 } 128 } 129 } 130 110 131 if (name == null) { 111 132 name = node.isNew() ? tr("node") : ""+ node.getId(); … … 141 162 (way.get("railway") != null) ? tr("railway") : 142 163 (way.get("waterway") != null) ? tr("waterway") : 143 (way.get("landuse") != null) ? tr("landuse") : ""; 164 (way.get("landuse") != null) ? tr("landuse") : null; 165 } 166 if(name == null) 167 { 168 String s; 169 if((s = way.get("addr:housename")) != null) { 170 /* I18n: name of house as parameter */ 171 name = tr("House {0}", s); 172 } 173 if(name == null && (s = way.get("addr:housenumber")) != null) { 174 String t = way.get("addr:street"); 175 if(t != null) { 176 /* I18n: house number, street as parameter, number should remain 177 before street for better visibility */ 178 name = tr("House number {0} at {1}", s, t); 179 } 180 else { 181 /* I18n: house number as parameter */ 182 name = tr("House number {0}", s); 183 } 184 } 144 185 } 145 186 … … 148 189 nodesNo--; 149 190 } 150 if(name .length() == 0)191 if(name == null || name.length() == 0) 151 192 name = String.valueOf(way.getId()); 152 193 /* note: length == 0 should no longer happen, but leave the bracket code 153 194 nevertheless, who knows what future brings */ 195 /* I18n: count of nodes as parameter */ 154 196 String nodes = trn("{0} node", "{0} nodes", nodesNo, nodesNo); 155 197 name += (name.length() > 0) ? " ("+nodes+")" : nodes;
Note:
See TracChangeset
for help on using the changeset viewer.