Changeset 1541 in josm
- Timestamp:
- 2009-04-20T13:01:04+02:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/OsmApi.java
r1530 r1541 21 21 import java.util.Collection; 22 22 import java.util.Properties; 23 import java.util.HashMap; 23 24 import java.util.StringTokenizer; 24 25 … … 78 79 */ 79 80 private boolean initialized = false; 81 82 /** 83 * list of server error messages (as transported in the Error: header) and their translations. 84 */ 85 public static final HashMap<String,String> serverErrorTranslations; 86 87 static { 88 serverErrorTranslations = new HashMap<String,String>(); 89 serverErrorTranslations.put("Database offline for maintenance", 90 tr("Database offline for maintenance")); 91 serverErrorTranslations.put("You must make your edits public to upload new data", 92 tr("You must make your edits public to upload new data")); 93 // FIXME there is one additional server error message that goes 94 // "You requested too many nodes (limit is #{APP_CONFIG['max_number_of_nodes']}). Either request a smaller area, or use planet.osm" 95 // but we would have to switch this mechanism to using regular expressions if we wanted to translate that... 96 } 80 97 81 98 private StringWriter swriter = new StringWriter(); … … 410 427 if (activeConnection.getHeaderField("Error") != null) { 411 428 statusMessage.append(": "); 412 statusMessage.append(activeConnection.getHeaderField("Error")); 429 String er = activeConnection.getHeaderField("Error"); 430 if (serverErrorTranslations.containsKey(er)) er = serverErrorTranslations.get(er); 431 statusMessage.append(er); 413 432 } 414 433 activeConnection.disconnect();
Note:
See TracChangeset
for help on using the changeset viewer.