Index: /trunk/src/org/openstreetmap/josm/Main.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/Main.java	(revision 1989)
+++ /trunk/src/org/openstreetmap/josm/Main.java	(revision 1990)
@@ -34,4 +34,5 @@
 import org.openstreetmap.josm.data.Preferences;
 import org.openstreetmap.josm.data.UndoRedoHandler;
+import org.openstreetmap.josm.data.coor.CoordinateFormat;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.projection.Mercator;
@@ -330,4 +331,14 @@
         UIManager.put("OptionPane.noIcon", UIManager.get("OptionPane.cancelIcon"));
 
+        // init default coordinate format
+        //
+        try {
+            CoordinateFormat format = CoordinateFormat.valueOf(Main.pref.get("coordinates"));
+            CoordinateFormat.setCoordinateFormat(CoordinateFormat.valueOf(Main.pref.get("coordinates")));
+        } catch (IllegalArgumentException iae) {
+            CoordinateFormat.setCoordinateFormat(CoordinateFormat.DECIMAL_DEGREES);
+        }
+
+
         Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
         String geometry = Main.pref.get("gui.geometry");
Index: /trunk/src/org/openstreetmap/josm/actions/DownloadReferrersAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/DownloadReferrersAction.java	(revision 1989)
+++ /trunk/src/org/openstreetmap/josm/actions/DownloadReferrersAction.java	(revision 1990)
@@ -18,4 +18,5 @@
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.visitor.MergeVisitor;
+import org.openstreetmap.josm.gui.DefaultNameFormatter;
 import org.openstreetmap.josm.gui.OptionPaneUtil;
 import org.openstreetmap.josm.gui.PleaseWaitRunnable;
@@ -147,5 +148,5 @@
                     if (cancelled)
                         return;
-                    progressMonitor.subTask(tr("({0}/{1}) Loading parents of primitive {2}", i+1,primitives.size(), primitive.getName()));
+                    progressMonitor.subTask(tr("({0}/{1}) Loading parents of primitive {2}", i+1,primitives.size(), primitive.getDisplayName(DefaultNameFormatter.getInstance())));
                     downloadParents(primitive, progressMonitor.createSubTaskMonitor(1, false));
                     i++;
Index: /trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java	(revision 1989)
+++ /trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java	(revision 1990)
@@ -31,6 +31,6 @@
 import org.openstreetmap.josm.data.osm.visitor.AbstractVisitor;
 import org.openstreetmap.josm.data.osm.visitor.Visitor;
+import org.openstreetmap.josm.gui.DefaultNameFormatter;
 import org.openstreetmap.josm.gui.OptionPaneUtil;
-import org.openstreetmap.josm.gui.PrimitiveNameFormatter;
 import org.openstreetmap.josm.tools.Shortcut;
 
@@ -357,5 +357,6 @@
         Main.main.undoRedo.add(
                 new SequenceCommand(tr("Split way {0} into {1} parts",
-                        new PrimitiveNameFormatter().getName(selectedWay), wayChunks.size()),
+                        selectedWay.getDisplayName(DefaultNameFormatter.getInstance()),
+                        wayChunks.size()),
                         commandList));
         getCurrentDataSet().setSelected(newSelection);
Index: /trunk/src/org/openstreetmap/josm/command/AddCommand.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/command/AddCommand.java	(revision 1989)
+++ /trunk/src/org/openstreetmap/josm/command/AddCommand.java	(revision 1990)
@@ -13,5 +13,5 @@
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
-import org.openstreetmap.josm.gui.PrimitiveNameFormatter;
+import org.openstreetmap.josm.gui.DefaultNameFormatter;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.tools.ImageProvider;
@@ -73,5 +73,5 @@
                 new JLabel(
                         tr(msg,
-                                new PrimitiveNameFormatter().getName(osm)
+                                osm.getDisplayName(DefaultNameFormatter.getInstance())
                         ),
                         ImageProvider.get(OsmPrimitiveType.from(osm)),
Index: /trunk/src/org/openstreetmap/josm/command/ChangeCommand.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/command/ChangeCommand.java	(revision 1989)
+++ /trunk/src/org/openstreetmap/josm/command/ChangeCommand.java	(revision 1990)
@@ -13,5 +13,5 @@
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
-import org.openstreetmap.josm.gui.PrimitiveNameFormatter;
+import org.openstreetmap.josm.gui.DefaultNameFormatter;
 import org.openstreetmap.josm.tools.ImageProvider;
 
@@ -53,7 +53,7 @@
         return new DefaultMutableTreeNode(
                 new JLabel(tr(msg,
-                        new PrimitiveNameFormatter().getName(osm)),
+                        osm.getDisplayName(DefaultNameFormatter.getInstance()),
                         ImageProvider.get(OsmPrimitiveType.from(osm)),
-                        JLabel.HORIZONTAL));
+                        JLabel.HORIZONTAL)));
     }
 }
Index: /trunk/src/org/openstreetmap/josm/command/ChangePropertyCommand.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/command/ChangePropertyCommand.java	(revision 1989)
+++ /trunk/src/org/openstreetmap/josm/command/ChangePropertyCommand.java	(revision 1990)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.command;
 
+import static org.openstreetmap.josm.tools.I18n.marktr;
 import static org.openstreetmap.josm.tools.I18n.tr;
-import static org.openstreetmap.josm.tools.I18n.marktr;
 import static org.openstreetmap.josm.tools.I18n.trn;
 
@@ -16,5 +16,5 @@
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
-import org.openstreetmap.josm.gui.PrimitiveNameFormatter;
+import org.openstreetmap.josm.gui.DefaultNameFormatter;
 import org.openstreetmap.josm.tools.ImageProvider;
 
@@ -95,8 +95,6 @@
     @Override public MutableTreeNode description() {
         String text;
-        PrimitiveNameFormatter formatter = new PrimitiveNameFormatter();
         if (objects.size() == 1) {
             OsmPrimitive primitive = objects.iterator().next();
-            String name = formatter.getName(primitive);
             String msg = "";
             if (value == null) {
@@ -106,5 +104,5 @@
                 case RELATION: msg = marktr("Remove \"{0}\" for relation ''{1}''"); break;
                 }
-                text = tr(msg, key, name);
+                text = tr(msg, key, primitive.getDisplayName(DefaultNameFormatter.getInstance()));
             } else {
                 switch(OsmPrimitiveType.from(primitive)) {
@@ -113,5 +111,5 @@
                 case RELATION: msg = marktr("Set {0}={1} for relation ''{2}''"); break;
                 }
-                text = tr(msg, key, value, name);
+                text = tr(msg, key, value, primitive.getDisplayName(DefaultNameFormatter.getInstance()));
             }
         }
@@ -128,5 +126,5 @@
             root.add(new DefaultMutableTreeNode(
                     new JLabel(
-                            formatter.getName(osm),
+                            osm.getDisplayName(DefaultNameFormatter.getInstance()),
                             ImageProvider.get(OsmPrimitiveType.from(osm)),
                             JLabel.HORIZONTAL)
Index: /trunk/src/org/openstreetmap/josm/command/ChangeRelationMemberRoleCommand.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/command/ChangeRelationMemberRoleCommand.java	(revision 1989)
+++ /trunk/src/org/openstreetmap/josm/command/ChangeRelationMemberRoleCommand.java	(revision 1990)
@@ -14,5 +14,5 @@
 import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
 import org.openstreetmap.josm.data.osm.Relation;
-import org.openstreetmap.josm.gui.PrimitiveNameFormatter;
+import org.openstreetmap.josm.gui.DefaultNameFormatter;
 import org.openstreetmap.josm.tools.ImageProvider;
 
@@ -70,5 +70,5 @@
                         tr("Change relation member role for {0} {1}",
                                 OsmPrimitiveType.from(relation),
-                                new PrimitiveNameFormatter().getName(relation)
+                                relation.getDisplayName(DefaultNameFormatter.getInstance())
                         ),
                         ImageProvider.get(OsmPrimitiveType.from(relation)),
Index: /trunk/src/org/openstreetmap/josm/command/ConflictAddCommand.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/command/ConflictAddCommand.java	(revision 1989)
+++ /trunk/src/org/openstreetmap/josm/command/ConflictAddCommand.java	(revision 1990)
@@ -8,5 +8,4 @@
 import javax.swing.JLabel;
 import javax.swing.JOptionPane;
-import javax.swing.text.html.Option;
 import javax.swing.tree.DefaultMutableTreeNode;
 import javax.swing.tree.MutableTreeNode;
@@ -16,6 +15,6 @@
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
+import org.openstreetmap.josm.gui.DefaultNameFormatter;
 import org.openstreetmap.josm.gui.OptionPaneUtil;
-import org.openstreetmap.josm.gui.PrimitiveNameFormatter;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.tools.ImageProvider;
@@ -36,5 +35,5 @@
                         + "This conflict can't be added.</html>",
                         getLayer().getName(),
-                        new PrimitiveNameFormatter().getName(conflict.getMy())
+                        conflict.getMy().getDisplayName(DefaultNameFormatter.getInstance())
                 ),
                 tr("Double conflict"),
@@ -56,5 +55,5 @@
             System.out.println(tr("Warning: layer ''{0}'' doesn't exist anymore. Can't remove conflict for primitmive ''{1}''",
                     getLayer().getName(),
-                    new PrimitiveNameFormatter().getName(conflict.getMy())
+                    conflict.getMy().getDisplayName(DefaultNameFormatter.getInstance())
             ));
             return;
@@ -71,5 +70,5 @@
                 new JLabel(
                         tr("Add conflict for ''{0}''",
-                                new PrimitiveNameFormatter().getName(conflict.getMy())
+                                conflict.getMy().getDisplayName(DefaultNameFormatter.getInstance())
                         ),
                         ImageProvider.get(OsmPrimitiveType.from(conflict.getMy())),
Index: /trunk/src/org/openstreetmap/josm/command/DeleteCommand.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/command/DeleteCommand.java	(revision 1989)
+++ /trunk/src/org/openstreetmap/josm/command/DeleteCommand.java	(revision 1990)
@@ -33,6 +33,6 @@
 import org.openstreetmap.josm.data.osm.visitor.CollectBackReferencesVisitor;
 import org.openstreetmap.josm.gui.ConditionalOptionPaneUtil;
+import org.openstreetmap.josm.gui.DefaultNameFormatter;
 import org.openstreetmap.josm.gui.ExtendedDialog;
-import org.openstreetmap.josm.gui.PrimitiveNameFormatter;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.tools.ImageProvider;
@@ -115,5 +115,5 @@
             }
 
-            return new DefaultMutableTreeNode(new JLabel(tr(msg, new PrimitiveNameFormatter().getName(primitive)),
+            return new DefaultMutableTreeNode(new JLabel(tr(msg, primitive.getDisplayName(DefaultNameFormatter.getInstance())),
                     ImageProvider.get(OsmPrimitiveType.from(primitive)), JLabel.HORIZONTAL));
         }
@@ -140,6 +140,7 @@
         );
         for (OsmPrimitive osm : toDelete) {
-            root.add(new DefaultMutableTreeNode(new JLabel(new PrimitiveNameFormatter().getName(osm), ImageProvider
-                    .get(OsmPrimitiveType.from(osm)), JLabel.HORIZONTAL)));
+            root.add(new DefaultMutableTreeNode(new JLabel(
+                    osm.getDisplayName(DefaultNameFormatter.getInstance()),
+                    ImageProvider.get(OsmPrimitiveType.from(osm)), JLabel.HORIZONTAL)));
         }
         return root;
@@ -173,5 +174,4 @@
 
     private static int testRelation(Relation ref, OsmPrimitive osm) {
-        PrimitiveNameFormatter formatter = new PrimitiveNameFormatter();
         String role = new String();
         for (RelationMember m : ref.getMembers()) {
@@ -183,11 +183,12 @@
         if (role.length() > 0)
             return new ExtendedDialog(Main.parent, tr("Conflicting relation"), tr(
-                    "Selection \"{0}\" is used by relation \"{1}\" with role {2}.\nDelete from relation?", formatter
-                    .getName(osm), formatter.getName(ref), role), new String[] { tr("Delete from relation"),
+                    "Selection \"{0}\" is used by relation \"{1}\" with role {2}.\nDelete from relation?",
+                    osm.getDisplayName(DefaultNameFormatter.getInstance()), ref.getDisplayName(DefaultNameFormatter.getInstance()), role), new String[] { tr("Delete from relation"),
                 tr("Cancel") }, new String[] { "dialogs/delete.png", "cancel.png" }).getValue();
         else
             return new ExtendedDialog(Main.parent, tr("Conflicting relation"), tr(
-                    "Selection \"{0}\" is used by relation \"{1}\".\nDelete from relation?", formatter.getName(osm),
-                    formatter.getName(ref)), new String[] { tr("Delete from relation"), tr("Cancel") }, new String[] {
+                    "Selection \"{0}\" is used by relation \"{1}\".\nDelete from relation?",
+                    osm.getDisplayName(DefaultNameFormatter.getInstance()),
+                    ref.getDisplayName(DefaultNameFormatter.getInstance())), new String[] { tr("Delete from relation"), tr("Cancel") }, new String[] {
                 "dialogs/delete.png", "cancel.png" }).getValue();
     }
Index: /trunk/src/org/openstreetmap/josm/command/RemoveRelationMemberCommand.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/command/RemoveRelationMemberCommand.java	(revision 1989)
+++ /trunk/src/org/openstreetmap/josm/command/RemoveRelationMemberCommand.java	(revision 1990)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.command;
 
+import static org.openstreetmap.josm.tools.I18n.marktr;
 import static org.openstreetmap.josm.tools.I18n.tr;
-import static org.openstreetmap.josm.tools.I18n.marktr;
 
 import java.util.Collection;
@@ -16,5 +16,5 @@
 import org.openstreetmap.josm.data.osm.Relation;
 import org.openstreetmap.josm.data.osm.RelationMember;
-import org.openstreetmap.josm.gui.PrimitiveNameFormatter;
+import org.openstreetmap.josm.gui.DefaultNameFormatter;
 import org.openstreetmap.josm.tools.ImageProvider;
 
@@ -74,7 +74,7 @@
                 new JLabel(
                         tr(msg,
-                                new PrimitiveNameFormatter().getName(member.member),
+                                member.member.getDisplayName(DefaultNameFormatter.getInstance()),
                                 relation.getMembers().indexOf(member),
-                                new PrimitiveNameFormatter().getName(relation)
+                                relation.getDisplayName(DefaultNameFormatter.getInstance())
                         ),
                         ImageProvider.get(OsmPrimitiveType.from(relation)),
Index: /trunk/src/org/openstreetmap/josm/corrector/RoleCorrectionTableModel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/corrector/RoleCorrectionTableModel.java	(revision 1989)
+++ /trunk/src/org/openstreetmap/josm/corrector/RoleCorrectionTableModel.java	(revision 1990)
@@ -6,9 +6,8 @@
 import java.util.List;
 
-import org.openstreetmap.josm.gui.PrimitiveNameFormatter;
+import org.openstreetmap.josm.gui.DefaultNameFormatter;
 
 public class RoleCorrectionTableModel extends
 CorrectionTableModel<RoleCorrection> {
-    private static final PrimitiveNameFormatter NAME_FORMATTER = new PrimitiveNameFormatter();
 
     public RoleCorrectionTableModel(List<RoleCorrection> roleCorrections) {
@@ -40,5 +39,5 @@
         switch (colIndex) {
         case 0:
-            return NAME_FORMATTER.getName(roleCorrection.relation);
+            return roleCorrection.relation.getDisplayName(DefaultNameFormatter.getInstance());
         case 1:
             return roleCorrection.member.getRole();
Index: /trunk/src/org/openstreetmap/josm/corrector/TagCorrector.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/corrector/TagCorrector.java	(revision 1989)
+++ /trunk/src/org/openstreetmap/josm/corrector/TagCorrector.java	(revision 1990)
@@ -28,12 +28,11 @@
 import org.openstreetmap.josm.data.osm.Relation;
 import org.openstreetmap.josm.data.osm.Way;
+import org.openstreetmap.josm.gui.DefaultNameFormatter;
 import org.openstreetmap.josm.gui.JMultilineLabel;
 import org.openstreetmap.josm.gui.OptionPaneUtil;
-import org.openstreetmap.josm.gui.PrimitiveNameFormatter;
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.ImageProvider;
 
 public abstract class TagCorrector<P extends OsmPrimitive> {
-    private static final PrimitiveNameFormatter NAME_FORMATTER = new PrimitiveNameFormatter();
 
     public abstract Collection<Command> execute(P primitive, P oldprimitive)
@@ -101,5 +100,5 @@
 
                 final JLabel primitiveLabel = new JLabel(
-                        NAME_FORMATTER.getName(primitive) + ":",
+                        primitive.getDisplayName(DefaultNameFormatter.getInstance()) + ":",
                         ImageProvider.get(OsmPrimitiveType.from(primitive)),
                         JLabel.LEFT
@@ -127,5 +126,5 @@
 
                 final JLabel primitiveLabel = new JLabel(
-                        NAME_FORMATTER.getName(primitive),
+                        primitive.getDisplayName(DefaultNameFormatter.getInstance()),
                         ImageProvider.get(OsmPrimitiveType.from(primitive)),
                         JLabel.LEFT
Index: /trunk/src/org/openstreetmap/josm/data/coor/CoordinateFormat.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/coor/CoordinateFormat.java	(revision 1990)
+++ /trunk/src/org/openstreetmap/josm/data/coor/CoordinateFormat.java	(revision 1990)
@@ -0,0 +1,62 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.data.coor;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+/**
+ * An enumeration  of coordinate formats
+ * 
+ */
+public enum CoordinateFormat {
+
+    /**
+     * the decimal format 999.999
+     */
+    DECIMAL_DEGREES (tr("Decimal Degrees")),
+
+    /**
+     * the minutes/seconds format 99" 99'
+     */
+    DEGREES_MINUTES_SECONDS (tr("Degrees Minutes Seconds"));
+
+    private String displayName;
+    private CoordinateFormat(String displayName) {
+        this.displayName = displayName;
+    }
+
+    /**
+     * Replies the display name of the format
+     * 
+     * @return the display name
+     */
+    public String getDisplayName() {
+        return displayName;
+    }
+
+    @Override
+    public String toString() {
+        return getDisplayName();
+    }
+
+    private static CoordinateFormat defaultCoordinateFormat = DECIMAL_DEGREES;
+
+    /**
+     * Replies the default coordinate format to be use
+     * 
+     * @return the default coordinate format
+     */
+    static public CoordinateFormat getDefaultFormat() {
+        return defaultCoordinateFormat;
+    }
+
+    /**
+     * Sets the default coordinate format
+     * 
+     * @param format the default coordinate format
+     */
+    static public void setCoordinateFormat(CoordinateFormat format) {
+        if (format != null) {
+            defaultCoordinateFormat = format;
+        }
+    }
+}
Index: /trunk/src/org/openstreetmap/josm/data/coor/LatLon.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/coor/LatLon.java	(revision 1989)
+++ /trunk/src/org/openstreetmap/josm/data/coor/LatLon.java	(revision 1990)
@@ -25,11 +25,4 @@
     private static DecimalFormat cDdFormatter = new DecimalFormat("###0.0000");
 
-    /**
-     * Possible ways to display coordinates
-     */
-    public enum CoordinateFormat {
-        DECIMAL_DEGREES {public String toString() {return tr("Decimal Degrees");}},
-        DEGREES_MINUTES_SECONDS {public String toString() {return tr("Degrees Minutes Seconds");}};
-    }
 
     public static String dms(double pCoordinate) {
@@ -42,5 +35,5 @@
 
         return tDegree + "\u00B0" + cDmsMinuteFormatter.format(tMinutes) + "\'"
-            + cDmsSecondFormatter.format(tSeconds) + "\"";
+        + cDmsSecondFormatter.format(tSeconds) + "\"";
     }
 
@@ -94,5 +87,5 @@
         Bounds b = Main.proj.getWorldBoundsLatLon();
         return lat() < b.min.lat() || lat() > b.max.lat() ||
-            lon() < b.min.lon() || lon() > b.max.lon();
+        lon() < b.min.lon() || lon() > b.max.lon();
     }
 
@@ -112,7 +105,7 @@
     public double greatCircleDistance(LatLon other) {
         return (Math.acos(
-            Math.sin(Math.toRadians(lat())) * Math.sin(Math.toRadians(other.lat())) +
-            Math.cos(Math.toRadians(lat()))*Math.cos(Math.toRadians(other.lat())) *
-                          Math.cos(Math.toRadians(other.lon()-lon()))) * 6378135);
+                Math.sin(Math.toRadians(lat())) * Math.sin(Math.toRadians(other.lat())) +
+                Math.cos(Math.toRadians(lat()))*Math.cos(Math.toRadians(other.lat())) *
+                Math.cos(Math.toRadians(other.lon()-lon()))) * 6378135);
     }
 
@@ -130,6 +123,10 @@
         } else {
             rv = Math.atan((other.lon()-lon())/(other.lat()-lat()));
-            if (rv < 0) rv += Math.PI;
-            if (other.lon() < lon()) rv += Math.PI;
+            if (rv < 0) {
+                rv += Math.PI;
+            }
+            if (other.lon() < lon()) {
+                rv += Math.PI;
+            }
         }
         return rv;
@@ -149,5 +146,5 @@
     public LatLon interpolate(LatLon ll2, double proportion) {
         return new LatLon(this.lat() + proportion * (ll2.lat() - this.lat()),
-            this.lon() + proportion * (ll2.lon() - this.lon()));
+                this.lon() + proportion * (ll2.lon() - this.lon()));
     }
 
Index: /trunk/src/org/openstreetmap/josm/data/osm/Changeset.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/Changeset.java	(revision 1989)
+++ /trunk/src/org/openstreetmap/josm/data/osm/Changeset.java	(revision 1990)
@@ -2,6 +2,7 @@
 package org.openstreetmap.josm.data.osm;
 
+import static org.openstreetmap.josm.tools.I18n.tr;
+
 import org.openstreetmap.josm.data.osm.visitor.Visitor;
-import static org.openstreetmap.josm.tools.I18n.tr;
 
 /**
@@ -35,5 +36,16 @@
     @Override
     public String getName() {
+        // no translation
+        return "changeset " + id;
+    }
+
+    @Override
+    public String getLocalName(){
         return tr("Changeset {0}",id);
     }
+
+    @Override
+    public String getDisplayName(NameFormatter formatter) {
+        return formatter.format(this);
+    }
 }
Index: /trunk/src/org/openstreetmap/josm/data/osm/NameFormatter.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/NameFormatter.java	(revision 1990)
+++ /trunk/src/org/openstreetmap/josm/data/osm/NameFormatter.java	(revision 1990)
@@ -0,0 +1,9 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.data.osm;
+
+public interface NameFormatter {
+    String format(Node node);
+    String format(Way way);
+    String format(Relation relation);
+    String format(Changeset changeset);
+}
Index: /trunk/src/org/openstreetmap/josm/data/osm/Node.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/Node.java	(revision 1989)
+++ /trunk/src/org/openstreetmap/josm/data/osm/Node.java	(revision 1990)
@@ -2,12 +2,11 @@
 package org.openstreetmap.josm.data.osm;
 
-import static org.openstreetmap.josm.tools.I18n.tr;
+import java.util.Locale;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.coor.CachedLatLon;
 import org.openstreetmap.josm.data.coor.EastNorth;
 import org.openstreetmap.josm.data.coor.LatLon;
-import org.openstreetmap.josm.data.coor.LatLon.CoordinateFormat;
 import org.openstreetmap.josm.data.osm.visitor.Visitor;
+import static org.openstreetmap.josm.tools.I18n.tr;
 
 /**
@@ -50,23 +49,5 @@
     }
 
-    private static CoordinateFormat mCord;
 
-    static public CoordinateFormat getCoordinateFormat()
-    {
-        return mCord;
-    }
-
-    static public void setCoordinateFormat()
-    {
-        try {
-            mCord = LatLon.CoordinateFormat.valueOf(Main.pref.get("coordinates"));
-        } catch (IllegalArgumentException iae) {
-            mCord = LatLon.CoordinateFormat.DECIMAL_DEGREES;
-        }
-    }
-
-    static {
-        setCoordinateFormat();
-    }
 
     /**
@@ -127,16 +108,23 @@
 
     @Override
+    public String getDisplayName(NameFormatter formatter) {
+        return formatter.format(this);
+    }
+
+    @Override
     public String getName() {
-        String name;
-        if (incomplete) {
-            name = tr("incomplete");
-        } else {
-            name = get("name");
-            if (name == null) {
-                name = id == 0 ? tr("node") : ""+id;
-            }
-            name += " (" + coor.latToString(mCord) + ", " + coor.lonToString(mCord) + ")";
-        }
-        return name;
+        String name = super.getName();
+        if (name != null)
+            return name;
+        // no translation
+        return "node " + id;
+    }
+
+    @Override
+    public String getLocalName(){
+        String name = super.getLocalName();
+        if (name != null)
+            return name;
+        return tr("node {0}",id);
     }
 }
Index: /trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java	(revision 1989)
+++ /trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java	(revision 1990)
@@ -10,4 +10,5 @@
 import java.util.Date;
 import java.util.HashMap;
+import java.util.Locale;
 import java.util.Map;
 import java.util.Map.Entry;
@@ -358,11 +359,4 @@
         return keys != null && !keys.isEmpty();
     }
-
-    /**
-     * Replies the name of this primitive.
-     * 
-     * @return the name of this primitive
-     */
-    public abstract String getName();
 
     /**
@@ -463,3 +457,49 @@
         return false;
     }
+
+
+    /**
+     * Replies the name of this primitive. The default implementation replies the value
+     * of the tag <tt>name</tt> or null, if this tag is not present.
+     * 
+     * @return the name of this primitive
+     */
+    public String getName() {
+        if (get("name") != null)
+            return get("name");
+        return null;
+    }
+
+    /**
+     * Replies the a localized name for this primitive given by the value of the tags (in this order)
+     * <ul>
+     *   <li>name:lang_COUNTRY_Variant  of the current locale</li>
+     *   <li>name:lang_COUNTRY of the current locale</li>
+     *   <li>name:lang of the current locale</li>
+     *   <li>name of the current locale</li>
+     * </ul>
+     * 
+     * null, if no such tag exists
+     * 
+     * @return the name of this primitive
+     */
+    public String getLocalName() {
+        String key = "name:" + Locale.getDefault().toString();
+        if (get(key) != null)
+            return get(key);
+        key = "name:" + Locale.getDefault().getLanguage() + "_" + Locale.getDefault().getCountry();
+        if (get(key) != null)
+            return get(key);
+        key = "name:" + Locale.getDefault().getLanguage();
+        if (get(key) != null)
+            return get(key);
+        return getName();
+    }
+
+    /**
+     * Replies the display name of a primitive formatted by <code>formatter</code>
+     * 
+     * @return the display name
+     */
+    public abstract String getDisplayName(NameFormatter formatter);
 }
Index: /trunk/src/org/openstreetmap/josm/data/osm/Relation.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/Relation.java	(revision 1989)
+++ /trunk/src/org/openstreetmap/josm/data/osm/Relation.java	(revision 1990)
@@ -2,12 +2,8 @@
 
 import static org.openstreetmap.josm.tools.I18n.tr;
-import static org.openstreetmap.josm.tools.I18n.trn;
 
 import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
 import java.util.List;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.osm.visitor.Visitor;
 import org.openstreetmap.josm.tools.CopyList;
@@ -104,7 +100,4 @@
         return members.remove(index);
     }
-
-    final static String[] defnames = {"name", "ref", "restriction", "note"};
-    static Collection<String> names = null;
 
     @Override public void visit(Visitor visitor) {
@@ -164,39 +157,4 @@
     }
 
-    @Override
-    public String getName() {
-        String name;
-        if (incomplete) {
-            name = tr("incomplete");
-        } else {
-            name = get("type");
-            if (name == null) {
-                name = tr("relation");
-            }
-
-            name += " (";
-            if(names == null) {
-                names = Main.pref.getCollection("relation.nameOrder", Arrays.asList(defnames));
-            }
-            String nameTag = null;
-            for (String n : names) {
-                nameTag = get(n);
-                if (nameTag != null) {
-                    break;
-                }
-            }
-            if (nameTag != null) {
-                name += "\"" + nameTag + "\", ";
-            }
-
-            int mbno = members.size();
-            name += trn("{0} member", "{0} members", mbno, mbno) + ")";
-            if(errors != null) {
-                name = "*"+name;
-            }
-        }
-        return name;
-    }
-
     // seems to be different from member "incomplete" - FIXME
     public boolean isIncomplete() {
@@ -233,3 +191,25 @@
         members.removeAll(todelete);
     }
+
+    @Override
+    public String getName() {
+        String name = super.getName();
+        if (name != null)
+            return name;
+        // no translation
+        return "relation " + id;
+    }
+
+    @Override
+    public String getLocalName(){
+        String name = super.getLocalName();
+        if (name != null)
+            return name;
+        return tr("relation {0}",id);
+    }
+
+    @Override
+    public String getDisplayName(NameFormatter formatter) {
+        return formatter.format(this);
+    }
 }
Index: /trunk/src/org/openstreetmap/josm/data/osm/Way.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/Way.java	(revision 1989)
+++ /trunk/src/org/openstreetmap/josm/data/osm/Way.java	(revision 1990)
@@ -180,32 +180,4 @@
     }
 
-    @Override
-    public String getName() {
-        String name;
-        if (incomplete) {
-            name = tr("incomplete");
-        } else {
-            name = get("name");
-            if (name == null) {
-                name = get("ref");
-            }
-            if (name == null) {
-                name =
-                    (get("highway") != null) ? tr("highway") :
-                        (get("railway") != null) ? tr("railway") :
-                            (get("waterway") != null) ? tr("waterway") :
-                                (get("landuse") != null) ? tr("landuse") : "";
-            }
-
-            int nodesNo = new HashSet<Node>(nodes).size();
-            String nodes = trn("{0} node", "{0} nodes", nodesNo, nodesNo);
-            name += (name.length() > 0) ? " ("+nodes+")" : nodes;
-            if(errors != null) {
-                name = "*"+name;
-            }
-        }
-        return name;
-    }
-
     public void removeNode(Node n) {
         if (incomplete) return;
@@ -263,3 +235,25 @@
         return n == firstNode() || n == lastNode();
     }
+
+    @Override
+    public String getName() {
+        String name = super.getName();
+        if (name != null)
+            return name;
+        // no translation
+        return "way " + id;
+    }
+
+    @Override
+    public String getLocalName(){
+        String name = super.getLocalName();
+        if (name != null)
+            return name;
+        return tr("way {0}",id);
+    }
+
+    @Override
+    public String getDisplayName(NameFormatter formatter) {
+        return formatter.format(this);
+    }
 }
Index: /trunk/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java	(revision 1989)
+++ /trunk/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java	(revision 1990)
@@ -34,4 +34,5 @@
 import org.openstreetmap.josm.data.osm.RelationMember;
 import org.openstreetmap.josm.data.osm.Way;
+import org.openstreetmap.josm.gui.DefaultNameFormatter;
 import org.openstreetmap.josm.gui.mappaint.AreaElemStyle;
 import org.openstreetmap.josm.gui.mappaint.ElemStyle;
@@ -94,10 +95,11 @@
             return (styles != null) ? styles.get(osm) : null;
 
-        if(osm.mappaintStyle == null && styles != null) {
-            osm.mappaintStyle = styles.get(osm);
-            if(osm instanceof Way)
-                ((Way)osm).isMappaintArea = styles.isArea(osm);
-        }
-        return osm.mappaintStyle;
+            if(osm.mappaintStyle == null && styles != null) {
+                osm.mappaintStyle = styles.get(osm);
+                if(osm instanceof Way) {
+                    ((Way)osm).isMappaintArea = styles.isArea(osm);
+                }
+            }
+            return osm.mappaintStyle;
     }
 
@@ -106,8 +108,9 @@
             return (styles != null) ? styles.getIcon(osm) : null;
 
-        if(osm.mappaintStyle == null && styles != null)
-            osm.mappaintStyle = styles.getIcon(osm);
-
-        return (IconElemStyle)osm.mappaintStyle;
+            if(osm.mappaintStyle == null && styles != null) {
+                osm.mappaintStyle = styles.getIcon(osm);
+            }
+
+            return (IconElemStyle)osm.mappaintStyle;
     }
 
@@ -129,10 +132,11 @@
      * @param n The node to draw.
      */
+    @Override
     public void visit(Node n) {
         /* check, if the node is visible at all */
         if((n.getEastNorth().east()  > maxEN.east() ) ||
-           (n.getEastNorth().north() > maxEN.north()) ||
-           (n.getEastNorth().east()  < minEN.east() ) ||
-           (n.getEastNorth().north() < minEN.north()))
+                (n.getEastNorth().north() > maxEN.north()) ||
+                (n.getEastNorth().east()  < minEN.east() ) ||
+                (n.getEastNorth().north() < minEN.north()))
         {
             n.mappaintVisibleCode = viewid;
@@ -146,14 +150,15 @@
         //    return;
 
-        if (nodeStyle != null && isZoomOk(nodeStyle) && showIcons > dist)
+        if (nodeStyle != null && isZoomOk(nodeStyle) && showIcons > dist) {
             drawNode(n, nodeStyle.icon, nodeStyle.annotate, n.isSelected());
-        else if (n.highlighted)
+        } else if (n.highlighted) {
             drawNode(n, highlightColor, selectedNodeSize, selectedNodeRadius, fillSelectedNode);
-        else if (n.isSelected())
+        } else if (n.isSelected()) {
             drawNode(n, selectedColor, selectedNodeSize, selectedNodeRadius, fillSelectedNode);
-        else if (n.isTagged())
+        } else if (n.isTagged()) {
             drawNode(n, nodeColor, taggedNodeSize, taggedNodeRadius, fillUnselectedNode);
-        else
+        } else {
             drawNode(n, nodeColor, unselectedNodeSize, unselectedNodeRadius, fillUnselectedNode);
+        }
     }
 
@@ -162,4 +167,5 @@
      * @param w The way to draw.
      */
+    @Override
     public void visit(Way w) {
         if(w.getNodesCount() < 2)
@@ -177,14 +183,22 @@
         for (Node n : w.getNodes())
         {
-            if(n.getEastNorth().east() > maxx) maxx = n.getEastNorth().east();
-            if(n.getEastNorth().north() > maxy) maxy = n.getEastNorth().north();
-            if(n.getEastNorth().east() < minx) minx = n.getEastNorth().east();
-            if(n.getEastNorth().north() < miny) miny = n.getEastNorth().north();
+            if(n.getEastNorth().east() > maxx) {
+                maxx = n.getEastNorth().east();
+            }
+            if(n.getEastNorth().north() > maxy) {
+                maxy = n.getEastNorth().north();
+            }
+            if(n.getEastNorth().east() < minx) {
+                minx = n.getEastNorth().east();
+            }
+            if(n.getEastNorth().north() < miny) {
+                miny = n.getEastNorth().north();
+            }
         }
 
         if ((minx > maxEN.east()) ||
-            (miny > maxEN.north()) ||
-            (maxx < minEN.east()) ||
-            (maxy < minEN.north()))
+                (miny > maxEN.north()) ||
+                (maxx < minEN.east()) ||
+                (maxy < minEN.north()))
         {
             w.mappaintVisibleCode = viewid;
@@ -201,6 +215,7 @@
 
         w.mappaintVisibleCode = 0;
-        if(fillAreas > dist)
+        if(fillAreas > dist) {
             w.clearErrors();
+        }
 
         if(wayStyle==null)
@@ -226,8 +241,9 @@
             if (fillAreas > dist)
             {
-            //    profilerVisibleAreas++;
+                //    profilerVisibleAreas++;
                 drawArea(w, w.isSelected() ? selectedColor : areaStyle.color);
-                if(!w.isClosed())
+                if(!w.isClosed()) {
                     w.putError(tr("Area style way is not closed."), true);
+                }
             }
             drawWay(w, areaStyle.line, areaStyle.color, w.isSelected());
@@ -241,5 +257,5 @@
            (even if the tag is negated as in oneway=false) or the way is selected */
         boolean showDirection = w.isSelected() || ((!useRealWidth) && (showDirectionArrow
-        && (!showRelevantDirectionsOnly || w.hasDirectionKeys())));
+                && (!showRelevantDirectionsOnly || w.hasDirectionKeys())));
         /* head only takes over control if the option is true,
            the direction should be shown at all and not only because it's selected */
@@ -253,5 +269,7 @@
         if(l != null)
         {
-            if (l.color != null) color = l.color;
+            if (l.color != null) {
+                color = l.color;
+            }
             width = l.width;
             realWidth = l.realWidth;
@@ -259,10 +277,13 @@
             dashedColor = l.dashedColor;
         }
-        if(selected)
+        if(selected) {
             color = selectedColor;
+        }
         if (realWidth > 0 && useRealWidth && !showDirection)
         {
             int tmpWidth = (int) (100 /  (float) (circum / realWidth));
-            if (tmpWidth > width) width = tmpWidth;
+            if (tmpWidth > width) {
+                width = tmpWidth;
+            }
 
             /* if we have a "width" tag, try use it */
@@ -281,8 +302,9 @@
         }
 
-        if(w.highlighted)
+        if(w.highlighted) {
             color = highlightColor;
-        else if(w.isSelected())
+        } else if(w.isSelected()) {
             color = selectedColor;
+        }
 
         /* draw overlays under the way */
@@ -299,5 +321,5 @@
                         {
                             drawSeg(lastN, n, s.color != null  && !w.isSelected() ? s.color : color,
-                            false, s.getWidth(width), s.dashed, s.dashedColor);
+                                    false, s.getWidth(width), s.dashed, s.dashedColor);
                         }
                         lastN = n;
@@ -313,7 +335,8 @@
         {
             Node n = it.next();
-            if(lastN != null)
+            if(lastN != null) {
                 drawSeg(lastN, n, color,
-                    showOnlyHeadArrowOnly ? !it.hasNext() : showDirection, width, dashed, dashedColor);
+                        showOnlyHeadArrowOnly ? !it.hasNext() : showDirection, width, dashed, dashedColor);
+            }
             lastN = n;
         }
@@ -332,5 +355,5 @@
                         {
                             drawSeg(lastN, n, s.color != null && !w.isSelected() ? s.color : color,
-                            false, s.getWidth(width), s.dashed, s.dashedColor);
+                                    false, s.getWidth(width), s.dashed, s.dashedColor);
                         }
                         lastN = n;
@@ -386,16 +409,26 @@
                             {
                                 nl = w.getNodesCount()-1;
-                                if(w.getNode(nl) == c.getNode(0)) mode = 21;
-                                else if(w.getNode(nl) == c.getNode(cl)) mode = 22;
-                                else if(w.getNode(0) == c.getNode(0)) mode = 11;
-                                else if(w.getNode(0) == c.getNode(cl)) mode = 12;
+                                if(w.getNode(nl) == c.getNode(0)) {
+                                    mode = 21;
+                                } else if(w.getNode(nl) == c.getNode(cl)) {
+                                    mode = 22;
+                                } else if(w.getNode(0) == c.getNode(0)) {
+                                    mode = 11;
+                                } else if(w.getNode(0) == c.getNode(cl)) {
+                                    mode = 12;
+                                }
                             }
                             else
                             {
                                 nl = n.size()-1;
-                                if(n.get(nl) == c.getNode(0)) mode = 21;
-                                else if(n.get(0) == c.getNode(cl)) mode = 12;
-                                else if(n.get(0) == c.getNode(0)) mode = 11;
-                                else if(n.get(nl) == c.getNode(cl)) mode = 22;
+                                if(n.get(nl) == c.getNode(0)) {
+                                    mode = 21;
+                                } else if(n.get(0) == c.getNode(cl)) {
+                                    mode = 12;
+                                } else if(n.get(0) == c.getNode(0)) {
+                                    mode = 11;
+                                } else if(n.get(nl) == c.getNode(cl)) {
+                                    mode = 22;
+                                }
                             }
                             if(mode != 0)
@@ -403,21 +436,27 @@
                                 joinArray[i] = null;
                                 joined = true;
-                                if(c.isSelected()) selected = true;
+                                if(c.isSelected()) {
+                                    selected = true;
+                                }
                                 --left;
-                                if(n == null) n = w.getNodes();
+                                if(n == null) {
+                                    n = w.getNodes();
+                                }
                                 n.remove((mode == 21 || mode == 22) ? nl : 0);
-                                if(mode == 21)
+                                if(mode == 21) {
                                     n.addAll(c.getNodes());
-                                else if(mode == 12)
+                                } else if(mode == 12) {
                                     n.addAll(0, c.getNodes());
-                                else if(mode == 22)
+                                } else if(mode == 22)
                                 {
-                                    for(Node node : c.getNodes())
+                                    for(Node node : c.getNodes()) {
                                         n.add(nl, node);
+                                    }
                                 }
                                 else /* mode == 11 */
                                 {
-                                    for(Node node : c.getNodes())
+                                    for(Node node : c.getNodes()) {
                                         n.add(0, node);
+                                    }
                                 }
                             }
@@ -437,5 +476,5 @@
                 {
                     errs.putError(tr("multipolygon way ''{0}'' is not closed.",
-                    w.getName()), true);
+                            w.getDisplayName(DefaultNameFormatter.getInstance())), true);
                 }
             }
@@ -447,5 +486,5 @@
 
     public void drawSelectedMember(OsmPrimitive osm, ElemStyle style, Boolean area,
-    Boolean areaselected)
+            Boolean areaselected)
     {
         if(osm instanceof Way)
@@ -456,6 +495,7 @@
                 AreaElemStyle areaStyle = (AreaElemStyle)style;
                 drawWay(way, areaStyle.line, selectedColor, true);
-                if(area)
+                if(area) {
                     drawArea(way, areaselected ? selectedColor : areaStyle.color);
+                }
             }
             else
@@ -466,13 +506,15 @@
         else if(osm instanceof Node)
         {
-            if(style != null && isZoomOk(style))
+            if(style != null && isZoomOk(style)) {
                 drawNode((Node)osm, ((IconElemStyle)style).icon,
-                ((IconElemStyle)style).annotate, true);
-            else
+                        ((IconElemStyle)style).annotate, true);
+            } else {
                 drawNode((Node)osm, selectedColor, selectedNodeSize, selectedNodeRadius, fillSelectedNode);
+            }
         }
         osm.mappaintDrawnCode = paintid;
     }
 
+    @Override
     public void visit(Relation r) {
 
@@ -497,5 +539,5 @@
         {
             if(drawMultipolygon(r))
-              return;
+                return;
         }
         else if (drawRestriction && "restriction".equals(r.get("type")))
@@ -511,5 +553,5 @@
                 {
                     drawSelectedMember(m.getMember(), styles != null ? getPrimitiveStyle(m.getMember())
-                    : null, true, true);
+                            : null, true, true);
                 }
             }
@@ -535,14 +577,12 @@
             //    System.out.println("member " + m.member + " selected " + r.selected);
 
-            if(m.getMember() == null)
+            if(m.getMember() == null) {
                 // TODO Nullable member will not be allowed after RelationMember.member is encalupsed
                 r.putError(tr("Empty member in relation."), true);
-            else if(m.getMember().deleted)
+            } else if(m.getMember().deleted) {
                 r.putError(tr("Deleted member ''{0}'' in relation.",
-                m.getMember().getName()), true);
-            else if(m.getMember().incomplete)
-            {
+                        m.getMember().getDisplayName(DefaultNameFormatter.getInstance())), true);
+            } else if(m.getMember().incomplete)
                 return;
-            }
             else
             {
@@ -553,26 +593,27 @@
                     {
                         r.putError(tr("Way ''{0}'' with less than two points.",
-                        w.getName()), true);
+                                w.getDisplayName(DefaultNameFormatter.getInstance())), true);
                     }
                     else if("from".equals(m.getRole())) {
-                        if(fromWay != null)
+                        if(fromWay != null) {
                             r.putError(tr("More than one \"from\" way found."), true);
-                        else {
+                        } else {
                             fromWay = w;
                         }
                     } else if("to".equals(m.getRole())) {
-                        if(toWay != null)
+                        if(toWay != null) {
                             r.putError(tr("More than one \"to\" way found."), true);
-                        else {
+                        } else {
                             toWay = w;
                         }
                     } else if("via".equals(m.getRole())) {
-                        if(via != null)
+                        if(via != null) {
                             r.putError(tr("More than one \"via\" found."), true);
-                        else
+                        } else {
                             via = w;
-                    }
-                    else
+                        }
+                    } else {
                         r.putError(tr("Unknown role ''{0}''.", m.getRole()), true);
+                    }
                 }
                 else if(m.isNode())
@@ -581,14 +622,15 @@
                     if("via".equals(m.getRole()))
                     {
-                        if(via != null)
+                        if(via != null) {
                             r.putError(tr("More than one \"via\" found."), true);
-                        else
+                        } else {
                             via = n;
-                    }
-                    else
+                        }
+                    } else {
                         r.putError(tr("Unknown role ''{0}''.", m.getRole()), true);
-                }
-                else
-                    r.putError(tr("Unknown member type for ''{0}''.", m.getMember().getName()), true);
+                    }
+                } else {
+                    r.putError(tr("Unknown member type for ''{0}''.", m.getMember().getDisplayName(DefaultNameFormatter.getInstance())), true);
+                }
             }
         }
@@ -615,6 +657,7 @@
                 return;
             }
-            if(!toWay.isFirstLastNode(viaNode))
+            if(!toWay.isFirstLastNode(viaNode)) {
                 r.putError(tr("The \"to\" way doesn't start or end at a \"via\" node."), true);
+            }
         }
         else
@@ -623,14 +666,15 @@
             Node firstNode = viaWay.firstNode();
             Node lastNode = viaWay.lastNode();
-            if(fromWay.isFirstLastNode(firstNode))
+            if(fromWay.isFirstLastNode(firstNode)) {
                 viaNode = firstNode;
-            else if(fromWay.isFirstLastNode(lastNode))
+            } else if(fromWay.isFirstLastNode(lastNode)) {
                 viaNode = firstNode;
-            else {
+            } else {
                 r.putError(tr("The \"from\" way doesn't start or end at the \"via\" way."), true);
                 return;
             }
-            if(!toWay.isFirstLastNode(viaNode == firstNode ? lastNode : firstNode))
+            if(!toWay.isFirstLastNode(viaNode == firstNode ? lastNode : firstNode)) {
                 r.putError(tr("The \"to\" way doesn't start or end at the \"via\" way."), true);
+            }
         }
 
@@ -675,5 +719,5 @@
            (calculate the vector vx/vy with the specified length and the direction
            away from the "via" node along the first segment of the "from" way)
-        */
+         */
         double distanceFromVia=14;
         double dx = (pFrom.x >= pVia.x) ? (pFrom.x - pVia.x) : (pVia.x - pFrom.x);
@@ -691,6 +735,10 @@
         double vy = distanceFromVia * Math.sin(fromAngle);
 
-        if(pFrom.x < pVia.x) vx = -vx;
-        if(pFrom.y < pVia.y) vy = -vy;
+        if(pFrom.x < pVia.x) {
+            vx = -vx;
+        }
+        if(pFrom.y < pVia.y) {
+            vy = -vy;
+        }
 
         //if(restrictionDebug)
@@ -700,5 +748,5 @@
            (calculate the vx2/vy2 vector with the specified length and the direction
            90degrees away from the first segment of the "from" way)
-        */
+         */
         double distanceFromWay=10;
         double vx2 = 0;
@@ -740,5 +788,5 @@
                 vx2 = distanceFromWay * Math.sin(Math.toRadians(fromAngleDeg + 180));
                 vy2 = distanceFromWay * Math.cos(Math.toRadians(fromAngleDeg + 180));
-             } else {
+            } else {
                 vx2 = distanceFromWay * Math.sin(Math.toRadians(fromAngleDeg));
                 vy2 = distanceFromWay * Math.cos(Math.toRadians(fromAngleDeg));
@@ -783,13 +831,13 @@
         for (RelationMember m : r.getMembers())
         {
-            if(m.getMember() == null)
+            if(m.getMember() == null) {
                 //TODO Remove useless nullcheck when RelationMember.member is encalupsed
                 r.putError(tr("Empty member in relation."), true);
-            else if(m.getMember().deleted)
+            } else if(m.getMember().deleted) {
                 r.putError(tr("Deleted member ''{0}'' in relation.",
-                m.getMember().getName()), true);
-            else if(m.getMember().incomplete)
+                        m.getMember().getDisplayName(DefaultNameFormatter.getInstance())), true);
+            } else if(m.getMember().incomplete) {
                 incomplete = true;
-            else
+            } else
             {
                 if(m.isWay())
@@ -799,19 +847,20 @@
                     {
                         r.putError(tr("Way ''{0}'' with less than two points.",
-                        w.getName()), true);
-                    }
-                    else if("inner".equals(m.getRole()))
+                                w.getDisplayName(DefaultNameFormatter.getInstance())), true);
+                    }
+                    else if("inner".equals(m.getRole())) {
                         inner.add(w);
-                    else if("outer".equals(m.getRole()))
+                    } else if("outer".equals(m.getRole())) {
                         outer.add(w);
-                    else
+                    } else
                     {
                         r.putError(tr("No useful role ''{0}'' for Way ''{1}''.",
-                          m.getRole(), w.getName()), true);
-                        if(!m.hasRole())
+                                m.getRole(), w.getDisplayName(DefaultNameFormatter.getInstance())), true);
+                        if(!m.hasRole()) {
                             outer.add(w);
-                        else if(r.isSelected())
+                        } else if(r.isSelected()) {
                             drawSelectedMember(m.getMember(), styles != null
-                            ? getPrimitiveStyle(m.getMember()) : null, true, true);
+                                    ? getPrimitiveStyle(m.getMember()) : null, true, true);
+                        }
                     }
                 }
@@ -819,5 +868,5 @@
                 {
                     r.putError(tr("Non-Way ''{0}'' in multipolygon.",
-                    m.getMember().getName()), true);
+                            m.getMember().getDisplayName(DefaultNameFormatter.getInstance())), true);
                 }
             }
@@ -829,6 +878,7 @@
             for (Way w : outer)
             {
-               if(wayStyle == null)
-                   wayStyle = styles.getArea(w);
+                if(wayStyle == null) {
+                    wayStyle = styles.getArea(w);
+                }
             }
             r.mappaintStyle = wayStyle;
@@ -844,11 +894,15 @@
             for (Way w : outer)
             {
-                if(w.isClosed()) outerclosed.add(w);
-                else join.add(w);
+                if(w.isClosed()) {
+                    outerclosed.add(w);
+                } else {
+                    join.add(w);
+                }
             }
             if(join.size() != 0)
             {
-                for(Way w : joinWays(join, incomplete ? null : r))
+                for(Way w : joinWays(join, incomplete ? null : r)) {
                     outerclosed.add(w);
+                }
             }
 
@@ -856,11 +910,15 @@
             for (Way w : inner)
             {
-                if(w.isClosed()) innerclosed.add(w);
-                else join.add(w);
+                if(w.isClosed()) {
+                    innerclosed.add(w);
+                } else {
+                    join.add(w);
+                }
             }
             if(join.size() != 0)
             {
-                for(Way w : joinWays(join, incomplete ? null : r))
+                for(Way w : joinWays(join, incomplete ? null : r)) {
                     innerclosed.add(w);
+                }
             }
 
@@ -868,5 +926,5 @@
             {
                 r.putError(tr("No outer way for multipolygon ''{0}''.",
-                r.getName()), true);
+                        r.getDisplayName(DefaultNameFormatter.getInstance())), true);
                 visible = true; /* prevent killing remaining ways */
             }
@@ -892,6 +950,7 @@
                         for(int i = 0; i < p.npoints; ++i)
                         {
-                            if(poly.contains(p.xpoints[i],p.ypoints[i]))
+                            if(poly.contains(p.xpoints[i],p.ypoints[i])) {
                                 --contains;
+                            }
                         }
                         if(contains == 0) return 1;
@@ -901,6 +960,7 @@
                     public void addInner(Polygon p)
                     {
-                        if(inner == null)
+                        if(inner == null) {
                             inner = new ArrayList<Polygon>();
+                        }
                         inner.add(p);
                     }
@@ -908,6 +968,6 @@
                     {
                         return (poly.npoints >= 3
-                        && poly.xpoints[0] == poly.xpoints[poly.npoints-1]
-                        && poly.ypoints[0] == poly.ypoints[poly.npoints-1]);
+                                && poly.xpoints[0] == poly.xpoints[poly.npoints-1]
+                                                                   && poly.ypoints[0] == poly.ypoints[poly.npoints-1]);
                     }
                     public Polygon get()
@@ -917,6 +977,7 @@
                             for (Polygon pp : inner)
                             {
-                                for(int i = 0; i < pp.npoints; ++i)
+                                for(int i = 0; i < pp.npoints; ++i) {
                                     poly.addPoint(pp.xpoints[i],pp.ypoints[i]);
+                                }
                                 poly.addPoint(p.x,p.y);
                             }
@@ -954,8 +1015,9 @@
                             {
                                 r.putError(tr("Intersection between ways ''{0}'' and ''{1}''.",
-                                pd.way.getName(), wInner.getName()), true);
+                                        pd.way.getDisplayName(DefaultNameFormatter.getInstance()), wInner.getDisplayName(DefaultNameFormatter.getInstance())), true);
                             }
-                            if(o == null || o.contains(pd.poly) > 0)
+                            if(o == null || o.contains(pd.poly) > 0) {
                                 o = pd;
+                            }
                         }
                     }
@@ -965,5 +1027,5 @@
                         {
                             r.putError(tr("Inner way ''{0}'' is outside.",
-                            wInner.getName()), true);
+                                    wInner.getDisplayName(DefaultNameFormatter.getInstance())), true);
                         }
                         o = poly.get(0);
@@ -978,5 +1040,5 @@
                     {
                         drawAreaPolygon(p, (pd.way.isSelected() || r.isSelected()) ? selectedColor
-                        : areaStyle.color);
+                                : areaStyle.color);
                         visible = true;
                     }
@@ -986,8 +1048,10 @@
             {
                 r.mappaintVisibleCode = viewid;
-                for (Way wInner : inner)
+                for (Way wInner : inner) {
                     wInner.mappaintVisibleCode = viewid;
-                for (Way wOuter : outer)
+                }
+                for (Way wOuter : outer) {
                     wOuter.mappaintVisibleCode = viewid;
+                }
                 return drawn;
             }
@@ -998,9 +1062,9 @@
                 {
                     if(zoomok && (wInner.mappaintDrawnCode != paintid
-                    || outer.size() == 0))
+                            || outer.size() == 0))
                     {
                         drawWay(wInner, ((AreaElemStyle)wayStyle).line,
-                        ((AreaElemStyle)wayStyle).color, wInner.isSelected()
-                        || r.isSelected());
+                                ((AreaElemStyle)wayStyle).color, wInner.isSelected()
+                                || r.isSelected());
                     }
                     wInner.mappaintDrawnCode = paintid;
@@ -1011,12 +1075,13 @@
                     {
                         drawSelectedMember(wInner, innerStyle,
-                        !wayStyle.equals(innerStyle), wInner.isSelected());
+                                !wayStyle.equals(innerStyle), wInner.isSelected());
                     }
                     if(wayStyle.equals(innerStyle))
                     {
                         r.putError(tr("Style for inner way ''{0}'' equals multipolygon.",
-                        wInner.getName()), false);
-                        if(!r.isSelected())
+                                wInner.getDisplayName(DefaultNameFormatter.getInstance())), false);
+                        if(!r.isSelected()) {
                             wInner.mappaintDrawnAreaCode = paintid;
+                        }
                     }
                 }
@@ -1030,6 +1095,6 @@
                     {
                         drawWay(wOuter, ((AreaElemStyle)wayStyle).line,
-                        ((AreaElemStyle)wayStyle).color, wOuter.isSelected()
-                        || r.isSelected());
+                                ((AreaElemStyle)wayStyle).color, wOuter.isSelected()
+                                || r.isSelected());
                     }
                     wOuter.mappaintDrawnCode = paintid;
@@ -1038,8 +1103,8 @@
                 {
                     if(outerStyle instanceof AreaElemStyle
-                    && !wayStyle.equals(outerStyle))
+                            && !wayStyle.equals(outerStyle))
                     {
                         r.putError(tr("Style for outer way ''{0}'' mismatches.",
-                        wOuter.getName()), true);
+                                wOuter.getDisplayName(DefaultNameFormatter.getInstance())), true);
                     }
                     if(r.isSelected())
@@ -1047,6 +1112,7 @@
                         drawSelectedMember(wOuter, outerStyle, false, false);
                     }
-                    else if(outerStyle instanceof AreaElemStyle)
+                    else if(outerStyle instanceof AreaElemStyle) {
                         wOuter.mappaintDrawnAreaCode = paintid;
+                    }
                 }
             }
@@ -1115,5 +1181,7 @@
             for (String rn : regionalNameOrder) {
                 name = n.get(rn);
-                if (name != null) break;
+                if (name != null) {
+                    break;
+                }
             }
         }
@@ -1129,7 +1197,6 @@
         Point p2 = nc.getPoint(n2);
 
-        if (!isSegmentVisible(p1, p2)) {
+        if (!isSegmentVisible(p1, p2))
             return;
-        }
         //profilerVisibleSegments++;
         currentPath.moveTo(p1.x, p1.y);
@@ -1144,4 +1211,5 @@
     }
 
+    @Override
     protected void displaySegments() {
         displaySegments(null, 0, new float[0], null);
@@ -1159,7 +1227,7 @@
                         g2d.setStroke(new BasicStroke(currentWidth,BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND));
                     }
-                }
-                else
+                } else {
                     g2d.setStroke(new BasicStroke(currentWidth,BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND));
+                }
             }
             g2d.draw(currentPath);
@@ -1178,13 +1246,14 @@
                             g2d.setStroke(new BasicStroke(currentWidth,BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND));
                         }
-                    }
-                    else
+                    } else {
                         g2d.setStroke(new BasicStroke(currentWidth,BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND));
+                    }
                 }
                 g2d.draw(currentPath);
             }
 
-            if(useStrokes > dist)
+            if(useStrokes > dist) {
                 g2d.setStroke(new BasicStroke(1));
+            }
 
             currentPath = new GeneralPath();
@@ -1203,4 +1272,5 @@
      * @param color The color of the node.
      */
+    @Override
     public void drawNode(Node n, Color color, int size, int radius, boolean fill) {
         if (isZoomOk(null) && size > 1) {
@@ -1216,6 +1286,7 @@
                 g.fillRect(p.x - radius, p.y - radius, size, size);
                 g.drawRect(p.x - radius, p.y - radius, size, size);
-            } else
+            } else {
                 g.drawRect(p.x - radius, p.y - radius, size, size);
+            }
 
             if(showNames > dist)
@@ -1234,4 +1305,5 @@
     }
 
+    @Override
     public void getColors()
     {
@@ -1242,4 +1314,5 @@
 
     /* Shows areas before non-areas */
+    @Override
     public void visitAll(DataSet data, Boolean virtual) {
 
@@ -1303,5 +1376,5 @@
 
             /*** RELATIONS ***/
-        //    profilerN = 0;
+            //    profilerN = 0;
             for (final Relation osm : data.relations)
             {
@@ -1309,71 +1382,72 @@
                 {
                     osm.visit(this);
-        //            profilerN++;
-                }
-            }
-
-        //    if(profiler)
-        //    {
-        //        System.out.format("Relations: %5dms, calls=%7d\n", (java.lang.System.currentTimeMillis()-profilerLast), profilerN);
-        //        profilerLast = java.lang.System.currentTimeMillis();
-        //    }
+                    //            profilerN++;
+                }
+            }
+
+            //    if(profiler)
+            //    {
+            //        System.out.format("Relations: %5dms, calls=%7d\n", (java.lang.System.currentTimeMillis()-profilerLast), profilerN);
+            //        profilerLast = java.lang.System.currentTimeMillis();
+            //    }
 
             /*** AREAS ***/
-        //    profilerN = 0;
+            //    profilerN = 0;
             for (final Way osm : data.ways)
             {
                 if (!osm.incomplete && !osm.deleted
-                && osm.mappaintVisibleCode != viewid && osm.mappaintDrawnCode != paintid)
+                        && osm.mappaintVisibleCode != viewid && osm.mappaintDrawnCode != paintid)
                 {
                     if(isPrimitiveArea(osm) && osm.mappaintDrawnAreaCode != paintid)
                     {
                         osm.visit(this);
-        //                profilerN++;
-                    } else
+                        //                profilerN++;
+                    } else {
                         noAreaWays.add(osm);
-                }
-            }
-
-        //    if(profiler)
-        //    {
-        //        System.out.format("Areas    : %5dms, calls=%7d, visible=%d\n",
-        //            (java.lang.System.currentTimeMillis()-profilerLast), profilerN, profilerVisibleAreas);
-        //        profilerLast = java.lang.System.currentTimeMillis();
-        //    }
+                    }
+                }
+            }
+
+            //    if(profiler)
+            //    {
+            //        System.out.format("Areas    : %5dms, calls=%7d, visible=%d\n",
+            //            (java.lang.System.currentTimeMillis()-profilerLast), profilerN, profilerVisibleAreas);
+            //        profilerLast = java.lang.System.currentTimeMillis();
+            //    }
 
             /*** WAYS ***/
-        //    profilerN = 0;
+            //    profilerN = 0;
             fillAreas = 0;
             for (final OsmPrimitive osm : noAreaWays)
             {
                 osm.visit(this);
-        //        profilerN++;
-            }
-
-        //    if(profiler)
-        //    {
-        //        System.out.format("Ways     : %5dms, calls=%7d, visible=%d\n",
-        //            (java.lang.System.currentTimeMillis()-profilerLast), profilerN, profilerVisibleWays);
-        //        profilerLast = java.lang.System.currentTimeMillis();
-        //    }
+                //        profilerN++;
+            }
+
+            //    if(profiler)
+            //    {
+            //        System.out.format("Ways     : %5dms, calls=%7d, visible=%d\n",
+            //            (java.lang.System.currentTimeMillis()-profilerLast), profilerN, profilerVisibleWays);
+            //        profilerLast = java.lang.System.currentTimeMillis();
+            //    }
         }
         else
         {
             /*** WAYS (filling disabled)  ***/
-        //    profilerN = 0;
+            //    profilerN = 0;
             for (final OsmPrimitive osm : data.ways)
                 if (!osm.incomplete && !osm.deleted && !osm.isSelected()
-                && osm.mappaintVisibleCode != viewid )
+                        && osm.mappaintVisibleCode != viewid )
                 {
                     osm.visit(this);
-        //            profilerN++;
-                }
-
-        //    if(profiler)
-        //    {
-        //        System.out.format("Ways     : %5dms, calls=%7d, visible=%d\n",
-        //            (java.lang.System.currentTimeMillis()-profilerLast), profilerN, profilerVisibleWays);
-        //        profilerLast = java.lang.System.currentTimeMillis();
-        //    }
+                    //            profilerN++;
+                }
+
+            //    if(profiler)
+            //    {
+            //        System.out.format("Ways     : %5dms, calls=%7d, visible=%d\n",
+            //            (java.lang.System.currentTimeMillis()-profilerLast), profilerN, profilerVisibleWays);
+            //        profilerLast = java.lang.System.currentTimeMillis();
+            //    }
         }
 
@@ -1383,8 +1457,8 @@
         for (final OsmPrimitive osm : data.getSelected()) {
             if (!osm.incomplete && !osm.deleted && !(osm instanceof Node)
-            && osm.mappaintVisibleCode != viewid && osm.mappaintDrawnCode != paintid)
+                    && osm.mappaintVisibleCode != viewid && osm.mappaintDrawnCode != paintid)
             {
                 osm.visit(this);
-        //        profilerN++;
+                //        profilerN++;
             }
         }
@@ -1403,8 +1477,8 @@
         for (final OsmPrimitive osm : data.nodes)
             if (!osm.incomplete && !osm.deleted
-            && osm.mappaintVisibleCode != viewid && osm.mappaintDrawnCode != paintid)
+                    && osm.mappaintVisibleCode != viewid && osm.mappaintDrawnCode != paintid)
             {
                 osm.visit(this);
-        //        profilerN++;
+                //        profilerN++;
             }
 
@@ -1419,21 +1493,21 @@
         if (virtualNodeSize != 0)
         {
-        //    profilerN = 0;
+            //    profilerN = 0;
             currentColor = nodeColor;
             for (final OsmPrimitive osm : data.ways)
                 if (!osm.incomplete && !osm.deleted
-                && osm.mappaintVisibleCode != viewid )
+                        && osm.mappaintVisibleCode != viewid )
                 {
                     /* TODO: move this into the SimplePaint code? */
-        //            if(!profilerOmitDraw)
-                        visitVirtual((Way)osm);
-        //            profilerN++;
-                }
-
-        //    if(profiler)
-        //    {
-        //        System.out.format("Virtual  : %5dms, calls=%7d\n", (java.lang.System.currentTimeMillis()-profilerLast), profilerN);
-        //        profilerLast = java.lang.System.currentTimeMillis();
-        //    }
+                    //            if(!profilerOmitDraw)
+                    visitVirtual((Way)osm);
+                    //            profilerN++;
+                }
+
+            //    if(profiler)
+            //    {
+            //        System.out.format("Virtual  : %5dms, calls=%7d\n", (java.lang.System.currentTimeMillis()-profilerLast), profilerN);
+            //        profilerLast = java.lang.System.currentTimeMillis();
+            //    }
 
             displaySegments(null);
Index: /trunk/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java	(revision 1990)
+++ /trunk/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java	(revision 1990)
@@ -0,0 +1,197 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.gui;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+import static org.openstreetmap.josm.tools.I18n.trn;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.data.coor.CoordinateFormat;
+import org.openstreetmap.josm.data.osm.Changeset;
+import org.openstreetmap.josm.data.osm.NameFormatter;
+import org.openstreetmap.josm.data.osm.Node;
+import org.openstreetmap.josm.data.osm.OsmPrimitive;
+import org.openstreetmap.josm.data.osm.Relation;
+import org.openstreetmap.josm.data.osm.Way;
+
+/**
+ * This is the default implementation of a {@see NameFormatter} for names of {@see OsmPrimitive}s.
+ *
+ */
+public class DefaultNameFormatter implements NameFormatter {
+
+    static private DefaultNameFormatter instance;
+
+    /**
+     * Replies the unique instance of this formatter
+     * 
+     * @return the unique instance of this formatter
+     */
+    static public DefaultNameFormatter getInstance() {
+        if (instance == null) {
+            instance = new DefaultNameFormatter();
+        }
+        return instance;
+    }
+
+    /** the default list of tags which are used as naming tags in relations */
+    static public final String[] DEFAULT_NAMING_TAGS_FOR_RELATIONS = {"name", "ref", "restriction", "note"};
+
+    /** the current list of tags used as naming tags in relations */
+    static private List<String> namingTagsForRelations =  null;
+
+    /**
+     * Replies the list of naming tags used in relations. The list is given (in this order) by:
+     * <ul>
+     *   <li>by the tag names in the preference <tt>relation.nameOrder</tt></li>
+     *   <li>by the default tags in {@see #DEFAULT_NAMING_TAGS_FOR_RELATIONS}
+     * </ul>
+     * 
+     * @return the list of naming tags used in relations
+     */
+    static public List<String> getNamingtagsForRelations() {
+        if (namingTagsForRelations == null) {
+            namingTagsForRelations = new ArrayList<String>(
+                    Main.pref.getCollection("relation.nameOrder", Arrays.asList(DEFAULT_NAMING_TAGS_FOR_RELATIONS))
+            );
+        }
+        return namingTagsForRelations;
+    }
+
+
+    /**
+     * Decorates the name of primitive with its id, if the preference
+     * <tt>osm-primitives.showid</tt> is set.
+     * 
+     * @param name  the name without the id
+     * @param primitive the primitive
+     * @return the decorated name
+     */
+    protected String decorateNameWithId(String name, OsmPrimitive primitive) {
+        if (Main.pref.getBoolean("osm-primitives.showid"))
+            return name + tr(" [id: {0}]", primitive.id);
+        else
+            return name;
+    }
+
+    /**
+     * Formats a name for a node
+     * 
+     * @param node the node
+     * @return the name
+     */
+    public String format(Node node) {
+        String name = "";
+        if (node.incomplete) {
+            name = tr("incomplete");
+        } else {
+            if (Main.pref.getBoolean("osm-primitives.localize-name", true)) {
+                name = node.getLocalName();
+            } else {
+                name = node.getName();
+            }
+            if (name == null) {
+                name = node.id == 0 ? tr("node") : ""+ node.id;
+            }
+            name += " (" + node.getCoor().latToString(CoordinateFormat.getDefaultFormat()) + ", " + node.getCoor().lonToString(CoordinateFormat.getDefaultFormat()) + ")";
+        }
+        name = decorateNameWithId(name, node);
+        return name;
+    }
+
+    /**
+     * Formats a name for a way
+     * 
+     * @param way the way
+     * @return the name
+     */
+    public String format(Way way) {
+        String name = "";
+        if (way.incomplete) {
+            name = tr("incomplete");
+        } else {
+            if (Main.pref.getBoolean("osm-primitives.localize-name", true)) {
+                name = way.getLocalName();
+            } else {
+                name = way.getName();
+            }
+            if (name == null) {
+                name = way.get("ref");
+            }
+            if (name == null) {
+                name =
+                    (way.get("highway") != null) ? tr("highway") :
+                        (way.get("railway") != null) ? tr("railway") :
+                            (way.get("waterway") != null) ? tr("waterway") :
+                                (way.get("landuse") != null) ? tr("landuse") : "";
+            }
+
+            int nodesNo = new HashSet<Node>(way.getNodes()).size();
+            String nodes = trn("{0} node", "{0} nodes", nodesNo, nodesNo);
+            name += (name.length() > 0) ? " ("+nodes+")" : nodes;
+            if(way.errors != null) {
+                name = "*"+name;
+            }
+        }
+        name = decorateNameWithId(name, way);
+        return name;
+    }
+
+    /**
+     * Formats a name for a relation
+     * 
+     * @param relation the relation
+     * @return the name
+     */
+    public String format(Relation relation) {
+        String name;
+        if (relation.incomplete) {
+            name = tr("incomplete");
+        } else {
+            name = relation.get("type");
+            if (name == null) {
+                name = tr("relation");
+            }
+
+            name += " (";
+            String nameTag = null;
+            for (String n : getNamingtagsForRelations()) {
+                if (n.equals("name")) {
+                    if (Main.pref.getBoolean("osm-primitives.localize-name", true)) {
+                        nameTag = relation.getLocalName();
+                    } else {
+                        nameTag = relation.getName();
+                    }
+                }
+                if (nameTag != null) {
+                    break;
+                }
+            }
+            if (nameTag != null) {
+                name += "\"" + nameTag + "\", ";
+            }
+
+            int mbno = relation.getMembersCount();
+            name += trn("{0} member", "{0} members", mbno, mbno) + ")";
+            if(relation.errors != null) {
+                name = "*"+name;
+            }
+        }
+        name = decorateNameWithId(name, relation);
+        return name;
+    }
+
+    /**
+     * Formats a name for a changeset
+     * 
+     * @param changeset the changeset
+     * @return the name
+     */
+    public String format(Changeset changeset) {
+        return tr("Changeset {0}",changeset.id);
+    }
+}
Index: /trunk/src/org/openstreetmap/josm/gui/MapStatus.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/MapStatus.java	(revision 1989)
+++ /trunk/src/org/openstreetmap/josm/gui/MapStatus.java	(revision 1990)
@@ -37,7 +37,6 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.HelpAction.Helpful;
+import org.openstreetmap.josm.data.coor.CoordinateFormat;
 import org.openstreetmap.josm.data.coor.LatLon;
-import org.openstreetmap.josm.data.coor.LatLon.CoordinateFormat;
-import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
@@ -59,5 +58,4 @@
  */
 public class MapStatus extends JPanel implements Helpful {
-    private static final PrimitiveNameFormatter NAME_FORMATTER = new PrimitiveNameFormatter();
 
     /**
@@ -163,5 +161,5 @@
                     osmNearest = mv.getNearest(ms.mousePos);
                     if (osmNearest != null) {
-                        nameText.setText(NAME_FORMATTER.getName(osmNearest));
+                        nameText.setText(osmNearest.getDisplayName(DefaultNameFormatter.getInstance()));
                     } else {
                         nameText.setText(tr("(no object)"));
@@ -195,7 +193,7 @@
                         for (final OsmPrimitive osm : osms) {
                             final StringBuilder text = new StringBuilder();
-                            String name = NAME_FORMATTER.getName(osm);
+                            String name = osm.getDisplayName(DefaultNameFormatter.getInstance());
                             if (osm.id == 0 || osm.modified) {
-                                name = "<i><b>"+ new PrimitiveNameFormatter().getName(osm)+"*</b></i>";
+                                name = "<i><b>"+ osm.getDisplayName(DefaultNameFormatter.getInstance())+"*</b></i>";
                             }
                             text.append(name);
@@ -283,5 +281,5 @@
                 // Do not update the view if ctrl is pressed.
                 if ((e.getModifiersEx() & MouseEvent.CTRL_DOWN_MASK) == 0) {
-                    CoordinateFormat mCord = Node.getCoordinateFormat();
+                    CoordinateFormat mCord = CoordinateFormat.getDefaultFormat();
                     LatLon p = mv.getLatLon(e.getX(),e.getY());
                     latText.setText(p.latToString(mCord));
Index: /trunk/src/org/openstreetmap/josm/gui/OsmPrimitivRenderer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/OsmPrimitivRenderer.java	(revision 1989)
+++ /trunk/src/org/openstreetmap/josm/gui/OsmPrimitivRenderer.java	(revision 1990)
@@ -25,6 +25,4 @@
  */
 public class OsmPrimitivRenderer implements ListCellRenderer, TableCellRenderer {
-    static private final PrimitiveNameFormatter NAME_FORMATTER = new PrimitiveNameFormatter();
-
     /**
      * Default list cell renderer - delegate for ListCellRenderer operation
@@ -62,5 +60,5 @@
     private Component renderer(Component def, OsmPrimitive value) {
         if (def != null && value != null && def instanceof JLabel) {
-            ((JLabel)def).setText(NAME_FORMATTER.getName(value));
+            ((JLabel)def).setText(value.getDisplayName(DefaultNameFormatter.getInstance()));
             ((JLabel)def).setIcon(ImageProvider.get(OsmPrimitiveType.from(value)));
         }
Index: unk/src/org/openstreetmap/josm/gui/PrimitiveNameFormatter.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/PrimitiveNameFormatter.java	(revision 1989)
+++ 	(revision )
@@ -1,17 +1,0 @@
-// License: GPL. For details, see LICENSE file.
-package org.openstreetmap.josm.gui;
-
-import static org.openstreetmap.josm.tools.I18n.tr;
-
-import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.data.osm.OsmPrimitive;
-
-public class PrimitiveNameFormatter {
-    public String getName(OsmPrimitive primitive) {
-        String name = primitive.getName();
-        if (Main.pref.getBoolean("osm-primitives.showid")) {
-            name += tr(" [id: {0}]", primitive.id);
-        }
-        return name;
-    }
-}
Index: /trunk/src/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListTableCellRenderer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListTableCellRenderer.java	(revision 1989)
+++ /trunk/src/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListTableCellRenderer.java	(revision 1990)
@@ -20,4 +20,5 @@
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
+import org.openstreetmap.josm.gui.DefaultNameFormatter;
 import org.openstreetmap.josm.gui.conflict.pair.ListMergeModel;
 import org.openstreetmap.josm.tools.ImageProvider;
@@ -130,5 +131,5 @@
             }
         }
-        setText(node.getName());
+        setText(node.getDisplayName(DefaultNameFormatter.getInstance()));
         setToolTipText(buildToolTipText(node));
     }
@@ -167,17 +168,17 @@
         reset();
         switch(column) {
-            case 0:
-                renderRowId(getModel(table),row, isSelected);
-                break;
-            case 1:
-                if (node == null) {
-                    renderEmptyRow();
-                } else {
-                    renderNode(getModel(table), node, row, isSelected);
-                }
-                break;
-            default:
-                // should not happen
-                throw new RuntimeException(tr("unexpected column index. Got {0}", column));
+        case 0:
+            renderRowId(getModel(table),row, isSelected);
+            break;
+        case 1:
+            if (node == null) {
+                renderEmptyRow();
+            } else {
+                renderNode(getModel(table), node, row, isSelected);
+            }
+            break;
+        default:
+            // should not happen
+            throw new RuntimeException(tr("unexpected column index. Got {0}", column));
         }
         return this;
Index: /trunk/src/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberTableCellRenderer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberTableCellRenderer.java	(revision 1989)
+++ /trunk/src/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberTableCellRenderer.java	(revision 1990)
@@ -18,4 +18,5 @@
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.RelationMember;
+import org.openstreetmap.josm.gui.DefaultNameFormatter;
 import org.openstreetmap.josm.gui.conflict.pair.ListMergeModel;
 import org.openstreetmap.josm.tools.ImageProvider;
@@ -156,5 +157,5 @@
 
     protected void renderPrimitive(RelationMember member) {
-        String displayName = member.getMember().getName();
+        String displayName = member.getMember().getDisplayName(DefaultNameFormatter.getInstance());
         setText(displayName);
         setToolTipText(buildToolTipText(member.getMember()));
@@ -196,23 +197,23 @@
         renderForeground(getModel(table), member, row, column, isSelected);
         switch(column) {
-            case 0:
-                renderRowId(row);
-                break;
-            case 1:
-                if (member == null) {
-                    renderEmptyRow();
-                } else {
-                    renderRole(member);
-                }
-                break;
-            case 2:
-                if (member == null) {
-                    renderEmptyRow();
-                } else {
-                    renderPrimitive(member);
-                }
-                break;
-            default:
-                // should not happen
+        case 0:
+            renderRowId(row);
+            break;
+        case 1:
+            if (member == null) {
+                renderEmptyRow();
+            } else {
+                renderRole(member);
+            }
+            break;
+        case 2:
+            if (member == null) {
+                renderEmptyRow();
+            } else {
+                renderPrimitive(member);
+            }
+            break;
+        default:
+            // should not happen
         }
         return this;
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictResolutionDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictResolutionDialog.java	(revision 1989)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictResolutionDialog.java	(revision 1990)
@@ -25,6 +25,6 @@
 import org.openstreetmap.josm.command.Command;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
+import org.openstreetmap.josm.gui.DefaultNameFormatter;
 import org.openstreetmap.josm.gui.OptionPaneUtil;
-import org.openstreetmap.josm.gui.PrimitiveNameFormatter;
 import org.openstreetmap.josm.gui.conflict.pair.ConflictResolver;
 import org.openstreetmap.josm.gui.conflict.pair.properties.OperationCancelledException;
@@ -241,6 +241,5 @@
             setTitle(tr("Resolve conflicts"));
         } else {
-            PrimitiveNameFormatter formatter = new PrimitiveNameFormatter();
-            setTitle(tr("Resolve conflicts for ''{0}''", formatter.getName(my)));
+            setTitle(tr("Resolve conflicts for ''{0}''", my.getDisplayName(DefaultNameFormatter.getInstance())));
         }
     }
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java	(revision 1989)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java	(revision 1990)
@@ -66,7 +66,7 @@
 import org.openstreetmap.josm.data.osm.RelationMember;
 import org.openstreetmap.josm.data.osm.Way;
+import org.openstreetmap.josm.gui.DefaultNameFormatter;
 import org.openstreetmap.josm.gui.ExtendedDialog;
 import org.openstreetmap.josm.gui.MapFrame;
-import org.openstreetmap.josm.gui.PrimitiveNameFormatter;
 import org.openstreetmap.josm.gui.SideButton;
 import org.openstreetmap.josm.gui.dialogs.relation.RelationEditor;
@@ -99,6 +99,4 @@
  */
 public class PropertiesDialog extends ToggleDialog implements SelectionChangedListener, LayerChangeListener {
-    static private final PrimitiveNameFormatter NAME_FORMATTER = new PrimitiveNameFormatter();
-
     /**
      * Watches for double clicks and from editing or new property, depending on the
@@ -498,5 +496,5 @@
                 Component c = super.getTableCellRendererComponent(table, value, isSelected, false, row, column);
                 if (c instanceof JLabel) {
-                    ((JLabel)c).setText(NAME_FORMATTER.getName((Relation)value));
+                    ((JLabel)c).setText(((Relation)value).getDisplayName(DefaultNameFormatter.getInstance()));
                 }
                 return c;
@@ -837,5 +835,5 @@
             int result = new ExtendedDialog(Main.parent,
                     tr("Change relation"),
-                    tr("Really delete selection from relation {0}?", NAME_FORMATTER.getName(cur)),
+                    tr("Really delete selection from relation {0}?", cur.getDisplayName(DefaultNameFormatter.getInstance())),
                     new String[] {tr("Delete from relation"), tr("Cancel")},
                     new String[] {"dialogs/delete.png", "cancel.png"}).getValue();
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java	(revision 1989)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java	(revision 1990)
@@ -29,5 +29,4 @@
 import org.openstreetmap.josm.data.osm.RelationMember;
 import org.openstreetmap.josm.gui.OsmPrimitivRenderer;
-import org.openstreetmap.josm.gui.PrimitiveNameFormatter;
 import org.openstreetmap.josm.gui.SideButton;
 import org.openstreetmap.josm.gui.dialogs.relation.RelationEditor;
@@ -49,5 +48,4 @@
 public class RelationListDialog extends ToggleDialog implements LayerChangeListener, DataChangeListener {
     private static final Logger logger = Logger.getLogger(RelationListDialog.class.getName());
-    static private final PrimitiveNameFormatter NAME_FORMATTER = new PrimitiveNameFormatter();
 
     /**
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ChildRelationBrowser.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ChildRelationBrowser.java	(revision 1989)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ChildRelationBrowser.java	(revision 1990)
@@ -34,8 +34,8 @@
 import org.openstreetmap.josm.data.osm.RelationMember;
 import org.openstreetmap.josm.data.osm.visitor.MergeVisitor;
+import org.openstreetmap.josm.gui.DefaultNameFormatter;
 import org.openstreetmap.josm.gui.ExceptionDialogUtil;
 import org.openstreetmap.josm.gui.OptionPaneUtil;
 import org.openstreetmap.josm.gui.PleaseWaitRunnable;
-import org.openstreetmap.josm.gui.PrimitiveNameFormatter;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.gui.progress.PleaseWaitProgressMonitor;
@@ -342,10 +342,8 @@
          */
         protected void warnBecauseOfDeletedRelation(Relation r) {
-            PrimitiveNameFormatter nameFormatter = new PrimitiveNameFormatter();
-
             String message = tr("<html>The child relation<br>"
                     + "{0}<br>"
                     + "is deleted on the server. It can't be loaded",
-                    nameFormatter.getName(r)
+                    r.getDisplayName(DefaultNameFormatter.getInstance())
             );
 
@@ -404,5 +402,4 @@
         protected void realRun() throws SAXException, IOException, OsmTransferException {
             try {
-                PrimitiveNameFormatter nameFormatter = new PrimitiveNameFormatter();
                 while(! relationsToDownload.isEmpty() && !cancelled) {
                     Relation r = relationsToDownload.pop();
@@ -411,5 +408,5 @@
                     }
                     rememberChildRelationsToDownload(r);
-                    progressMonitor.setCustomText(tr("Downloading relation {0}", nameFormatter.getName(r)));
+                    progressMonitor.setCustomText(tr("Downloading relation {0}", r.getDisplayName(DefaultNameFormatter.getInstance())));
                     OsmServerObjectReader reader = new OsmServerObjectReader(r.id, OsmPrimitiveType.RELATION,
                             true);
@@ -515,5 +512,4 @@
         protected void realRun() throws SAXException, IOException, OsmTransferException {
             try {
-                PrimitiveNameFormatter nameFormatter = new PrimitiveNameFormatter();
                 Iterator<Relation> it = relations.iterator();
                 while(it.hasNext() && !cancelled) {
@@ -522,5 +518,5 @@
                         continue;
                     }
-                    progressMonitor.setCustomText(tr("Downloading relation {0}", nameFormatter.getName(r)));
+                    progressMonitor.setCustomText(tr("Downloading relation {0}", r.getDisplayName(DefaultNameFormatter.getInstance())));
                     OsmServerObjectReader reader = new OsmServerObjectReader(r.id, OsmPrimitiveType.RELATION,
                             true);
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java	(revision 1989)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java	(revision 1990)
@@ -64,8 +64,8 @@
 import org.openstreetmap.josm.data.osm.visitor.MergeVisitor;
 import org.openstreetmap.josm.gui.ConditionalOptionPaneUtil;
+import org.openstreetmap.josm.gui.DefaultNameFormatter;
 import org.openstreetmap.josm.gui.ExceptionDialogUtil;
 import org.openstreetmap.josm.gui.OptionPaneUtil;
 import org.openstreetmap.josm.gui.PleaseWaitRunnable;
-import org.openstreetmap.josm.gui.PrimitiveNameFormatter;
 import org.openstreetmap.josm.gui.SideButton;
 import org.openstreetmap.josm.gui.dialogs.relation.ac.AutoCompletionCache;
@@ -697,6 +697,4 @@
 
     abstract class  AddFromSelectionAction extends AbstractAction {
-        private PrimitiveNameFormatter nameFormatter = new PrimitiveNameFormatter();
-
         protected boolean isPotentialDuplicate(OsmPrimitive primitive) {
             return memberTableModel.hasMembersReferringTo(Collections.singleton(primitive));
@@ -708,5 +706,5 @@
                     + "<br>"
                     + "Do you really want to add another relation member?</html>",
-                    nameFormatter.getName(primitive)
+                    primitive.getDisplayName(DefaultNameFormatter.getInstance())
             );
             int ret = ConditionalOptionPaneUtil.showOptionDialog(
@@ -736,5 +734,5 @@
                     + "This creates circular references and is therefore discouraged.<br>"
                     + "Skipping relation ''{0}''.</html>",
-                    this.nameFormatter.getName(primitive)
+                    primitive.getDisplayName(DefaultNameFormatter.getInstance())
             );
             OptionPaneUtil.showMessageDialog(
@@ -1170,5 +1168,5 @@
                             + "Please resolve this conflict first, then try again.</html>",
                             getLayer().getName(),
-                            new PrimitiveNameFormatter().getName(getRelation())
+                            getRelation().getDisplayName(DefaultNameFormatter.getInstance())
                     ),
                     tr("Double conflict"),
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableMemberCellRenderer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableMemberCellRenderer.java	(revision 1989)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableMemberCellRenderer.java	(revision 1990)
@@ -10,10 +10,9 @@
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
-import org.openstreetmap.josm.gui.PrimitiveNameFormatter;
+import org.openstreetmap.josm.gui.DefaultNameFormatter;
 import org.openstreetmap.josm.tools.ImageProvider;
 
 public class MemberTableMemberCellRenderer extends MemberTableCellRenderer {
     private HashMap<OsmPrimitiveType, ImageIcon> icons;
-    static private final PrimitiveNameFormatter NAME_FORMATTER = new PrimitiveNameFormatter();
 
     public MemberTableMemberCellRenderer() {
@@ -36,5 +35,5 @@
     protected void renderPrimitive(OsmPrimitive primitive) {
         setIcon(icons.get(OsmPrimitiveType.from(primitive)));
-        setText(NAME_FORMATTER.getName(primitive));
+        setText(primitive.getDisplayName(DefaultNameFormatter.getInstance()));
         setToolTipText(buildToolTipText(primitive));
     }
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationTreeCellRenderer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationTreeCellRenderer.java	(revision 1989)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationTreeCellRenderer.java	(revision 1990)
@@ -11,5 +11,5 @@
 
 import org.openstreetmap.josm.data.osm.Relation;
-import org.openstreetmap.josm.gui.PrimitiveNameFormatter;
+import org.openstreetmap.josm.gui.DefaultNameFormatter;
 import org.openstreetmap.josm.tools.ImageProvider;
 
@@ -20,5 +20,4 @@
  */
 public class RelationTreeCellRenderer extends JLabel implements TreeCellRenderer {
-    private static final PrimitiveNameFormatter NAME_FORMATTER = new PrimitiveNameFormatter();
     public final static Color BGCOLOR_SELECTED = new Color(143,170,255);
 
@@ -47,5 +46,5 @@
      */
     protected void renderValue(Relation relation) {
-        setText(NAME_FORMATTER.getName(relation));
+        setText(relation.getDisplayName(DefaultNameFormatter.getInstance()));
     }
 
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/SelectionTableCellRenderer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/SelectionTableCellRenderer.java	(revision 1989)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/SelectionTableCellRenderer.java	(revision 1990)
@@ -15,5 +15,5 @@
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
-import org.openstreetmap.josm.gui.PrimitiveNameFormatter;
+import org.openstreetmap.josm.gui.DefaultNameFormatter;
 import org.openstreetmap.josm.tools.ImageProvider;
 
@@ -23,6 +23,4 @@
  */
 public  class SelectionTableCellRenderer extends JLabel implements TableCellRenderer {
-    static private final PrimitiveNameFormatter NAME_FORMATTER = new PrimitiveNameFormatter();
-
     public final static Color BGCOLOR_SELECTED = new Color(143,170,255);
     public final static Color BGCOLOR_DOUBLE_ENTRY = new Color(255,234,213);
@@ -118,5 +116,5 @@
     protected void renderPrimitive(OsmPrimitive primitive) {
         setIcon(icons.get(OsmPrimitiveType.from(primitive)));
-        setText(NAME_FORMATTER.getName(primitive));
+        setText(primitive.getDisplayName(DefaultNameFormatter.getInstance()));
         setToolTipText(buildToolTipText(primitive));
     }
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/LafPreference.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/LafPreference.java	(revision 1989)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/LafPreference.java	(revision 1990)
@@ -38,4 +38,5 @@
     private JCheckBox showSplashScreen = new JCheckBox(tr("Show splash screen at startup"));
     private JCheckBox showID = new JCheckBox(tr("Show object ID in selection lists"));
+    private JCheckBox showLocalizedName = new JCheckBox(tr("Show localized name in selection lists"));
     private JCheckBox drawHelperLine = new JCheckBox(tr("Draw rubber-band helper line"));
     private JCheckBox modeless = new JCheckBox(tr("Modeless working (Potlatch style)"));
@@ -50,5 +51,5 @@
             // no exception? Then Go!
             lafCombo.addItem(
-                new UIManager.LookAndFeelInfo(((javax.swing.LookAndFeel)Oquaqua).getName(), "ch.randelshofer.quaqua.QuaquaLookAndFeel")
+                    new UIManager.LookAndFeelInfo(((javax.swing.LookAndFeel)Oquaqua).getName(), "ch.randelshofer.quaqua.QuaquaLookAndFeel")
             );
         } catch (Exception ex) {
@@ -85,4 +86,9 @@
         panel.add(showID, GBC.eop().insets(20, 0, 0, 0));
 
+        // Show localized names
+        showLocalizedName.setToolTipText(tr("Show localized name in selection lists, if available"));
+        showLocalizedName.setSelected(Main.pref.getBoolean("osm-primitives.localize-name", true));
+        panel.add(showLocalizedName, GBC.eop().insets(20, 0, 0, 0));
+
         drawHelperLine.setToolTipText(tr("Draw rubber-band helper line"));
         drawHelperLine.setSelected(Main.pref.getBoolean("draw.helper-line", true));
@@ -107,8 +113,8 @@
         Main.pref.put("draw.splashscreen", showSplashScreen.isSelected());
         Main.pref.put("osm-primitives.showid", showID.isSelected());
+        Main.pref.put("osm-primitives.localize-name", showLocalizedName.isSelected());
         Main.pref.put("draw.helper-line", drawHelperLine.isSelected());
         Main.pref.put("modeless", modeless.isSelected());
         return Main.pref.put("laf", ((LookAndFeelInfo)lafCombo.getSelectedItem()).getClassName());
     }
-
 }
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/ProjectionPreference.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/ProjectionPreference.java	(revision 1989)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/ProjectionPreference.java	(revision 1990)
@@ -15,5 +15,5 @@
 
 import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.data.coor.LatLon.CoordinateFormat;
+import org.openstreetmap.josm.data.coor.CoordinateFormat;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.projection.Mercator;
@@ -67,9 +67,11 @@
     public boolean ok() {
         String projname = projectionCombo.getSelectedItem().getClass().getName();
-        if(Main.pref.put("projection", projname))
+        if(Main.pref.put("projection", projname)) {
             Main.setProjection(projname);
+        }
         if(Main.pref.put("coordinates",
-        ((CoordinateFormat)coordinatesCombo.getSelectedItem()).name()))
-            Node.setCoordinateFormat();
+                ((CoordinateFormat)coordinatesCombo.getSelectedItem()).name())) {
+            CoordinateFormat.setCoordinateFormat((CoordinateFormat)coordinatesCombo.getSelectedItem());
+        }
         return false;
     }
Index: /trunk/src/org/openstreetmap/josm/io/OsmServerWriter.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/OsmServerWriter.java	(revision 1989)
+++ /trunk/src/org/openstreetmap/josm/io/OsmServerWriter.java	(revision 1990)
@@ -2,9 +2,8 @@
 package org.openstreetmap.josm.io;
 
+import static org.openstreetmap.josm.tools.I18n.marktr;
 import static org.openstreetmap.josm.tools.I18n.tr;
-import static org.openstreetmap.josm.tools.I18n.marktr;
 
 import java.util.Collection;
-import java.util.Collections;
 import java.util.LinkedList;
 import java.util.List;
@@ -16,5 +15,4 @@
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
-import org.openstreetmap.josm.gui.PrimitiveNameFormatter;
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
 
@@ -27,5 +25,4 @@
  */
 public class OsmServerWriter {
-    static private final PrimitiveNameFormatter NAME_FORMATTER = new PrimitiveNameFormatter();
     static private final Logger logger = Logger.getLogger(OsmServerWriter.class.getName());
 
@@ -108,5 +105,5 @@
                                 primitives.size(),
                                 time_left_str,
-                                NAME_FORMATTER.getName(osm),
+                                osm.getLocalName(),
                                 osm.id));
                 makeApiRequest(osm,progressMonitor);
