diff --git a/webconsole/src/main/java/org/apache/felix/webconsole/AbstractWebConsolePlugin.java b/webconsole/src/main/java/org/apache/felix/webconsole/AbstractWebConsolePlugin.java
index eb40bdc..940091b 100644
--- a/webconsole/src/main/java/org/apache/felix/webconsole/AbstractWebConsolePlugin.java
+++ b/webconsole/src/main/java/org/apache/felix/webconsole/AbstractWebConsolePlugin.java
@@ -538,11 +538,18 @@
 
         final String appRoot = ( String ) request.getAttribute( WebConsoleConstants.ATTR_APP_ROOT );
 
+        // support localization of the plugin title
+        String title = getTitle();
+        if ( title.startsWith( "%" ) )
+        {
+            title = "${" + title.substring( 1 ) + "}";
+        }
+
         String header = MessageFormat.format( getHeader(), new Object[]
-            { brandingPlugin.getBrandName(), getTitle(), appRoot, getLabel(),
-                toUrl( brandingPlugin.getFavIcon(), appRoot ), toUrl( brandingPlugin.getMainStyleSheet(), appRoot ),
-                brandingPlugin.getProductURL(), brandingPlugin.getProductName(),
-                toUrl( brandingPlugin.getProductImage(), appRoot ), getCssLinks( appRoot ) } );
+            { brandingPlugin.getBrandName(), title, appRoot, getLabel(), toUrl( brandingPlugin.getFavIcon(), appRoot ),
+                toUrl( brandingPlugin.getMainStyleSheet(), appRoot ), brandingPlugin.getProductURL(),
+                brandingPlugin.getProductName(), toUrl( brandingPlugin.getProductImage(), appRoot ),
+                getCssLinks( appRoot ) } );
         pw.println( header );
 
         return pw;
diff --git a/webconsole/src/main/java/org/apache/felix/webconsole/internal/misc/ConfigurationRender.java b/webconsole/src/main/java/org/apache/felix/webconsole/internal/misc/ConfigurationRender.java
index 1527cd6..e2fcebb 100644
--- a/webconsole/src/main/java/org/apache/felix/webconsole/internal/misc/ConfigurationRender.java
+++ b/webconsole/src/main/java/org/apache/felix/webconsole/internal/misc/ConfigurationRender.java
@@ -208,7 +208,7 @@
         {
             final PrinterDesc desc = (PrinterDesc) i.next();
             final String label = desc.label;
-            final String title = desc.printer.getTitle();
+            final String title = getTitle( desc.printer );
             pw.print("<li><a href='" + pluginRoot + label + ".nfo'>" + title + "</a></li>" );
         }
         pw.println("</ul> <!-- end tabs on top -->");
@@ -273,7 +273,7 @@
     {
         if ( cfgPrinter != null )
         {
-            String sortKey = cfgPrinter.getTitle();
+            String sortKey = getTitle( cfgPrinter );
             if ( printers.containsKey( sortKey ) )
             {
                 int idx = -1;
@@ -328,7 +328,7 @@
                                             final ConfigurationPrinter cp,
                                             final String mode )
     {
-        pw.title(  cp.getTitle() );
+        pw.title( getTitle( cp ) );
         if ( cp instanceof ModeAwareConfigurationPrinter )
         {
             ((ModeAwareConfigurationPrinter)cp).printConfiguration( pw , mode);
@@ -398,6 +398,17 @@
         }
     }
 
+
+    private static final String getTitle( final ConfigurationPrinter cp )
+    {
+        final String title = cp.getTitle();
+        if ( title.startsWith( "%" ) )
+        {
+            return title.substring( 1 );
+        }
+        return title;
+    }
+
     private static class SystemPropertiesPrinter implements ConfigurationPrinter
     {
 
@@ -648,7 +659,7 @@
                     final URL[] attachments = ((AttachmentProvider)desc.printer).getAttachments(mode);
                     if ( attachments != null )
                     {
-                        cf.handleAttachments(desc.printer.getTitle(), attachments);
+                        cf.handleAttachments( getTitle( desc.printer ), attachments );
                     }
                 }
             }
diff --git a/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/OsgiManager.java b/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/OsgiManager.java
index 7b1c621..c9f9d7e 100644
--- a/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/OsgiManager.java
+++ b/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/OsgiManager.java
@@ -155,10 +155,6 @@
     // AbstractWebConsolePlugin instances
     private Map plugins = new HashMap();
 
-    // map of labels to plugin titles: indexed by plugin label (String, values
-    // are plugin titles
-    private Map labelMap = new HashMap();
-
     private AbstractWebConsolePlugin defaultPlugin;
 
     private String defaultRenderName;
@@ -339,6 +335,8 @@
 
         if ( plugin != null )
         {
+            final Map labelMap = getLocalizedLabelMap( request.getLocale() );
+
             // the official request attributes
             req.setAttribute( WebConsoleConstants.ATTR_LABEL_MAP, labelMap );
             req.setAttribute( WebConsoleConstants.ATTR_APP_ROOT, request.getContextPath() + request.getServletPath() );
@@ -397,7 +395,6 @@
 
         // simply remove all operations, we should not be used anymore
         this.plugins.clear();
-        this.labelMap.clear();
     }
 
 
@@ -710,7 +707,6 @@
         {
             plugin.init( getServletConfig() );
             plugins.put( label, plugin );
-            labelMap.put( label, title );
 
             if ( this.defaultPlugin == null )
             {
@@ -734,8 +730,6 @@
         AbstractWebConsolePlugin plugin = ( AbstractWebConsolePlugin ) plugins.remove( label );
         if ( plugin != null )
         {
-            labelMap.remove( label );
-
             if ( this.defaultPlugin == plugin )
             {
                 if ( this.plugins.isEmpty() )
@@ -915,4 +909,44 @@
         }
         return stringConfig;
     }
+
+
+    /**
+     * Builds the map of labels to plugin titles to be stored as the
+     * <code>felix.webconsole.labelMap</code> request attribute. This map
+     * optionally localizes the plugin title using the providing bundle's
+     * resource bundle if the first character of the title is a percent
+     * sign (%). Titles not prefixed with a percent sign are added to the
+     * map unmodified.
+     *
+     * @param locale The locale to which the titles are to be localized
+     *
+     * @return The localized map of labels to titles
+     */
+    private final Map getLocalizedLabelMap( final Locale locale )
+    {
+        final Map map = new HashMap();
+        for ( Iterator pi = plugins.values().iterator(); pi.hasNext(); )
+        {
+            final AbstractWebConsolePlugin plugin = ( AbstractWebConsolePlugin ) pi.next();
+            final String label = plugin.getLabel();
+            String title = plugin.getTitle();
+            if ( title.startsWith( "%" ) )
+            {
+                try
+                {
+                    final ResourceBundle resourceBundle = resourceBundleManager.getResourceBundle( plugin.getBundle(),
+                        locale );
+                    title = resourceBundle.getString( title.substring( 1 ) );
+                }
+                catch ( Throwable e )
+                {
+                    /* ignore missing resource - use default title */
+                }
+            }
+            map.put( label, title );
+        }
+
+        return map;
+    }
 }
