Index: /trunk/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java	(revision 4208)
+++ /trunk/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java	(revision 4209)
@@ -12,4 +12,5 @@
 import java.util.Comparator;
 import java.util.HashSet;
+import java.util.LinkedList;
 import java.util.List;
 import java.util.Set;
@@ -43,4 +44,6 @@
     static private DefaultNameFormatter instance;
 
+    private static final LinkedList<NameFormatterHook> formatHooks = new LinkedList<NameFormatterHook>();
+
     /**
      * Replies the unique instance of this formatter
@@ -53,4 +56,29 @@
         }
         return instance;
+    }
+    
+    /**
+     * Registers a format hook. Adds the hook at the first position of the format hooks.
+     * (for plugins)
+     *
+     * @param hook the format hook. Ignored if null.
+     */
+    public static void registerFormatHook(NameFormatterHook hook) {
+        if (hook == null) return;
+        if (!formatHooks.contains(hook)) {
+            formatHooks.add(0,hook);
+        }
+    }
+
+    /**
+     * Unregisters a format hook. Removes the hook from the list of format hooks.
+     *
+     * @param hook the format hook. Ignored if null.
+     */
+    public static void unregisterFormatHook(NameFormatterHook hook) {
+        if (hook == null) return;
+        if (formatHooks.contains(hook)) {
+            formatHooks.remove(hook);
+        }
     }
 
@@ -141,4 +169,12 @@
         }
         name = decorateNameWithId(name, node);
+
+        for (NameFormatterHook hook: formatHooks) {
+            String hookResult = hook.checkFormat(node, name);
+            if (hookResult != null) {
+                return hookResult;
+            }
+        }
+
         return name;
     }
@@ -217,4 +253,12 @@
         }
         name = decorateNameWithId(name, way);
+        
+        for (NameFormatterHook hook: formatHooks) {
+            String hookResult = hook.checkFormat(way, name);
+            if (hookResult != null) {
+                return hookResult;
+            }
+        }
+
         return name;
     }
@@ -264,4 +308,12 @@
         }
         name = decorateNameWithId(name, relation);
+
+        for (NameFormatterHook hook: formatHooks) {
+            String hookResult = hook.checkFormat(relation, name);
+            if (hookResult != null) {
+                return hookResult;
+            }
+        }
+
         return name;
     }
@@ -355,4 +407,11 @@
         if (admin_level != null) {
             name += "["+admin_level+"]";
+        }
+        
+        for (NameFormatterHook hook: formatHooks) {
+            String hookResult = hook.checkRelationTypeName(relation, name);
+            if (hookResult != null) {
+                return hookResult;
+            }
         }
 
Index: /trunk/src/org/openstreetmap/josm/gui/NameFormatterHook.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/NameFormatterHook.java	(revision 4209)
+++ /trunk/src/org/openstreetmap/josm/gui/NameFormatterHook.java	(revision 4209)
@@ -0,0 +1,41 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.gui;
+
+import org.openstreetmap.josm.data.osm.INode;
+import org.openstreetmap.josm.data.osm.IRelation;
+import org.openstreetmap.josm.data.osm.IWay;
+
+public interface NameFormatterHook {
+
+    /**
+     * Check the relation type name. Return the corrected type name if needed, null otherwise.
+     * @param relation The relation.
+     * @param defaultName The default name generated by core.
+     * @return The corrected type name if needed, null otherwise.
+     */
+    public String checkRelationTypeName(IRelation relation, String defaultName);
+    
+    /**
+     * Check the node format. Return the corrected format if needed, null otherwise.
+     * @param node The node.
+     * @param defaultName The default name generated by core.
+     * @return The corrected format if needed, null otherwise.
+     */
+    public String checkFormat(INode node, String defaultName);
+    
+    /**
+     * Check the way format. Return the corrected format if needed, null otherwise.
+     * @param way The way.
+     * @param defaultName The default name generated by core.
+     * @return The corrected format if needed, null otherwise.
+     */
+    public String checkFormat(IWay node, String defaultName);
+
+    /**
+     * Check the relation format. Return the corrected format if needed, null otherwise.
+     * @param relation The relation.
+     * @param defaultName The default name generated by core.
+     * @return The corrected format if needed, null otherwise.
+     */
+    public String checkFormat(IRelation node, String defaultName);
+}
Index: /trunk/src/org/openstreetmap/josm/gui/OsmPrimitivRenderer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/OsmPrimitivRenderer.java	(revision 4208)
+++ /trunk/src/org/openstreetmap/josm/gui/OsmPrimitivRenderer.java	(revision 4209)
@@ -25,5 +25,5 @@
  */
 public class OsmPrimitivRenderer implements ListCellRenderer, TableCellRenderer {
-    private DefaultNameFormatter formatter = new DefaultNameFormatter();
+    private DefaultNameFormatter formatter = DefaultNameFormatter.getInstance();
 
     /**
