Index: /trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java	(revision 19660)
+++ /trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java	(revision 19661)
@@ -3,4 +3,5 @@
 
 import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
+import static org.openstreetmap.josm.tools.I18n.marktr;
 import static org.openstreetmap.josm.tools.I18n.tr;
 
@@ -58,4 +59,5 @@
  */
 public class AddImageryLayerAction extends JosmAction implements AdaptableAction {
+    private static final String WMS_ERROR = marktr("WMS Error");
     private final transient ImageryInfo info;
 
@@ -85,5 +87,5 @@
 
         // change toolbar icon from if specified
-        String icon = info.getIcon();
+        final String icon = info.getIcon();
         if (icon != null) {
             new ImageProvider(icon).setOptional(true).getResourceAsync(result -> {
@@ -127,10 +129,10 @@
                 // specify which layer to use
                 if (Utils.isEmpty(info.getDefaultLayers())) {
-                    WMTSTileSource tileSource = new WMTSTileSource(info);
-                    DefaultLayer layerId = tileSource.userSelectLayer();
+                    final WMTSTileSource tileSource = new WMTSTileSource(info);
+                    final DefaultLayer layerId = tileSource.userSelectLayer();
                     if (layerId != null) {
-                        ImageryInfo copy = new ImageryInfo(info);
+                        final ImageryInfo copy = new ImageryInfo(info);
                         copy.setDefaultLayers(Collections.singletonList(layerId));
-                        String layerName = tileSource.getLayers().stream()
+                        final String layerName = tileSource.getLayers().stream()
                                 .filter(x -> x.getIdentifier().equals(layerId.getLayerName()))
                                 .map(Layer::getUserTitle)
@@ -148,9 +150,9 @@
             }
         } catch (MalformedURLException ex) {
-            handleException(ex, tr("Invalid service URL."), tr("WMS Error"), null);
+            handleException(ex, tr("Invalid service URL."), tr(WMS_ERROR), null);
         } catch (IOException ex) {
-            handleException(ex, tr("Could not retrieve WMS layer list."), tr("WMS Error"), null);
+            handleException(ex, tr("Could not retrieve WMS layer list."), tr(WMS_ERROR), null);
         } catch (WMSGetCapabilitiesException ex) {
-            handleException(ex, tr("Could not parse WMS layer list."), tr("WMS Error"),
+            handleException(ex, tr("Could not parse WMS layer list."), tr(WMS_ERROR),
                     "Could not parse WMS layer list. Incoming data:\n" + ex.getIncomingData());
         } catch (WMTSGetCapabilitiesException ex) {
@@ -163,5 +165,7 @@
     @Override
     public void actionPerformed(ActionEvent e) {
-        if (!isEnabled()) return;
+        if (!isEnabled()) {
+            return;
+        }
         ImageryLayer layer = null;
         try {
@@ -210,12 +214,12 @@
         final WMSLayerTree tree = new WMSLayerTree();
 
-        Collection<String> wmsFormats = wms.getFormats();
+        final Collection<String> wmsFormats = wms.getFormats();
         final JComboBox<String> formats = new JComboBox<>(wmsFormats.toArray(new String[0]));
         formats.setSelectedItem(wms.getPreferredFormat());
         formats.setToolTipText(tr("Select image format for WMS layer"));
 
-        JCheckBox checkBounds = new JCheckBox(tr("Show only layers for current view"), true);
-        Runnable updateTree = () -> {
-            LatLon latLon = checkBounds.isSelected() && MainApplication.isDisplayingMapView()
+        final JCheckBox checkBounds = new JCheckBox(tr("Show only layers for current view"), true);
+        final Runnable updateTree = () -> {
+            final LatLon latLon = checkBounds.isSelected() && MainApplication.isDisplayingMapView()
                     ? MainApplication.getMap().mapView.getProjection().eastNorth2latlon(MainApplication.getMap().mapView.getCenter())
                     : null;
@@ -228,5 +232,5 @@
 
         if (!GraphicsEnvironment.isHeadless()) {
-            ExtendedDialog dialog = new ExtendedDialog(MainApplication.getMainFrame(),
+            final ExtendedDialog dialog = new ExtendedDialog(MainApplication.getMainFrame(),
                     tr("Select WMS layers"), tr("Add layers"), tr("Cancel"));
             final JScrollPane scrollPane = new JScrollPane(tree.getLayerTree());
@@ -260,9 +264,9 @@
             return getWMSLayerInfo(info, AddImageryLayerAction::askToSelectLayers);
         } catch (MalformedURLException ex) {
-            handleException(ex, tr("Invalid service URL."), tr("WMS Error"), null);
+            handleException(ex, tr("Invalid service URL."), tr(WMS_ERROR), null);
         } catch (IOException ex) {
-            handleException(ex, tr("Could not retrieve WMS layer list."), tr("WMS Error"), null);
+            handleException(ex, tr("Could not retrieve WMS layer list."), tr(WMS_ERROR), null);
         } catch (WMSGetCapabilitiesException ex) {
-            handleException(ex, tr("Could not parse WMS layer list."), tr("WMS Error"),
+            handleException(ex, tr("Could not parse WMS layer list."), tr(WMS_ERROR),
                     "Could not parse WMS layer list. Incoming data:\n" + ex.getIncomingData());
         }
@@ -286,5 +290,5 @@
         final TemplatedWMSTileSource tileSource = new TemplatedWMSTileSource(info, ProjectionRegistry.getProjection());
         final WMSImagery wms = new WMSImagery(tileSource.getBaseUrl(), info.getCustomHttpHeaders());
-        LayerSelection selection = choice.apply(wms);
+        final LayerSelection selection = choice.apply(wms);
         if (selection == null) {
             return null;
@@ -298,9 +302,9 @@
                 );
 
-        String selectedLayers = selection.layers.stream()
+        final String selectedLayers = selection.layers.stream()
                 .map(LayerDetails::getName)
                 .collect(Collectors.joining(", "));
         // Use full copy of original Imagery info to copy all attributes. Only overwrite what's different
-        ImageryInfo ret = new ImageryInfo(info);
+        final ImageryInfo ret = new ImageryInfo(info);
         ret.setUrl(url);
         ret.setImageryType(ImageryType.WMS);
