Changeset 104 in josm


Ignore:
Timestamp:
2006-07-03T00:31:24+02:00 (18 years ago)
Author:
imi
Message:
  • started i18n
  • started "download incomplete ways" action
  • added straight line selection mode
Files:
9 added
1 deleted
72 edited

Legend:

Unmodified
Added
Removed
  • .classpath

    r103 r104  
    77        <classpathentry kind="lib" path="lib/MinML2.jar"/>
    88        <classpathentry kind="lib" path="lib/metadata-extractor-2.3.1.jar"/>
     9        <classpathentry kind="lib" path="lib/gettext-commons-0.9.jar"/>
    910        <classpathentry kind="output" path="bin"/>
    1011</classpath>
  • CONTRIBUTION

    r103 r104  
    11112.0. The world image is from onearth.pl.
    1212
     13The gettext-commons-0.9.jar is from Felix Berger and Steffen Pingel (http://xnap-commons.sourceforge.net/gettext-commons/). The jar-file is licensed under LGPL.
     14
     15A internationalization-patch was submited 2006 by Sven Anders <sven@anders-hamburg.de>.
    1316
    1417All the rest are belong to me.
  • src/org/openstreetmap/josm/Main.java

    r103 r104  
    11package org.openstreetmap.josm;
     2import static org.openstreetmap.josm.tools.I18n.tr;
    23
    34import java.awt.BorderLayout;
     
    149150                final Action aboutAction = new AboutAction();
    150151
    151                 final JMenu fileMenu = new JMenu("Files");
     152                final JMenu fileMenu = new JMenu(tr("Files"));
    152153                fileMenu.setMnemonic('F');
    153154                fileMenu.add(openAction);
     
    159160
    160161
    161                 final JMenu connectionMenu = new JMenu("Connection");
     162                final JMenu connectionMenu = new JMenu(tr("Connection"));
    162163                connectionMenu.setMnemonic('C');
    163164                connectionMenu.add(downloadAction);
     165                //connectionMenu.add(new DownloadIncompleteAction());
    164166                connectionMenu.add(uploadAction);
    165167                mainMenu.add(connectionMenu);
    166168
    167                 layerMenu = new JMenu("Layer");
     169                layerMenu = new JMenu(tr("Layer"));
    168170                layerMenu.setMnemonic('L');
    169171                mainMenu.add(layerMenu);
    170172                layerMenu.setVisible(false);
    171173               
    172                 final JMenu editMenu = new JMenu("Edit");
     174                final JMenu editMenu = new JMenu(tr("Edit"));
    173175                editMenu.setMnemonic('E');
    174176                editMenu.add(undoAction);
     
    179181
    180182                mainMenu.add(new JSeparator());
    181                 final JMenu helpMenu = new JMenu("Help");
     183                final JMenu helpMenu = new JMenu(tr("Help"));
    182184                helpMenu.setMnemonic('H');
    183185                helpMenu.add(aboutAction);
     
    220222        public final OsmDataLayer editLayer() {
    221223                if (map == null || map.mapView.editLayer == null)
    222                         addLayer(new OsmDataLayer(ds, "unnamed", false));
     224                        addLayer(new OsmDataLayer(ds, tr("unnamed"), false));
    223225                return map.mapView.editLayer;
    224226        }
     
    270272                } catch (final IOException e1) {
    271273                        e1.printStackTrace();
    272                         errMsg = "Preferences could not be loaded. Write default preference file to '"+pref.getPreferencesDir()+"preferences'.";
     274                        errMsg = tr("Preferences could not be loaded. Write default preference file to '{0}'.",
     275                    pref.getPreferencesDir() + "preferences");
    273276                        Main.pref.resetToDefault();
    274277                }
     
    280283                } catch (final Exception e) {
    281284                        e.printStackTrace();
    282                         JOptionPane.showMessageDialog(null, "The projection could not be read from preferences. Using EPSG:4263.");
     285                        JOptionPane.showMessageDialog(null, tr("The projection could not be read from preferences. Using EPSG:4263."));
    283286                        Main.proj = new Epsg4326();
    284287                }
     
    336339                        final Bounds b = DownloadAction.osmurl2bounds(s);
    337340                        if (b == null)
    338                                 JOptionPane.showMessageDialog(Main.parent, "Ignoring malformed url: '"+s+"'");
     341                                JOptionPane.showMessageDialog(Main.parent, tr("Ignoring malformed url: '{0}'", s));
    339342                        else
    340343                                main.downloadAction.download(false, b.min.lat(), b.min.lon(), b.max.lat(), b.max.lon());
     
    346349                                main.openAction.openFile(new File(new URI(s)));
    347350                        } catch (URISyntaxException e) {
    348                                 JOptionPane.showMessageDialog(Main.parent, "Ignoring malformed file url: '"+s+"'");
     351                                JOptionPane.showMessageDialog(Main.parent, tr("Ignoring malformed file url: '{0}", s));
    349352                        }
    350353                        return;
  • src/org/openstreetmap/josm/actions/AboutAction.java

    r98 r104  
    11package org.openstreetmap.josm.actions;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.awt.Dimension;
     
    3436 */
    3537public class AboutAction extends JosmAction {
    36        
     38
    3739        public AboutAction() {
    38                 super("About", "about", "Display the about screen.", KeyEvent.VK_A);
     40                super(tr("About"), "about",tr("Display the about screen."), KeyEvent.VK_A);
    3941        }
    4042       
     
    5456               
    5557                JPanel info = new JPanel(new GridBagLayout());
    56                 info.add(new JLabel("Java OpenStreetMap Editor Version "+version), GBC.eop());
    57                 info.add(new JLabel("last change at "+time), GBC.eop());
    58                 info.add(new JLabel("Homepage"), GBC.std().insets(0,0,10,0));
     58                info.add(new JLabel(tr("Java OpenStreetMap Editor Version {0}",version)), GBC.eop());
     59                info.add(new JLabel(tr("last change at {0}",time)), GBC.eop());
     60                info.add(new JLabel(tr("Homepage")), GBC.std().insets(0,0,10,0));
    5961                info.add(new UrlLabel("http://wiki.eigenheimstrasse.de/wiki/JOSM"), GBC.eol());
     62                info.add(new JLabel(tr("Bug Reports")), GBC.std().insets(0,0,10,0));
     63                info.add(new UrlLabel("http://trac.openstreetmap.org"), GBC.eol());
    6064               
    6165               
    6266               
    63                 about.addTab("Info", info);
    64                 about.addTab("Readme", new JScrollPane(readme));
    65                 about.addTab("Revision", new JScrollPane(revision));
     67                about.addTab(tr("Info"), info);
     68                about.addTab(tr("Readme"), new JScrollPane(readme));
     69                about.addTab(tr("Revision"), new JScrollPane(revision));
    6670               
    6771                about.setPreferredSize(new Dimension(500,300));
    6872               
    69                 JOptionPane.showMessageDialog(Main.parent, about, "About JOSM...",
     73                JOptionPane.showMessageDialog(Main.parent, about, tr("About JOSM..."),
    7074                                JOptionPane.INFORMATION_MESSAGE, ImageProvider.get("logo"));
    7175        }
     
    7781         */
    7882        private JTextArea loadFile(URL resource) {
    79                 JTextArea area = new JTextArea("File could not be found.");
     83                JTextArea area = new JTextArea(tr("File could not be found."));
    8084                area.setEditable(false);
    8185                Font font = Font.getFont("monospaced");
  • src/org/openstreetmap/josm/actions/AutoScaleAction.java

    r94 r104  
    11package org.openstreetmap.josm.actions;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.awt.event.ActionEvent;
     
    3032                private final AutoScaleMode mode;
    3133                public Action(AutoScaleMode mode) {
    32                         super("Auto Scale: "+mode, ImageProvider.get("dialogs/autoscale/"+mode));
    33                         putValue(SHORT_DESCRIPTION, "Auto zoom the view to "+mode+". Disabled if the view is moved.");
     34                        super(tr("Auto Scale"+": "+tr(mode.toString())), ImageProvider.get("dialogs/autoscale/"+mode));
     35                        putValue(SHORT_DESCRIPTION, tr("Auto zoom the view")+tr("(to "+mode+")")+tr(". Disabled if the view is moved."));
    3436                        this.mode = mode;
    3537                }
  • src/org/openstreetmap/josm/actions/DiskAccessAction.java

    r98 r104  
    11package org.openstreetmap.josm.actions;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.io.File;
     
    5456                        File file = fc.getSelectedFile();
    5557                        if (file == null || (file.exists() && JOptionPane.YES_OPTION !=
    56                                         JOptionPane.showConfirmDialog(Main.parent, "File exists. Overwrite?", "Overwrite", JOptionPane.YES_NO_OPTION)))
     58                                        JOptionPane.showConfirmDialog(Main.parent, tr("File exists. Overwrite?"), tr("Overwrite"), JOptionPane.YES_NO_OPTION)))
    5759                                return null;
    5860                }
  • src/org/openstreetmap/josm/actions/DownloadAction.java

    r103 r104  
    11package org.openstreetmap.josm.actions;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.awt.Dimension;
     
    4244import org.openstreetmap.josm.gui.layer.RawGpsLayer;
    4345import org.openstreetmap.josm.gui.layer.RawGpsLayer.GpsPoint;
    44 import org.openstreetmap.josm.io.OsmServerReader;
     46import org.openstreetmap.josm.io.BoundingBoxDownloader;
    4547import org.openstreetmap.josm.tools.GBC;
    4648import org.xml.sax.SAXException;
     
    5557 */
    5658public class DownloadAction extends JosmAction {
    57 
    5859        /**
    5960         * Open the download dialog and download the data.
     
    6162         */
    6263        private final class DownloadOsmTask extends PleaseWaitRunnable {
    63                 private final OsmServerReader reader;
     64                private final BoundingBoxDownloader reader;
    6465                private DataSet dataSet;
    6566
    66                 private DownloadOsmTask(OsmServerReader reader) {
    67                         super("Downloading data");
     67                private DownloadOsmTask(BoundingBoxDownloader reader) {
     68                        super(tr("Downloading data"));
    6869                        this.reader = reader;
    6970                        reader.setProgressInformation(currentAction, progress);
     
    7778                        if (dataSet == null)
    7879                                return; // user cancelled download or error occoured
    79                         if (dataSet.nodes.isEmpty())
    80                                 errorMessage = "No data imported.";
    81                         Main.main.addLayer(new OsmDataLayer(dataSet, "Data Layer", false));
     80                        if (dataSet.allPrimitives().isEmpty())
     81                                errorMessage = tr("No data imported.");
     82                        Main.main.addLayer(new OsmDataLayer(dataSet, tr("Data Layer"), false));
    8283                }
    8384
     
    8990
    9091        private final class DownloadGpsTask extends PleaseWaitRunnable {
    91                 private final OsmServerReader reader;
     92                private final BoundingBoxDownloader reader;
    9293                private Collection<Collection<GpsPoint>> rawData;
    9394
    94                 private DownloadGpsTask(OsmServerReader reader) {
    95                         super("Downloading GPS data");
     95                private DownloadGpsTask(BoundingBoxDownloader reader) {
     96                        super(tr("Downloading GPS data"));
    9697                        this.reader = reader;
    9798                        reader.setProgressInformation(currentAction, progress);
     
    123124                        new JTextField(9),
    124125                        new JTextField(9)};
    125         JCheckBox rawGps = new JCheckBox("Open as raw gps data", false);
     126        JCheckBox rawGps = new JCheckBox(tr("Open as raw gps data"), false);
    126127
    127128        public DownloadAction() {
    128                 super("Download from OSM", "download", "Download map data from the OSM server.", "Ctrl-Shift-D",
     129                super(tr("Download from OSM"), "download", tr("Download map data from the OSM server."), tr("Ctrl-Shift-D"),
    129130                                KeyStroke.getKeyStroke(KeyEvent.VK_D, InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK));
    130131                // TODO remove when bug in Java6 is fixed
     
    139140                WorldChooser wc = new WorldChooser();
    140141                dlg.add(wc, GBC.eop());
    141                 wc.setToolTipText("Move and zoom the image like the main map. Select an area to download by dragging.");
     142                wc.setToolTipText(tr("Move and zoom the image like the main map. Select an area to download by dragging."));
    142143
    143144                // Bounding box edits
    144                 dlg.add(new JLabel("Bounding box"), GBC.eol());
    145                 dlg.add(new JLabel("min lat"), GBC.std().insets(10,0,5,0));
     145                dlg.add(new JLabel(tr("Bounding box")), GBC.eol());
     146                dlg.add(new JLabel(tr("min lat")), GBC.std().insets(10,0,5,0));
    146147                dlg.add(latlon[0], GBC.std());
    147                 dlg.add(new JLabel("min lon"), GBC.std().insets(10,0,5,0));
     148                dlg.add(new JLabel(tr("min lon")), GBC.std().insets(10,0,5,0));
    148149                dlg.add(latlon[1], GBC.eol());
    149                 dlg.add(new JLabel("max lat"), GBC.std().insets(10,0,5,0));
     150                dlg.add(new JLabel(tr("max lat")), GBC.std().insets(10,0,5,0));
    150151                dlg.add(latlon[2], GBC.std());
    151                 dlg.add(new JLabel("max lon"), GBC.std().insets(10,0,5,0));
     152                dlg.add(new JLabel(tr("max lon")), GBC.std().insets(10,0,5,0));
    152153                dlg.add(latlon[3], GBC.eol());
    153154                if (Main.map != null) {
     
    161162
    162163                // OSM url edit
    163                 dlg.add(new JLabel("URL from www.openstreetmap.org"), GBC.eol());
     164                dlg.add(new JLabel(tr("URL from www.openstreetmap.org")), GBC.eol());
    164165                final JTextField osmUrl = new JTextField();
    165166                dlg.add(osmUrl, GBC.eop().fill(GBC.HORIZONTAL));
     
    214215
    215216                // Bookmarks
    216                 dlg.add(new JLabel("Bookmarks"), GBC.eol());
     217                dlg.add(new JLabel(tr("Bookmarks")), GBC.eol());
    217218                final BookmarkList bookmarks = new BookmarkList();
    218219                bookmarks.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
     
    231232
    232233                JPanel buttons = new JPanel(new GridLayout(1,2));
    233                 JButton add = new JButton("Add");
     234                JButton add = new JButton(tr("Add"));
    234235                add.addActionListener(new ActionListener(){
    235236                        public void actionPerformed(ActionEvent e) {
    236237                                Bookmark b = readBookmark();
    237238                                if (b == null) {
    238                                         JOptionPane.showMessageDialog(Main.parent, "Please enter the desired coordinates first.");
     239                                        JOptionPane.showMessageDialog(Main.parent, tr("Please enter the desired coordinates first."));
    239240                                        return;
    240241                                }
    241                                 b.name = JOptionPane.showInputDialog(Main.parent, "Please enter a name for the location.");
     242                                b.name = JOptionPane.showInputDialog(Main.parent,tr("Please enter a name for the location."));
    242243                                if (b.name != null && !b.name.equals("")) {
    243244                                        ((DefaultListModel)bookmarks.getModel()).addElement(b);
     
    247248                });
    248249                buttons.add(add);
    249                 JButton remove = new JButton("Remove");
     250                JButton remove = new JButton(tr("Remove"));
    250251                remove.addActionListener(new ActionListener(){
    251252                        public void actionPerformed(ActionEvent e) {
    252253                                Object sel = bookmarks.getSelectedValue();
    253254                                if (sel == null) {
    254                                         JOptionPane.showMessageDialog(Main.parent, "Select a bookmark first.");
     255                                        JOptionPane.showMessageDialog(Main.parent,tr("Select a bookmark first."));
    255256                                        return;
    256257                                }
     
    270271                do {
    271272                        final JOptionPane pane = new JOptionPane(dlg, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION);
    272                         final JDialog panedlg = pane.createDialog(Main.parent, "Choose an area");
     273                        final JDialog panedlg = pane.createDialog(Main.parent, tr("Choose an area"));
    273274                        bookmarks.addMouseListener(new MouseAdapter(){
    274275                                @Override public void mouseClicked(MouseEvent e) {
     
    285286                        b = readBookmark();
    286287                        if (b == null)
    287                                 JOptionPane.showMessageDialog(Main.parent, "Please enter the desired coordinates or click on a bookmark.");
     288                                JOptionPane.showMessageDialog(Main.parent,tr("Please enter the desired coordinates or click on a bookmark."));
    288289                } while (b == null);
    289290
     
    365366         */
    366367        public void download(boolean rawGps, double minlat, double minlon, double maxlat, double maxlon) {
    367                 OsmServerReader reader = new OsmServerReader(minlat, minlon, maxlat, maxlon);
     368                BoundingBoxDownloader reader = new BoundingBoxDownloader(minlat, minlon, maxlat, maxlon);
    368369                PleaseWaitRunnable task = rawGps ? new DownloadGpsTask(reader) : new DownloadOsmTask(reader);
    369370                Main.worker.execute(task);
  • src/org/openstreetmap/josm/actions/ExitAction.java

    r68 r104  
    11package org.openstreetmap.josm.actions;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.awt.event.ActionEvent;
     
    1012 */
    1113public class ExitAction extends JosmAction {
    12 
    1314        /**
    1415         * Construct the action with "Exit" as label
    1516         */
    1617        public ExitAction() {
    17                 super("Exit", "exit", "Exit the application.", KeyEvent.VK_X);
     18                super(tr("Exit"), "exit", tr("Exit the application."), KeyEvent.VK_X);
    1819        }
    1920       
    2021        public void actionPerformed(ActionEvent e) {
    21                 // todo: check for modified windows before exiting
    2222                System.exit(0);
    2323        }
    24 
    2524}
  • src/org/openstreetmap/josm/actions/ExtensionFileFilter.java

    r86 r104  
    11package org.openstreetmap.josm.actions;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.io.File;
     
    1214 */
    1315public class ExtensionFileFilter extends FileFilter {
    14        
    1516        private final String extension;
    1617        private final String description;
     
    2223       
    2324        public static ExtensionFileFilter[] filters = {
    24                 new ExtensionFileFilter("osm,xml", "osm", "OSM Server Version 0.2 (.osm .xml)"),
    25                 new ExtensionFileFilter("gpx", "gpx", "GPX Files Version 0.1 (.gpx)"),
    26                 new ExtensionFileFilter("csv,txt", "csv", "CSV Files Version 0.1 (.csv .txt)"),
     25                new ExtensionFileFilter("osm,xml", "osm", tr("OSM Server Files (.osm .xml)")),
     26                new ExtensionFileFilter("gpx", "gpx", tr("GPX Files (.gpx)")),
     27                new ExtensionFileFilter("csv,txt", "csv", tr("CSV Files (.csv .txt)")),
    2728        };
    2829
  • src/org/openstreetmap/josm/actions/GpxExportAction.java

    r103 r104  
    11package org.openstreetmap.josm.actions;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.awt.GridBagLayout;
     
    3638public class GpxExportAction extends DiskAccessAction {
    3739
    38         private final static String warningGpl = "<html><font color='red' size='-2'>Note: GPL is not compatible to the OSM license. Do not upload GPL licensed tracks</html>";
     40        private final static String warningGpl = tr("<html><font color='red' size='-2'>Note: GPL is not compatible to the OSM license. Do not upload GPL licensed tracks</html>");
    3941
    4042        private final Layer layer;
    4143
    4244        public GpxExportAction(Layer layer) {
    43                 super("Export to GPX", "exportgpx", "Export the data to GPX file.", "Ctrl-E", KeyStroke.getKeyStroke(KeyEvent.VK_E, InputEvent.CTRL_DOWN_MASK));
     45                super(tr("Export to GPX"), "exportgpx", tr("Export the data to GPX file."), tr("Ctrl-E"), KeyStroke.getKeyStroke(KeyEvent.VK_E, InputEvent.CTRL_DOWN_MASK));
    4446                this.layer = layer;
    4547        }
     
    4749        public void actionPerformed(ActionEvent e) {
    4850                if (layer == null && Main.map == null) {
    49                         JOptionPane.showMessageDialog(Main.parent, "Nothing to export. Get some data first.");
     51                        JOptionPane.showMessageDialog(Main.parent, tr("Nothing to export. Get some data first."));
    5052                        return;
    5153                }
     
    7173                JPanel p = new JPanel(new GridBagLayout());
    7274
    73                 p.add(new JLabel("gps track description"), GBC.eol());
     75                p.add(new JLabel(tr("gps track description")), GBC.eol());
    7476                JTextArea desc = new JTextArea(3,40);
    7577                desc.setWrapStyleWord(true);
     
    7779                p.add(new JScrollPane(desc), GBC.eop().fill(GBC.BOTH));
    7880               
    79                 JCheckBox author = new JCheckBox("Add author information", Main.pref.getBoolean("lastAddAuthor", true));
     81                JCheckBox author = new JCheckBox(tr("Add author information"), Main.pref.getBoolean("lastAddAuthor", true));
    8082                author.setSelected(true);
    8183                p.add(author, GBC.eol());
    82                 JLabel nameLabel = new JLabel("Real name");
     84                JLabel nameLabel = new JLabel(tr("Real name"));
    8385                p.add(nameLabel, GBC.std().insets(10,0,5,0));
    8486                JTextField authorName = new JTextField(Main.pref.get("lastAuthorName"));
    8587                p.add(authorName, GBC.eol().fill(GBC.HORIZONTAL));
    86                 JLabel emailLabel = new JLabel("Email");
     88                JLabel emailLabel = new JLabel(tr("Email"));
    8789                p.add(emailLabel, GBC.std().insets(10,0,5,0));
    8890                JTextField email = new JTextField(Main.pref.get("osm-server.username"));
    8991                p.add(email, GBC.eol().fill(GBC.HORIZONTAL));
    90                 JLabel copyrightLabel = new JLabel("Copyright (URL)");
     92                JLabel copyrightLabel = new JLabel(tr("Copyright (URL)"));
    9193                p.add(copyrightLabel, GBC.std().insets(10,0,5,0));
    9294                JTextField copyright = new JTextField();
    9395                p.add(copyright, GBC.std().fill(GBC.HORIZONTAL));
    94                 JButton predefined = new JButton("Predefined");
     96                JButton predefined = new JButton(tr("Predefined"));
    9597                p.add(predefined, GBC.eol().insets(5,0,0,0));
    96                 JLabel copyrightYearLabel = new JLabel("Copyright year");
     98                JLabel copyrightYearLabel = new JLabel(tr("Copyright year"));
    9799                p.add(copyrightYearLabel, GBC.std().insets(10,0,5,5));
    98100                JTextField copyrightYear = new JTextField("");
     
    102104                addDependencies(author, authorName, email, copyright, predefined, copyrightYear, nameLabel, emailLabel, copyrightLabel, copyrightYearLabel, warning);
    103105               
    104                 p.add(new JLabel("Keywords"), GBC.eol());
     106                p.add(new JLabel(tr("Keywords")), GBC.eol());
    105107                JTextField keywords = new JTextField();
    106108                p.add(keywords, GBC.eop().fill(GBC.HORIZONTAL));
    107109
    108                 int answer = JOptionPane.showConfirmDialog(Main.parent, p, "Export options", JOptionPane.OK_CANCEL_OPTION);
     110                int answer = JOptionPane.showConfirmDialog(Main.parent, p, tr("Export options"), JOptionPane.OK_CANCEL_OPTION);
    109111                if (answer != JOptionPane.OK_OPTION)
    110112                        return;
     
    127129                } catch (IOException x) {
    128130                        x.printStackTrace();
    129                         JOptionPane.showMessageDialog(Main.parent, "Error while exporting "+fn+":\n"+x.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
     131                        JOptionPane.showMessageDialog(Main.parent, tr("Error while exporting {0}", fn)+":\n"+x.getMessage(), tr("Error"), JOptionPane.ERROR_MESSAGE);
    130132                }               
    131133        }
     
    178180                predefined.addActionListener(new ActionListener(){
    179181                        public void actionPerformed(ActionEvent e) {
    180                                 JList l = new JList(new String[]{"Creative Commons By-SA", "public domain", "GNU Lesser Public License (LGPL)", "BSD License (same as MIT/X11)"});
     182                                JList l = new JList(new String[]{"Creative Commons By-SA", "public domain", "GNU Lesser Public License (LGPL)", "BSD License (MIT/X11)"});
    181183                                l.setVisibleRowCount(4);
    182184                                l.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    183                                 int answer = JOptionPane.showConfirmDialog(Main.parent, new JScrollPane(l), "Choose a predefined license", JOptionPane.OK_CANCEL_OPTION);
     185                                int answer = JOptionPane.showConfirmDialog(Main.parent, new JScrollPane(l),tr("Choose a predefined license"), JOptionPane.OK_CANCEL_OPTION);
    184186                                if (answer != JOptionPane.OK_OPTION || l.getSelectedIndex() == -1)
    185187                                        return;
  • src/org/openstreetmap/josm/actions/OpenAction.java

    r103 r104  
    11package org.openstreetmap.josm.actions;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.awt.event.ActionEvent;
     
    3234 */
    3335public class OpenAction extends DiskAccessAction {
    34 
     36       
    3537        /**
    3638         * Create an open action. The name is "Open a file".
    3739         */
    3840        public OpenAction() {
    39                 super("Open", "open", "Open a file.", "Ctrl-O", KeyStroke.getKeyStroke(KeyEvent.VK_O, InputEvent.CTRL_DOWN_MASK));
     41                super(tr("Open"), "open", tr("Open a file."), tr("Ctrl-O"), KeyStroke.getKeyStroke(KeyEvent.VK_O, InputEvent.CTRL_DOWN_MASK));
    4042        }
    4143
     
    7072                                        dataSet = OsmReader.parseDataSet(new FileInputStream(filename), null, null);
    7173                                } else if (ExtensionFileFilter.filters[ExtensionFileFilter.CSV].acceptName(fn)) {
    72                                         JOptionPane.showMessageDialog(Main.parent, fn+": CSV Data import for non-GPS data is not implemented yet.");
     74                                        JOptionPane.showMessageDialog(Main.parent, fn+": "+tr("CSV Data import for non-GPS data is not implemented yet."));
    7375                                        return;
    7476                                } else {
    75                                         JOptionPane.showMessageDialog(Main.parent, fn+": Unknown file extension: "+fn.substring(filename.getName().lastIndexOf('.')+1));
     77                                        JOptionPane.showMessageDialog(Main.parent, fn+": "+tr("Unknown file extension: {0}", fn.substring(filename.getName().lastIndexOf('.')+1)));
    7678                                        return;
    7779                                }
    78                                 Main.main.addLayer(new OsmDataLayer(dataSet, "Data Layer", true));
     80                                Main.main.addLayer(new OsmDataLayer(dataSet, tr("Data Layer"), true));
    7981                        }
    8082                } catch (SAXException x) {
    8183                        x.printStackTrace();
    82                         JOptionPane.showMessageDialog(Main.parent, "Error while parsing "+fn+": "+x.getMessage());
     84                        JOptionPane.showMessageDialog(Main.parent, tr("Error while parsing {0}",fn)+": "+x.getMessage());
    8385                } catch (IOException x) {
    8486                        x.printStackTrace();
    85                         JOptionPane.showMessageDialog(Main.parent, "Could not read '"+fn+"'\n"+x.getMessage());
     87                        JOptionPane.showMessageDialog(Main.parent, tr("Could not read '{0}'",fn)+"\n"+x.getMessage());
    8688                }
    8789        }
  • src/org/openstreetmap/josm/actions/PreferencesAction.java

    r68 r104  
    11package org.openstreetmap.josm.actions;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.awt.event.ActionEvent;
     
    1921         */
    2022        public PreferencesAction() {
    21                 super("Preferences", "preference", "Open a preferences page for global settings.", "F12", KeyStroke.getKeyStroke(KeyEvent.VK_F12, 0));
     23                super(tr("Preferences"), "preference", tr("Open a preferences page for global settings."), tr("F12"), KeyStroke.getKeyStroke(KeyEvent.VK_F12, 0));
    2224        }
    2325
  • src/org/openstreetmap/josm/actions/RedoAction.java

    r98 r104  
    11package org.openstreetmap.josm.actions;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.awt.event.ActionEvent;
     
    2123         */
    2224        public RedoAction() {
    23                 super("Redo", "redo", "Redo the last undone action.", "Ctrl-Shift-Z", KeyStroke.getKeyStroke(KeyEvent.VK_Z, InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK));
     25                super(tr("Redo"), "redo", tr("Redo the last undone action."), tr("Ctrl-Shift-Z"), KeyStroke.getKeyStroke(KeyEvent.VK_Z, InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK));
    2426                setEnabled(false);
    2527        }
  • src/org/openstreetmap/josm/actions/SaveAction.java

    r103 r104  
    11package org.openstreetmap.josm.actions;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.awt.event.ActionEvent;
     
    2224 */
    2325public class SaveAction extends DiskAccessAction {
    24 
     26   
    2527        /**
    2628         * Construct the action with "Save" as label.
     
    2931         */
    3032        public SaveAction() {
    31                 super("Save", "save", "Save the current data.", "Ctrl-S", KeyStroke.getKeyStroke(KeyEvent.VK_S, InputEvent.CTRL_DOWN_MASK));
     33                super(tr("Save"), "save", tr("Save the current data."), tr("Ctrl-S"), KeyStroke.getKeyStroke(KeyEvent.VK_S, InputEvent.CTRL_DOWN_MASK));
    3234        }
    3335       
    3436        public void actionPerformed(ActionEvent event) {
    3537                if (Main.map == null) {
    36                         JOptionPane.showMessageDialog(Main.parent, "No document open so nothing to save.");
     38                        JOptionPane.showMessageDialog(Main.parent, tr("No document open so nothing to save."));
    3739                        return;
    3840                }
    39                 if (isDataSetEmpty() && JOptionPane.NO_OPTION == JOptionPane.showConfirmDialog(Main.parent, "The document contains no data. Save anyway?", "Empty document", JOptionPane.YES_NO_OPTION))
     41                if (isDataSetEmpty() && JOptionPane.NO_OPTION == JOptionPane.showConfirmDialog(Main.parent,tr("The document contains no data. Save anyway?"), tr("Empty document"), JOptionPane.YES_NO_OPTION))
    4042                        return;
    4143                if (!Main.map.conflictDialog.conflicts.isEmpty()) {
    4244                        int answer = JOptionPane.showConfirmDialog(Main.parent,
    43                                         "There are unresolved conflicts. Conflicts will not be saved and handled as if you rejected all. Continue?", "Conflicts", JOptionPane.YES_NO_OPTION);
     45                                        tr("There are unresolved conflicts. Conflicts will not be saved and handled as if you rejected all. Continue?"),tr("Conflicts"), JOptionPane.YES_NO_OPTION);
    4446                        if (answer != JOptionPane.YES_OPTION)
    4547                                return;
     
    7072                                Main.main.editLayer().cleanData(null, false);
    7173                        } else if (ExtensionFileFilter.filters[ExtensionFileFilter.CSV].acceptName(fn)) {
    72                                 JOptionPane.showMessageDialog(Main.parent, "CSV output not supported yet.");
     74                                JOptionPane.showMessageDialog(Main.parent, tr("CSV output not supported yet."));
    7375                                return;
    7476                        } else {
    75                                 JOptionPane.showMessageDialog(Main.parent, "Unknown file extension.");
     77                                JOptionPane.showMessageDialog(Main.parent, tr("Unknown file extension."));
    7678                                return;
    7779                        }
    7880                } catch (IOException e) {
    7981                        e.printStackTrace();
    80                         JOptionPane.showMessageDialog(Main.parent, "An error occoured while saving.\n"+e.getMessage());
     82                        JOptionPane.showMessageDialog(Main.parent, tr("An error occoured while saving.")+"\n"+e.getMessage());
    8183                }
    8284        }
  • src/org/openstreetmap/josm/actions/UndoAction.java

    r98 r104  
    11package org.openstreetmap.josm.actions;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.awt.event.ActionEvent;
     
    2123         */
    2224        public UndoAction() {
    23                 super("Undo", "undo", "Undo the last action.", "Ctrl-Z", KeyStroke.getKeyStroke(KeyEvent.VK_Z, InputEvent.CTRL_DOWN_MASK));
     25                super(tr("Undo"), "undo", tr("Undo the last action."), tr("Ctrl-Z"), KeyStroke.getKeyStroke(KeyEvent.VK_Z, InputEvent.CTRL_DOWN_MASK));
    2426                setEnabled(false);
    2527        }
  • src/org/openstreetmap/josm/actions/UploadAction.java

    r103 r104  
    11package org.openstreetmap.josm.actions;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.awt.GridBagLayout;
     
    3234 */
    3335public class UploadAction extends JosmAction {
    34 
    3536        public UploadAction() {
    36                 super("Upload to OSM", "upload", "Upload all changes to the OSM server.", "Ctrl-Shift-U",
     37                super(tr("Upload to OSM"), "upload", tr("Upload all changes to the OSM server."), tr("Ctrl-Shift-U"),
    3738                                KeyStroke.getKeyStroke(KeyEvent.VK_U, InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK));
    3839        }
     
    4041        public void actionPerformed(ActionEvent e) {
    4142                if (Main.map == null) {
    42                         JOptionPane.showMessageDialog(Main.parent, "Nothing to upload. Get some data first.");
     43                        JOptionPane.showMessageDialog(Main.parent,tr("Nothing to upload. Get some data first."));
    4344                        return;
    4445                }
    4546               
    4647                if (!Main.map.conflictDialog.conflicts.isEmpty()) {
    47                         JOptionPane.showMessageDialog(Main.parent, "There are unresolved conflicts. You have to resolve these first.");
     48                        JOptionPane.showMessageDialog(Main.parent,tr("There are unresolved conflicts. You have to resolve these first."));
    4849                        Main.map.conflictDialog.action.button.setSelected(true);
    4950                        Main.map.conflictDialog.action.actionPerformed(null);
     
    7273                all.addAll(delete);
    7374
    74                 PleaseWaitRunnable uploadTask = new PleaseWaitRunnable("Uploading data"){
     75                PleaseWaitRunnable uploadTask = new PleaseWaitRunnable(tr("Uploading data")){
    7576                        @Override protected void realRun() throws SAXException {
    7677                                server.setProgressInformation(currentAction, progress);
     
    9697        private boolean displayUploadScreen(Collection<OsmPrimitive> add, Collection<OsmPrimitive> update, Collection<OsmPrimitive> delete) {
    9798                if (add.isEmpty() && update.isEmpty() && delete.isEmpty()) {
    98                         JOptionPane.showMessageDialog(Main.parent, "No changes to upload.");
     99                        JOptionPane.showMessageDialog(Main.parent,tr("No changes to upload."));
    99100                        return false;
    100101                }
     
    105106
    106107                if (!add.isEmpty()) {
    107                         p.add(new JLabel("Objects to add:"), GBC.eol());
     108                        p.add(new JLabel(tr("Objects to add:")), GBC.eol());
    108109                        JList l = new JList(add.toArray());
    109110                        l.setCellRenderer(renderer);
     
    113114
    114115                if (!update.isEmpty()) {
    115                         p.add(new JLabel("Objects to modify:"), GBC.eol());
     116                        p.add(new JLabel(tr("Objects to modify:")), GBC.eol());
    116117                        JList l = new JList(update.toArray());
    117118                        l.setCellRenderer(renderer);
     
    121122
    122123                if (!delete.isEmpty()) {
    123                         p.add(new JLabel("Objects to delete:"), GBC.eol());
     124                        p.add(new JLabel(tr("Objects to delete:")), GBC.eol());
    124125                        JList l = new JList(delete.toArray());
    125126                        l.setCellRenderer(renderer);
     
    128129                }
    129130
    130                 return JOptionPane.showConfirmDialog(Main.parent, p, "Upload this changes?",
     131                return JOptionPane.showConfirmDialog(Main.parent, p, tr("Upload this changes?"),
    131132                                JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION;
    132133        }
  • src/org/openstreetmap/josm/actions/WmsServerAction.java

    r98 r104  
    11package org.openstreetmap.josm.actions;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.awt.event.ActionEvent;
     
    1113
    1214    public WmsServerAction() {
    13         super("Show background", "wmsserver", "Download and show landsat background images.", KeyEvent.VK_B);
     15        super(tr("Show background"), "wmsserver", tr("Download and show landsat background images."), KeyEvent.VK_B);
    1416    }
    1517
    1618    public void actionPerformed(ActionEvent e) {
    17         JOptionPane.showMessageDialog(Main.parent, "Not implemented yet.");
     19        JOptionPane.showMessageDialog(Main.parent, tr("Not implemented yet."));
    1820    }
    1921}
  • src/org/openstreetmap/josm/actions/mapmode/AddNodeAction.java

    r102 r104  
    11package org.openstreetmap.josm.actions.mapmode;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.awt.Cursor;
     
    4244                public AddNodeGroup(MapFrame mf) {
    4345                        super(KeyEvent.VK_N,0);
    44                         actions.add(new AddNodeAction(mf, "Add node", Mode.node, "Add a new node to the map"));
    45                         actions.add(new AddNodeAction(mf, "Add node into segment", Mode.nodesegment, "Add a node into an existing segment"));
     46                        actions.add(new AddNodeAction(mf,tr("Add node"), Mode.node, tr("Add a new node to the map")));
     47                        actions.add(new AddNodeAction(mf, tr("Add node into segment"), Mode.nodesegment,tr( "Add a node into an existing segment")));
    4648                        setCurrent(0);
    4749                }
     
    7981                Node n = new Node(Main.map.mapView.getLatLon(e.getX(), e.getY()));
    8082                if (n.coor.isOutSideWorld()) {
    81                         JOptionPane.showMessageDialog(Main.parent, "Can not add a node outside of the world.");
     83                        JOptionPane.showMessageDialog(Main.parent,tr("Can not add a node outside of the world."));
    8284                        return;
    8385                }
     
    128130                        }
    129131
    130                         c = new SequenceCommand("Add Node into Segment", cmds);
     132                        c = new SequenceCommand(tr("Add Node into Segment"), cmds);
    131133                }
    132134                Main.main.editLayer().add(c);
  • src/org/openstreetmap/josm/actions/mapmode/AddSegmentAction.java

    r101 r104  
    11package org.openstreetmap.josm.actions.mapmode;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.awt.Color;
     
    1113import org.openstreetmap.josm.Main;
    1214import org.openstreetmap.josm.command.AddCommand;
    13 import org.openstreetmap.josm.data.osm.Segment;
    1415import org.openstreetmap.josm.data.osm.Node;
    1516import org.openstreetmap.josm.data.osm.OsmPrimitive;
     17import org.openstreetmap.josm.data.osm.Segment;
    1618import org.openstreetmap.josm.gui.MapFrame;
    1719import org.openstreetmap.josm.tools.ImageProvider;
     
    4749         */
    4850        public AddSegmentAction(MapFrame mapFrame) {
    49                 super("Add segment",
     51                super(tr("Add segment"),
    5052                                "addsegment",
    51                                 "Add a segment between two nodes.",
     53                                tr("Add a segment between two nodes."),
    5254                                "G",
    5355                                KeyEvent.VK_G,
  • src/org/openstreetmap/josm/actions/mapmode/AddWayAction.java

    r101 r104  
    11package org.openstreetmap.josm.actions.mapmode;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
     4import static org.openstreetmap.josm.tools.I18n.trn;
    25
    36import java.awt.event.KeyEvent;
     
    4851 */
    4952public class AddWayAction extends MapMode implements SelectionChangedListener {
    50 
    5153        private Way way;
    5254
     
    5759         */
    5860        public AddWayAction(MapFrame mapFrame) {
    59                 super("Add Way", "addway", "Add a new way to the data.", "W", KeyEvent.VK_W, mapFrame, ImageProvider.getCursor("normal", "way"));
     61                super(tr("Add Way"), "addway", tr("Add a new way to the data."), "W", KeyEvent.VK_W, mapFrame, ImageProvider.getCursor("normal", "way"));
    6062               
    6163                Main.ds.addSelectionChangedListener(this);
     
    9193                                for (Segment seg : way.segments) {
    9294                                        if (seg.incomplete) {
    93                                                 JOptionPane.showMessageDialog(Main.parent, "Warning: This way is incomplete. Try to download it, before adding segments.");
     95                                                JOptionPane.showMessageDialog(Main.parent,tr("Warning: This way is incomplete. Try to download it, before adding segments."));
    9496                                                return;
    9597                                        }
     
    139141                        for (Segment seg : way.segments) {
    140142                                if (seg.incomplete) {
    141                                         JOptionPane.showMessageDialog(Main.parent, "Warning: This way is incomplete. Try to download it, before adding segments.");
     143                                        JOptionPane.showMessageDialog(Main.parent, tr("Warning: This way is incomplete. Try to download it, before adding segments."));
    142144                                        break;
    143145                                }
     
    158160                boolean reordered = false;
    159161                if (numberOfSelectedWays > 0) {
    160                         String ways = "way" + (numberOfSelectedWays==1?" has":"s have");
    161                         int answer = JOptionPane.showConfirmDialog(Main.parent, numberOfSelectedWays+" "+ways+" been selected.\n" +
    162                                         "Do you wish to select all segments belonging to the "+ways+" instead?", "Add segments from ways", JOptionPane.YES_NO_OPTION);
     162                        int answer = JOptionPane.showConfirmDialog(Main.parent,trn("{0} way has been selected.\nDo you wish to select all segments belonging to the way instead?","{0} ways have been selected.\nDo you wish to select all segments belonging to the ways instead?",numberOfSelectedWays,numberOfSelectedWays),tr("Add segments from ways"), JOptionPane.YES_NO_OPTION);
    163163                        if (answer == JOptionPane.YES_OPTION) {
    164164                                for (OsmPrimitive osm : selection)
     
    166166                                                segmentSet.addAll(((Way)osm).segments);
    167167                        } else if (numberOfSelectedWays == 1) {
    168                                 answer = JOptionPane.showConfirmDialog(Main.parent, "Do you want to add all other selected segments to the one selected way?", "Add segments to way?", JOptionPane.YES_NO_OPTION);
     168                                answer = JOptionPane.showConfirmDialog(Main.parent,tr("Do you want to add all other selected segments to the one selected way?"),tr("Add segments to way?"), JOptionPane.YES_NO_OPTION);
    169169                                if (answer == JOptionPane.YES_OPTION) {
    170170                                        for (OsmPrimitive osm : selection) {
    171171                                                if (osm instanceof Way) {
    172172                                                        wayToAdd = (Way)osm;
    173                                                         answer = JOptionPane.showConfirmDialog(Main.parent, "Reorder all line segments?", "Reorder?", JOptionPane.YES_NO_CANCEL_OPTION);
     173                                                        answer = JOptionPane.showConfirmDialog(Main.parent,tr("Reorder all line segments?"), tr("Reorder?"), JOptionPane.YES_NO_CANCEL_OPTION);
    174174                                                        if (answer == JOptionPane.CANCEL_OPTION)
    175175                                                                return wayToAdd;
     
    230230                }
    231231
    232                 if (JOptionPane.YES_OPTION != JOptionPane.showConfirmDialog(Main.parent, "Create a new way out of "+sortedSegments.size()+" segments?", "Create new way", JOptionPane.YES_NO_OPTION))
     232                if (JOptionPane.YES_OPTION != JOptionPane.showConfirmDialog(Main.parent,trn("Create a new way out of {0} segment?","Create a new way out of {0} segments?",sortedSegments.size(),sortedSegments.size()), tr("Create new way"), JOptionPane.YES_NO_OPTION))
    233233                        return null;
    234234
  • src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java

    r101 r104  
    11package org.openstreetmap.josm.actions.mapmode;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.awt.event.ActionEvent;
     
    5153         */
    5254        public DeleteAction(MapFrame mapFrame) {
    53                 super("Delete",
     55                super(tr("Delete"),
    5456                                "delete",
    55                                 "Delete nodes, streets or segments.",
     57                                tr("Delete nodes, streets or segments."),
    5658                                "D",
    5759                                KeyEvent.VK_D,
     
    146148                                        String reason = deleteNodeAndJoinSegment((Node)osm);
    147149                                        if (reason != null && msgBox) {
    148                                                 JOptionPane.showMessageDialog(Main.parent, "Cannot delete node. "+reason);
     150                                                JOptionPane.showMessageDialog(Main.parent,tr("Cannot delete node.")+" "+reason);
    149151                                                return;
    150152                                        }
    151153                                } else if (msgBox) {
    152                                         JOptionPane.showMessageDialog(Main.parent, "This object is in use.");
     154                                        JOptionPane.showMessageDialog(Main.parent, tr("This object is in use."));
    153155                                        return;
    154156                                }
     
    167169                        if (!s.deleted && (s.from == n || s.to == n)) {
    168170                                if (segs.size() > 1)
    169                                         return "Used by more than two segments.";
     171                                        return tr("Used by more than two segments.");
    170172                                segs.add(s);
    171173                        }
    172174                }
    173175                if (segs.size() != 2)
    174                         return "Used by only one segment.";
     176                        return tr("Used by only one segment.");
    175177                Segment seg1 = segs.get(0);
    176178                Segment seg2 = segs.get(1);
     
    182184                for (Way w : Main.ds.ways)
    183185                        if (!w.deleted && (w.segments.contains(seg1) || w.segments.contains(seg2)))
    184                                 return "Used in a way.";
     186                                return tr("Used in a way.");
    185187                if (seg1.from == seg2.from || seg1.to == seg2.to)
    186                         return "Wrong direction of segments.";
     188                        return tr("Wrong direction of segments.");
    187189                for (Entry<String, String> e : seg1.entrySet())
    188190                        if (seg2.keySet().contains(e.getKey()) && !seg2.get(e.getKey()).equals(e.getValue()))
    189                                 return "Conflicting keys";
     191                                return tr("Conflicting keys");
    190192                Segment s = new Segment(seg1);
    191193                s.to = seg2.to;
     
    197199                        new ChangeCommand(seg1, s),
    198200                        new DeleteCommand(Arrays.asList(new OsmPrimitive[]{n, seg2}))};
    199                 Main.main.editLayer().add(new SequenceCommand("Delete Node", Arrays.asList(cmds)));
     201                Main.main.editLayer().add(new SequenceCommand(tr("Delete Node"), Arrays.asList(cmds)));
    200202                return null;
    201203    }
  • src/org/openstreetmap/josm/actions/mapmode/MapMode.java

    r101 r104  
    2323 */
    2424abstract public class MapMode extends JosmAction implements MouseListener, MouseMotionListener {
    25 
    2625//      private final Cursor cursor;
    2726//      private Cursor oldCursor;
  • src/org/openstreetmap/josm/actions/mapmode/MoveAction.java

    r101 r104  
    11package org.openstreetmap.josm.actions.mapmode;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.awt.Cursor;
     
    1820import org.openstreetmap.josm.gui.MapFrame;
    1921import org.openstreetmap.josm.tools.ImageProvider;
    20 
    2122/**
    2223 * Move is an action that can move all kind of OsmPrimitives (except Keys for now).
     
    2930 */
    3031public class MoveAction extends MapMode {
    31 
    3232        /**
    3333         * The old cursor before the user pressed the mouse button.
     
    4949         */
    5050        public MoveAction(MapFrame mapFrame) {
    51                 super("Move",
     51                super(tr("Move"),
    5252                                "move",
    53                                 "Move selected objects around.",
     53                                tr("Move selected objects around."),
    5454                                "M",
    5555                                KeyEvent.VK_M,
     
    9797                for (OsmPrimitive osm : affectedNodes) {
    9898                        if (osm instanceof Node && ((Node)osm).coor.isOutSideWorld()) {
    99                                 JOptionPane.showMessageDialog(Main.parent, "Cannot move objects outside of the world.");
     99                                JOptionPane.showMessageDialog(Main.parent,tr("Cannot move objects outside of the world."));
    100100                                return;
    101101                        }
  • src/org/openstreetmap/josm/actions/mapmode/SelectionAction.java

    r101 r104  
    11package org.openstreetmap.josm.actions.mapmode;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.awt.Rectangle;
    46import java.awt.event.KeyEvent;
     7import java.awt.event.MouseEvent;
    58import java.util.Collection;
     9import java.util.HashMap;
     10import java.util.HashSet;
    611import java.util.LinkedList;
     12import java.util.Map;
    713
    814import org.openstreetmap.josm.Main;
     15import org.openstreetmap.josm.actions.GroupAction;
     16import org.openstreetmap.josm.data.osm.Node;
    917import org.openstreetmap.josm.data.osm.OsmPrimitive;
     18import org.openstreetmap.josm.data.osm.Segment;
    1019import org.openstreetmap.josm.gui.MapFrame;
    1120import org.openstreetmap.josm.gui.SelectionManager;
     
    5564public class SelectionAction extends MapMode implements SelectionEnded {
    5665
     66        enum Mode {select, straight}
     67        private final Mode mode;
     68
     69        public static class Group extends GroupAction {
     70                public Group(MapFrame mf) {
     71                        super(KeyEvent.VK_S,0);
     72                        actions.add(new SelectionAction(mf, tr("Selection"), Mode.select, tr("Select objects by dragging or clicking.")));
     73                        actions.add(new SelectionAction(mf, tr("Straight line"), Mode.straight, tr("Select objects in a straight line.")));
     74                        setCurrent(0);
     75                }
     76        }
     77
     78
    5779        /**
    5880         * The SelectionManager that manages the selection rectangle.
    5981         */
    6082        private SelectionManager selectionManager;
     83
     84        private Node straightStart = null;
     85        private Node lastEnd = null;
     86        private Collection<OsmPrimitive> oldSelection = null;
     87
     88        //TODO: Implement reverse references into data objects and remove this
     89        private final Map<Node, Collection<Segment>> reverseSegmentMap = new HashMap<Node, Collection<Segment>>();
    6190
    6291        /**
     
    6493         * @param mapFrame The frame this action belongs to
    6594         */
    66         public SelectionAction(MapFrame mapFrame) {
    67                 super("Selection",
    68                                 "selection",
    69                                 "Select objects by dragging or clicking.",
    70                                 "S",
    71                                 KeyEvent.VK_S,
    72                                 mapFrame,
    73                                 ImageProvider.getCursor("normal", "selection"));
     95        public SelectionAction(MapFrame mapFrame, String name, Mode mode, String desc) {
     96                super(name, "selection/"+mode, desc, "S", KeyEvent.VK_S, mapFrame, ImageProvider.getCursor("normal", "selection"));
     97                this.mode = mode;
    7498                this.selectionManager = new SelectionManager(this, false, mapFrame.mapView);
    7599        }
     
    77101        @Override public void enterMode() {
    78102                super.enterMode();
    79                 selectionManager.register(Main.map.mapView);
     103                if (mode == Mode.select)
     104                        selectionManager.register(Main.map.mapView);
     105                else {
     106                        Main.map.mapView.addMouseMotionListener(this);
     107                        Main.map.mapView.addMouseListener(this);
     108                        for (Segment s : Main.ds.segments) {
     109                                addBackReference(s.from, s);
     110                                addBackReference(s.to, s);
     111                        }
     112                }
     113        }
     114
     115        private void addBackReference(Node n, Segment s) {
     116                Collection<Segment> c = reverseSegmentMap.get(n);
     117                if (c == null) {
     118                        c = new HashSet<Segment>();
     119                        reverseSegmentMap.put(n, c);
     120                }
     121                c.add(s);
    80122        }
    81123
    82124        @Override public void exitMode() {
    83125                super.exitMode();
    84                 selectionManager.unregister(Main.map.mapView);
     126                if (mode == Mode.select)
     127                        selectionManager.unregister(Main.map.mapView);
     128                else {
     129                        Main.map.mapView.removeMouseMotionListener(this);
     130                        Main.map.mapView.removeMouseListener(this);
     131                        reverseSegmentMap.clear();
     132                }
    85133        }
    86134
     
    108156                Main.map.mapView.repaint();
    109157        }
     158
     159        @Override public void mouseDragged(MouseEvent e) {
     160                Node old = lastEnd;
     161                lastEnd = Main.map.mapView.getNearestNode(e.getPoint());
     162                if (straightStart == null)
     163                        straightStart = lastEnd;
     164                if (straightStart != null && lastEnd != null && straightStart != lastEnd && old != lastEnd) {
     165                        Collection<OsmPrimitive> path = new HashSet<OsmPrimitive>();
     166                        Collection<OsmPrimitive> sel = new HashSet<OsmPrimitive>();
     167                        path.add(straightStart);
     168                        calculateShortestPath(path, straightStart, lastEnd);
     169                        if ((e.getModifiers() & MouseEvent.CTRL_MASK) != 0) {
     170                                sel.addAll(oldSelection);
     171                                sel.removeAll(path);
     172                        } else if ((e.getModifiers() & MouseEvent.SHIFT_MASK) != 0) {
     173                                sel = path;
     174                                sel.addAll(oldSelection);
     175                        } else
     176                                sel = path;
     177                        Main.ds.setSelected(sel);
     178                }
     179        }
     180
     181        @Override public void mousePressed(MouseEvent e) {
     182                straightStart = Main.map.mapView.getNearestNode(e.getPoint());
     183                lastEnd = null;
     184                oldSelection = Main.ds.getSelected();
     185        }
     186
     187        @Override public void mouseReleased(MouseEvent e) {
     188                straightStart = null;
     189                lastEnd = null;
     190                oldSelection = null;
     191        }
     192
     193        /**
     194         * Get the shortest path by stepping through the node with a common segment with start
     195         * and nearest to the end (greedy algorithm).
     196         */
     197        private void calculateShortestPath(Collection<OsmPrimitive> path, Node start, Node end) {
     198                for (Node pivot = start; pivot != null;)
     199                        pivot = addNearest(path, pivot, end);
     200        }
     201
     202        private Node addNearest(Collection<OsmPrimitive> path, Node start, Node end) {
     203                Collection<Segment> c = reverseSegmentMap.get(start);
     204                double min = Double.MAX_VALUE;
     205                Node next = null;
     206                Segment seg = null;
     207                for (Segment s : c) {
     208                        Node other = s.from == start ? s.to : s.from;
     209                        if (other == end) {
     210                                next = other;
     211                                seg = s;
     212                                min = 0;
     213                                break;
     214                        }
     215                        double distance = other.eastNorth.distance(end.eastNorth);
     216                        if (distance < min) {
     217                                min = distance;
     218                                next = other;
     219                                seg = s;
     220                        }
     221                }
     222                if (min < start.eastNorth.distance(end.eastNorth) && next != null) {
     223                        path.add(next);
     224                        path.add(seg);
     225                        return next;
     226                }
     227                return null;
     228        }
    110229}
  • src/org/openstreetmap/josm/actions/mapmode/ZoomAction.java

    r101 r104  
    11package org.openstreetmap.josm.actions.mapmode;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.awt.Rectangle;
     
    4244         */
    4345        public ZoomAction(MapFrame mapFrame) {
    44                 super("Zoom", "zoom", "Zoom in by dragging. (Ctrl+up,left,down,right,+,-)", "Z", KeyEvent.VK_Z, mapFrame, ImageProvider.getCursor("normal", "zoom"));
     46                super(tr("Zoom"), "zoom", tr("Zoom in by dragging. (Ctrl+up,left,down,right,+,-)"), "Z", KeyEvent.VK_Z, mapFrame, ImageProvider.getCursor("normal", "zoom"));
    4547                mv = mapFrame.mapView;
    4648                selectionManager = new SelectionManager(this, true, mv);
  • src/org/openstreetmap/josm/command/AddCommand.java

    r94 r104  
    11package org.openstreetmap.josm.command;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.util.Collection;
     
    4850                NameVisitor v = new NameVisitor();
    4951                osm.visit(v);
    50                 return new DefaultMutableTreeNode(new JLabel("Add "+v.className+" "+v.name, v.icon, JLabel.HORIZONTAL));
     52                return new DefaultMutableTreeNode(new JLabel(tr("Add")+" "+v.className+" "+v.name, v.icon, JLabel.HORIZONTAL));
    5153    }
    5254}
  • src/org/openstreetmap/josm/command/ChangeCommand.java

    r94 r104  
    11package org.openstreetmap.josm.command;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.util.Collection;
     
    3335                NameVisitor v = new NameVisitor();
    3436                osm.visit(v);
    35                 return new DefaultMutableTreeNode(new JLabel("Change "+v.className+" "+v.name, v.icon, JLabel.HORIZONTAL));
     37                return new DefaultMutableTreeNode(new JLabel(tr("Change")+" "+v.className+" "+v.name, v.icon, JLabel.HORIZONTAL));
    3638    }
    3739}
  • src/org/openstreetmap/josm/command/ChangePropertyCommand.java

    r94 r104  
    11package org.openstreetmap.josm.command;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
     4import static org.openstreetmap.josm.tools.I18n.trn;
    25
    36import java.util.Collection;
     
    2023 */
    2124public class ChangePropertyCommand extends Command {
    22 
    2325        /**
    2426         * All primitives, that are affected with this command.
     
    6264
    6365        @Override public MutableTreeNode description() {
    64                 String text = value == null ? "Remove '"+key+"'" : "Set '"+key+"="+value+"'";
    65                 text += " for ";
     66                String text = value == null ? tr( "Remove '{0}' for",key) : tr("Set {0}={1} for",key,value);
    6667                if (objects.size() == 1) {
    6768                        NameVisitor v = new NameVisitor();
     
    6970                        text += v.className+" "+v.name;
    7071                } else
    71                         text += objects.size()+" objects";
     72                        text += trn("{0} object","{0} objects",objects.size(),objects.size());
    7273                DefaultMutableTreeNode root = new DefaultMutableTreeNode(new JLabel(text, ImageProvider.get("data", "key"), JLabel.HORIZONTAL));
    7374                if (objects.size() == 1)
  • src/org/openstreetmap/josm/command/ConflictResolveCommand.java

    r98 r104  
    11package org.openstreetmap.josm.command;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.util.Collection;
     
    7375                        if (c.resolution != null)
    7476                                i++;
    75                 return new DefaultMutableTreeNode(new JLabel("Resolve "+i+" conflicts in "+resolved.size()+" objects", ImageProvider.get("data", "primitive"), JLabel.HORIZONTAL));
     77                return new DefaultMutableTreeNode(new JLabel(tr("Resolve {0} conflicts in {1} objects",i,resolved.size()), ImageProvider.get("data", "primitive"), JLabel.HORIZONTAL));
    7678    }
    7779}
  • src/org/openstreetmap/josm/command/DeleteCommand.java

    r94 r104  
    11package org.openstreetmap.josm.command;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
     4import static org.openstreetmap.josm.tools.I18n.trn;
    25
    36import java.util.Collection;
     
    4144                if (data.size() == 1) {
    4245                        data.iterator().next().visit(v);
    43                         return new DefaultMutableTreeNode(new JLabel("Delete "+v.className+" "+v.name, v.icon, JLabel.HORIZONTAL));
     46                        return new DefaultMutableTreeNode(new JLabel(tr("Delete"+" "+v.className+" "+v.name), v.icon, JLabel.HORIZONTAL));
    4447                }
    4548
     
    5255                                cname = "primitive";
    5356                }
    54                 DefaultMutableTreeNode root = new DefaultMutableTreeNode(new JLabel("Delete "+data.size()+" "+cname+(data.size()==1?"":"s"), ImageProvider.get("data", cname), JLabel.HORIZONTAL));
     57                DefaultMutableTreeNode root = new DefaultMutableTreeNode(new JLabel(
     58                                tr("Delete")+" "+data.size()+" "+trn(cname, cname+"s", data.size()), ImageProvider.get("data", cname), JLabel.HORIZONTAL));
    5559                for (OsmPrimitive osm : data) {
    5660                        osm.visit(v);
  • src/org/openstreetmap/josm/command/MoveCommand.java

    r94 r104  
    11package org.openstreetmap.josm.command;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
     4import static org.openstreetmap.josm.tools.I18n.trn;
    25
    36import java.util.Collection;
     
    2528 */
    2629public class MoveCommand extends Command {
    27 
    2830        /**
    2931         * The objects that should be moved.
     
    113115
    114116        @Override public MutableTreeNode description() {
    115                 return new DefaultMutableTreeNode(new JLabel("Move "+objects.size()+" Node"+(objects.size()==1?"":"s"), ImageProvider.get("data", "node"), JLabel.HORIZONTAL));
     117                return new DefaultMutableTreeNode(new JLabel(tr("Move")+" "+objects.size()+" "+trn("node","nodes",objects.size()), ImageProvider.get("data", "node"), JLabel.HORIZONTAL));
    116118    }
    117119}
  • src/org/openstreetmap/josm/command/SequenceCommand.java

    r100 r104  
    11package org.openstreetmap.josm.command;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.util.Collection;
     
    4749
    4850        @Override public MutableTreeNode description() {
    49                 DefaultMutableTreeNode root = new DefaultMutableTreeNode("Sequence: "+name);
     51                DefaultMutableTreeNode root = new DefaultMutableTreeNode(tr("Sequence")+": "+name);
    5052                for (Command c : sequence)
    5153                        root.add(c.description());
  • src/org/openstreetmap/josm/data/conflict/ConflictItem.java

    r86 r104  
    11package org.openstreetmap.josm.data.conflict;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.util.Collection;
     
    2931                                value = v;
    3032                        else if (!value.equals(v)) {
    31                                 value = "<html><i>&lt;different&gt;</i></html>";
     33                                value = "<html><i>&lt;"+tr("different")+"&gt;</i></html>";
    3234                                break;
    3335                        }
  • src/org/openstreetmap/josm/data/conflict/DeleteConflict.java

    r86 r104  
    11package org.openstreetmap.josm.data.conflict;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    1012
    1113        @Override public String key() {
    12                 return "deleted|deleted";
     14                return "deleted|"+tr("deleted");
    1315        }
    1416
    1517        @Override protected String str(OsmPrimitive osm) {
    16                 return osm.deleted ? "true" : "false";
     18                return osm.deleted ? tr("true") : tr("false");
    1719        }
    1820
  • src/org/openstreetmap/josm/data/conflict/FromConflict.java

    r86 r104  
    11package org.openstreetmap.josm.data.conflict;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    1517       
    1618        @Override public String key() {
    17                 return "segment|from";
     19                return "segment|"+tr("from");
    1820        }
    1921       
  • src/org/openstreetmap/josm/data/conflict/PositionConflict.java

    r86 r104  
    11package org.openstreetmap.josm.data.conflict;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import org.openstreetmap.josm.data.osm.Node;
     
    1517       
    1618        @Override public String key() {
    17                 return "node|position";
     19                return "node|"+tr("position");
    1820        }
    1921       
  • src/org/openstreetmap/josm/data/conflict/SegmentConflict.java

    r86 r104  
    11package org.openstreetmap.josm.data.conflict;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    1719                for (Segment ls : ((Way)osm).segments)
    1820                        s += ls.id + ",";
    19                 return s.equals("") ? "<html><i>&lt;none&gt;</i></html>" : s.substring(0, s.length()-1);
     21                return s.equals("") ? "<html><i>&lt;"+tr("none")+"&gt;</i></html>" : s.substring(0, s.length()-1);
    2022        }
    2123       
    2224        @Override public String key() {
    23                 return "way|segments";
     25                return "way|"+tr("segments");
    2426        }
    2527       
  • src/org/openstreetmap/josm/data/conflict/ToConflict.java

    r86 r104  
    1 /**
    2  *
    3  */
    41package org.openstreetmap.josm.data.conflict;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    54
    65import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    1817
    1918        @Override public String key() {
    20                 return "segment|to";
     19                return "segment|"+tr("to");
    2120        }
    2221       
  • src/org/openstreetmap/josm/data/osm/Way.java

    r100 r104  
    5050            return o instanceof Way ? Long.valueOf(id).compareTo(o.id) : -1;
    5151    }
     52       
     53        public boolean isIncomplete() {
     54                for (Segment s : segments)
     55                        if (s.incomplete)
     56                                return true;
     57                return false;
     58        }
    5259}
  • src/org/openstreetmap/josm/data/osm/visitor/NameVisitor.java

    r100 r104  
    11
    22package org.openstreetmap.josm.data.osm.visitor;
     3
     4import static org.openstreetmap.josm.tools.I18n.tr;
     5import static org.openstreetmap.josm.tools.I18n.trn;
    36
    47import java.util.HashSet;
     
    811import javax.swing.JLabel;
    912
     13import org.openstreetmap.josm.data.osm.Node;
    1014import org.openstreetmap.josm.data.osm.Segment;
    11 import org.openstreetmap.josm.data.osm.Node;
    1215import org.openstreetmap.josm.data.osm.Way;
    1316import org.openstreetmap.josm.tools.ImageProvider;
     
    4346                if (name == null) {
    4447                        if (ls.incomplete)
    45                                 name = ls.id == 0 ? "new" : ""+ls.id+" (unknown)";
     48                                name = ls.id == 0 ? tr("new") : tr("{0} (unknown)", ls.id);
    4649                        else
    4750                                name = (ls.id==0?"":ls.id+" ")+"("+ls.from.coor.lat()+","+ls.from.coor.lon()+") -> ("+ls.to.coor.lat()+","+ls.to.coor.lon()+")";
     
    8083                                        incomplete = true;
    8184                        }
    82                         name = nodes.size()+" nodes";
     85                        name = trn("{0} node", "{0} nodes", nodes.size(), nodes.size());
    8386                        if (incomplete)
    84                                 name += " (incomplete)";
     87                                name += " ("+tr("incomplete")+")";
    8588                }
    8689                icon = ImageProvider.get("data", "way");
  • src/org/openstreetmap/josm/gui/BookmarkList.java

    r98 r104  
    11package org.openstreetmap.josm.gui;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.awt.Component;
     
    8688                        in.close();
    8789                } catch (IOException e) {
    88                         JOptionPane.showMessageDialog(Main.parent, "Could not read bookmarks.\n"+e.getMessage());
     90                        JOptionPane.showMessageDialog(Main.parent, tr("Could not read bookmarks.")+"\n"+e.getMessage());
    8991                }
    9092        }
     
    110112                        out.close();
    111113                } catch (IOException e) {
    112                         JOptionPane.showMessageDialog(Main.parent, "Could not write bookmark.\n"+e.getMessage());
     114                        JOptionPane.showMessageDialog(Main.parent,tr("Could not write bookmark.")+"\n"+e.getMessage());
    113115                }
    114116        }
  • src/org/openstreetmap/josm/gui/ConflictResolver.java

    r102 r104  
    11package org.openstreetmap.josm.gui;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
     4import static org.openstreetmap.josm.tools.I18n.trn;
    25
    36import java.awt.Component;
     
    7679                }
    7780
    78                 public String getColumnName(int columnIndex) {return columnIndex == 0 ? "Key" : "Value";}
     81                public String getColumnName(int columnIndex) {return columnIndex == 0 ? tr("Key") : tr("Value");}
    7982                public int getColumnCount() {return 2;}
    8083                public boolean isCellEditable(int row, int column) {return false;}
     
    158161               
    159162                if (this.conflicts.isEmpty())
    160                         throw new RuntimeException("No conflicts but in conflict list:\n" + Arrays.toString(conflicts.entrySet().toArray()));
     163                        throw new RuntimeException(tr("No conflicts but in conflict list:\n{0}" , Arrays.toString(conflicts.entrySet().toArray())));
    161164
    162165                // have to initialize the JTables here and not in the declaration, because its constructor
     
    227230                resolveTable.addMouseListener(new DblClickListener(null));
    228231
    229                 add(new JLabel(conflicts.size()+" object"+(conflicts.size()==1?" has":"s have")+" conflicts:"), GBC.eol().insets(0,0,0,10));
     232                add(new JLabel(trn("{0} object has conflicts:","{0} objects have conflicts:",conflicts.size(),conflicts.size())), GBC.eol().insets(0,0,0,10));
    230233
    231234                JPanel p = new JPanel(new GridBagLayout());
    232                 p.add(new JLabel("my version:"), GBC.eol());
     235                p.add(new JLabel(tr("my version:")), GBC.eol());
    233236                p.add(new JScrollPane(myTable), GBC.eol().fill(GBC.BOTH));
    234237                p.add(new JButton(new ResolveAction("down", Resolution.MY)), GBC.eol().anchor(GBC.CENTER).insets(0,5,0,0));
     
    236239
    237240                p = new JPanel(new GridBagLayout());
    238                 p.add(new JLabel("their version:"), GBC.eol());
     241                p.add(new JLabel(tr("their version:")), GBC.eol());
    239242                p.add(new JScrollPane(theirTable), GBC.eol().fill(GBC.BOTH));
    240243                p.add(new JButton(new ResolveAction("down", Resolution.THEIR)), GBC.eol().anchor(GBC.CENTER).insets(0,5,0,0));
     
    242245
    243246                add(new JButton(new ResolveAction("up", null)), GBC.eol().anchor(GBC.CENTER));
    244                 add(new JLabel("resolved version:"), GBC.eol().insets(0,5,0,0));
     247                add(new JLabel(tr("resolved version:")), GBC.eol().insets(0,5,0,0));
    245248                add(new JScrollPane(resolveTable), GBC.eol().anchor(GBC.CENTER).fill(GBC.BOTH));
    246249        }
  • src/org/openstreetmap/josm/gui/MainApplet.java

    r98 r104  
    11package org.openstreetmap.josm.gui;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.awt.GridBagLayout;
     
    3032
    3133        private final static String[][] paramInfo = {
    32                 {"username", "string", "Name of the user."},
    33                 {"password", "string", "OSM Password."},
    34                 {"geometry", "string", "Size the applet to the given geometry (format: WIDTHxHEIGHT)"},
    35                 {"download", "string;string;...", "Download each. Can be x1,y1,x2,y2 an url containing lat=y&lon=x&zoom=z or a filename"},
    36                 {"downloadgps", "string;string;...", "Download each as raw gps. Can be x1,y1,x2,y2 an url containing lat=y&lon=x&zoom=z or a filename"},
    37                 {"selection", "string;string;...", "Add each to the initial selection. Can be a google-like search string or an url which returns osm-xml"},
    38                 {"reset-preferences", "any", "If specified, reset the configuration instead of reading it."}
     34                {"username", tr("string"), tr("Name of the user.")},
     35                {"password", tr("string"), tr("OSM Password.")},
     36                {"geometry", tr("string"), tr("Size the applet to the given geometry (format: WIDTHxHEIGHT)")},
     37                {"download", tr("string;string;..."), tr("Download each. Can be x1,y1,x2,y2 an url containing lat=y&lon=x&zoom=z or a filename")},
     38                {"downloadgps", tr("string;string;..."), tr("Download each as raw gps. Can be x1,y1,x2,y2 an url containing lat=y&lon=x&zoom=z or a filename")},
     39                {"selection", tr("string;string;..."), tr("Add each to the initial selection. Can be a google-like search string or an url which returns osm-xml")},
     40                {"reset-preferences", tr("any"),tr("If specified, reset the configuration instead of reading it.")}
    3941        };
    4042       
     
    6163                if (username == null || password == null) {
    6264                        JPanel p = new JPanel(new GridBagLayout());
    63                         p.add(new JLabel("Username"), GBC.std().insets(0,0,20,0));
     65                        p.add(new JLabel(tr("Username")), GBC.std().insets(0,0,20,0));
    6466                        JTextField user = new JTextField(username == null ? "" : username);
    6567                        p.add(user, GBC.eol().fill(GBC.HORIZONTAL));
    66                         p.add(new JLabel("Password"), GBC.std().insets(0,0,20,0));
     68                        p.add(new JLabel(tr("Password")), GBC.std().insets(0,0,20,0));
    6769                        JPasswordField pass = new JPasswordField(password == null ? "" : password);
    6870                        p.add(pass, GBC.eol().fill(GBC.HORIZONTAL));
  • src/org/openstreetmap/josm/gui/MainApplication.java

    r98 r104  
    11//Licence: GPL
    22package org.openstreetmap.josm.gui;
     3
     4import static org.openstreetmap.josm.tools.I18n.tr;
    35
    46import java.awt.Toolkit;
     
    2022import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    2123import org.openstreetmap.josm.tools.BugReportExceptionHandler;
    22 
    2324/**
    2425 * Main window class application.
     
    2728 */
    2829public class MainApplication extends Main {
    29 
    3030        /**
    3131         * Construct an main frame, ready sized and operating. Does not
     
    4949                                        }
    5050                                        if (modified) {
    51                                                 final String msg = uploadedModified ? "\nHint: Some changes came from uploading new data to the server." : "";
     51                                                final String msg = uploadedModified ? tr("\nHint: Some changes came from uploading new data to the server.") : "";
    5252                                                final int answer = JOptionPane.showConfirmDialog(
    53                                                                 Main.parent, "There are unsaved changes. Really quit?"+msg,
    54                                                                 "Unsaved Changes", JOptionPane.YES_NO_OPTION);
     53                                                                Main.parent, tr("There are unsaved changes. Really quit?")+msg,
     54                                                                tr("Unsaved Changes"), JOptionPane.YES_NO_OPTION);
    5555                                                if (answer != JOptionPane.YES_OPTION)
    5656                                                        return;
     
    7272                List<String> argList = Arrays.asList(argArray);
    7373                if (argList.contains("--help") || argList.contains("-?") || argList.contains("-h")) {
    74                         System.out.println("Java OpenStreetMap Editor");
    75                         System.out.println();
    76                         System.out.println("usage:");
    77                         System.out.println("\tjava -jar josm.jar <option> <option> <option>...");
    78                         System.out.println();
    79                         System.out.println("options:");
    80                         System.out.println("\t--help|-?|-h                              Show this help");
    81                         System.out.println("\t--geometry=widthxheight(+|-)x(+|-)y       Standard unix geometry argument");
    82                         System.out.println("\t[--download=]minlat,minlon,maxlat,maxlon  Download the bounding box");
    83                         System.out.println("\t[--download=]<url>                        Download the location at the url (with lat=x&lon=y&zoom=z)");
    84                         System.out.println("\t[--download=]<filename>                   Open file (as raw gps, if .gpx or .csv)");
    85                         System.out.println("\t--downloadgps=minlat,minlon,maxlat,maxlon Download the bounding box as raw gps");
    86                         System.out.println("\t--selection=<searchstring>                Select with the given search");
    87                         System.out.println("\t--no-fullscreen                           Don't launch in fullscreen mode");
    88                         System.out.println("\t--reset-preferences                       Reset the preferences to default");
    89                         System.out.println();
    90                         System.out.println("examples:");
    91                         System.out.println("\tjava -jar josm.jar track1.gpx track2.gpx london.osm");
    92                         System.out.println("\tjava -jar josm.jar http://www.openstreetmap.org/index.html?lat=43.2&lon=11.1&zoom=13");
    93                         System.out.println("\tjava -jar josm.jar london.osm --selection=http://www.ostertag.name/osm/OSM_errors_node-duplicate.xml");
    94                         System.out.println("\tjava -jar josm.jar 43.2,11.1,43.4,11.4");
    95                         System.out.println();
    96                         System.out.println("Parameters are read in the order they are specified, so make sure you load");
    97                         System.out.println("some data before --selection");
    98                         System.out.println();
    99                         System.out.println("Instead of --download=<bbox> you may specify osm://<bbox>");
     74                        System.out.println(tr("Java OpenStreetMap Editor\n\n"+
     75                                                   "usage:\n"+
     76                                                   "\tjava -jar josm.jar <option> <option> <option>...\n\n"+
     77                                                   "options:\n"+
     78                                                   "\t--help|-?|-h                              Show this help\n"+
     79                                                   "\t--geometry=widthxheight(+|-)x(+|-)y       Standard unix geometry argument\n"+
     80                                                   "\t[--download=]minlat,minlon,maxlat,maxlon  Download the bounding box\n"+
     81                                                   "\t[--download=]<url>                        Download the location at the url (with lat=x&lon=y&zoom=z)\n"+
     82                                                   "\t[--download=]<filename>                   Open file (as raw gps, if .gpx or .csv)\n"+
     83                                                   "\t--downloadgps=minlat,minlon,maxlat,maxlon Download the bounding box as raw gps\n"+
     84                                                   "\t--selection=<searchstring>                Select with the given search\n"+
     85                                                   "\t--no-fullscreen                           Don't launch in fullscreen mode\n"+
     86                                                   "\t--reset-preferences                       Reset the preferences to default\n\n"+
     87                                                   "examples:\n"+
     88                                                   "\tjava -jar josm.jar track1.gpx track2.gpx london.osm\n"+
     89                                                   "\tjava -jar josm.jar http://www.openstreetmap.org/index.html?lat=43.2&lon=11.1&zoom=13\n"+
     90                                                   "\tjava -jar josm.jar london.osm --selection=http://www.ostertag.name/osm/OSM_errors_node-duplicate.xml\n"+
     91                                                   "\tjava -jar josm.jar 43.2,11.1,43.4,11.4\n\n"+
     92
     93                                                   "Parameters are read in the order they are specified, so make sure you load\n"+
     94                                                   "some data before --selection\n\n"+
     95                                                   "Instead of --download=<bbox> you may specify osm://<bbox>\n"));
    10096                        System.exit(0);
    10197                }
     
    10399                final File prefDir = new File(Main.pref.getPreferencesDir());
    104100                if (prefDir.exists() && !prefDir.isDirectory()) {
    105                         JOptionPane.showMessageDialog(null, "Cannot open preferences directory: "+Main.pref.getPreferencesDir());
     101                        JOptionPane.showMessageDialog(null, tr("Cannot open preferences directory: {0}",Main.pref.getPreferencesDir()));
    106102                        return;
    107103                }
     
    125121
    126122                preConstructorInit(args);
    127                 JFrame mainFrame = new JFrame("Java Open Street Map - Editor");
     123                JFrame mainFrame = new JFrame(tr("Java Open Street Map - Editor"));
    128124                Main.parent = mainFrame;
    129125                Main main = new MainApplication(mainFrame);
  • src/org/openstreetmap/josm/gui/MapFrame.java

    r103 r104  
    7878                toolBarActions.setFloatable(false);
    7979                toolBarActions.add(new IconToggleButton(new ZoomAction(this)));
    80                 final SelectionAction selectionAction = new SelectionAction(this);
     80                final Action selectionAction = new SelectionAction.Group(this);
    8181                toolBarActions.add(new IconToggleButton(selectionAction));
    8282                toolBarActions.add(new IconToggleButton(new MoveAction(this)));
  • src/org/openstreetmap/josm/gui/MapStatus.java

    r103 r104  
    11package org.openstreetmap.josm.gui;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.awt.AWTEvent;
     
    203205                        }
    204206                        public void mouseMoved(MouseEvent e) {
     207                                if (mv.center == null)
     208                                        return;
    205209                                // Do not update the view, if ctrl is pressed.
    206210                                if ((e.getModifiersEx() & MouseEvent.CTRL_DOWN_MASK) == 0) {
     
    215219                setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
    216220                setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
    217                 add(new JLabel("Lat/Lon "));
     221                add(new JLabel(tr("Lat/Lon ")));
    218222                add(positionText);
    219                 add(new JLabel(" Object "));
     223                add(new JLabel(tr(" Object ")));
    220224                add(nameText);
    221225
  • src/org/openstreetmap/josm/gui/MapView.java

    r103 r104  
    11package org.openstreetmap.josm.gui;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.awt.Color;
     
    155157                        dataLayer.listenerModified.add(new ModifiedChangedListener(){
    156158                                public void modifiedChanged(boolean value, OsmDataLayer source) {
    157                                         JOptionPane.getFrameForComponent(Main.parent).setTitle((value?"*":"")+"Java Open Street Map - Editor");
     159                                        JOptionPane.getFrameForComponent(Main.parent).setTitle(tr("{0}Java Open Street Map - Editor",(value?"*":"")));
    158160                                }
    159161                        });
     
    193195                int curLayerPos = layers.indexOf(layer);
    194196                if (curLayerPos == -1)
    195                         throw new IllegalArgumentException("layer not in list.");
     197                        throw new IllegalArgumentException(tr("layer not in list."));
    196198                if (pos == curLayerPos)
    197199                        return; // already in place.
     
    322324        public void setActiveLayer(Layer layer) {
    323325                if (!layers.contains(layer))
    324                         throw new IllegalArgumentException("layer must be in layerlist");
     326                        throw new IllegalArgumentException(tr("layer must be in layerlist"));
    325327                Layer old = activeLayer;
    326328                activeLayer = layer;
  • src/org/openstreetmap/josm/gui/NavigatableComponent.java

    r99 r104  
    2323 */
    2424public class NavigatableComponent extends JComponent {
     25
    2526
    2627        public static final EastNorth world = Main.proj.latlon2eastNorth(new LatLon(Projection.MAX_LAT, Projection.MAX_LON));
  • src/org/openstreetmap/josm/gui/PleaseWaitRunnable.java

    r103 r104  
    11package org.openstreetmap.josm.gui;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.awt.EventQueue;
     
    3032 */
    3133public abstract class PleaseWaitRunnable implements Runnable {
     34
    3235        public final JDialog pleaseWaitDlg;
    3336        public String errorMessage;
     
    3639        private boolean closeDialogCalled = false;
    3740
    38         protected final JLabel currentAction = new JLabel("Contact OSM server...");
     41        protected final JLabel currentAction = new JLabel(tr("Contact OSM server..."));
    3942        protected final BoundedRangeModel progress = progressBar.getModel();
    4043
     
    4952                pane.add(currentAction, GBC.eol().fill(GBC.HORIZONTAL));
    5053                pane.add(progressBar, GBC.eop().fill(GBC.HORIZONTAL));
    51                 JButton cancel = new JButton("Cancel");
     54                JButton cancel = new JButton(tr(tr("Cancel")));
    5255                pane.add(cancel, GBC.eol().anchor(GBC.CENTER));
    5356                pleaseWaitDlg.setContentPane(pane);
     
    7578                } catch (SAXException x) {
    7679                        x.printStackTrace();
    77                         errorMessage = "Error while parsing: "+x.getMessage();
     80                        errorMessage = tr("Error while parsing: ")+x.getMessage();
    7881                } catch (FileNotFoundException x) {
    7982                        x.printStackTrace();
    80                         errorMessage = "Not found: " + x.getMessage();
     83                        errorMessage = tr("Not found: ") + x.getMessage();
    8184                } catch (IOException x) {
    8285                        x.printStackTrace();
  • src/org/openstreetmap/josm/gui/PreferenceDialog.java

    r100 r104  
    11package org.openstreetmap.josm.gui;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.awt.Color;
     
    8183                                String name = (String)colors.getValueAt(i, 0);
    8284                                Color col = (Color)colors.getValueAt(i, 1);
    83                                 Main.pref.put("color."+name, ColorHelper.color2html(col));
     85                                Main.pref.put("color."+tr(name), ColorHelper.color2html(col));
    8486                        }
    8587
    8688                        if (requiresRestart)
    87                                 JOptionPane.showMessageDialog(PreferenceDialog.this, "You have to restart JOSM for some settings to take effect.");
     89                                JOptionPane.showMessageDialog(PreferenceDialog.this,tr("You have to restart JOSM for some settings to take effect."));
    8890                        Main.parent.repaint();
    8991                        setVisible(false);
     
    150152         * The checkbox stating whether nodes should be merged together.
    151153         */
    152         private JCheckBox drawRawGpsLines = new JCheckBox("Draw lines between raw gps points.");
     154        private JCheckBox drawRawGpsLines = new JCheckBox(tr("Draw lines between raw gps points."));
    153155        /**
    154156         * The checkbox stating whether raw gps lines should be forced.
    155157         */
    156         private JCheckBox forceRawGpsLines = new JCheckBox("Force lines if no segments imported.");
    157         private JCheckBox directionHint = new JCheckBox("Draw Direction Arrows");
     158        private JCheckBox forceRawGpsLines = new JCheckBox(tr("Force lines if no segments imported."));
     159        private JCheckBox directionHint = new JCheckBox(tr("Draw Direction Arrows"));
    158160        private JTable colors;
    159161
     
    166168         */
    167169        public PreferenceDialog() {
    168                 super(JOptionPane.getFrameForComponent(Main.parent), "Preferences");
     170                super(JOptionPane.getFrameForComponent(Main.parent), tr("Preferences"));
    169171
    170172                // look and feel combo box
     
    215217                csvImportString.setText(Main.pref.get("csv.importstring"));
    216218                drawRawGpsLines.setSelected(Main.pref.getBoolean("draw.rawgps.lines"));
    217                 forceRawGpsLines.setToolTipText("Force drawing of lines if the imported data contain no line information.");
     219                forceRawGpsLines.setToolTipText(tr("Force drawing of lines if the imported data contain no line information."));
    218220                forceRawGpsLines.setSelected(Main.pref.getBoolean("draw.rawgps.lines.force"));
    219221                forceRawGpsLines.setEnabled(drawRawGpsLines.isSelected());
    220                 directionHint.setToolTipText("Draw direction hints for all segments.");
     222                directionHint.setToolTipText(tr("Draw direction hints for all segments."));
    221223                directionHint.setSelected(Main.pref.getBoolean("draw.segment.direction"));
    222224
     
    255257                colors.getColumnModel().getColumn(1).setWidth(100);
    256258
    257                 JButton colorEdit = new JButton("Choose");
     259                JButton colorEdit = new JButton(tr("Choose"));
    258260                colorEdit.addActionListener(new ActionListener(){
    259261                        public void actionPerformed(ActionEvent e) {
    260262                                if (colors.getSelectedRowCount() == 0) {
    261                                         JOptionPane.showMessageDialog(PreferenceDialog.this, "Please select a color.");
     263                                        JOptionPane.showMessageDialog(PreferenceDialog.this, tr("Please select a color."));
    262264                                        return;
    263265                                }
    264266                                int sel = colors.getSelectedRow();
    265267                                JColorChooser chooser = new JColorChooser((Color)colors.getValueAt(sel, 1));
    266                                 int answer = JOptionPane.showConfirmDialog(PreferenceDialog.this, chooser, "Choose a color for "+colors.getValueAt(sel, 0), JOptionPane.OK_CANCEL_OPTION);
     268                                int answer = JOptionPane.showConfirmDialog(PreferenceDialog.this, chooser, tr("Choose a color for {0}", colors.getValueAt(sel, 0)), JOptionPane.OK_CANCEL_OPTION);
    267269                                if (answer == JOptionPane.OK_OPTION)
    268270                                        colors.setValueAt(chooser.getColor(), sel, 1);
     
    271273
    272274                // setting tooltips
    273                 osmDataServer.setToolTipText("The base URL to the OSM server (REST API)");
    274                 osmDataUsername.setToolTipText("Login name (email) to the OSM account.");
    275                 osmDataPassword.setToolTipText("Login password to the OSM account. Leave blank to not store any password.");
    276                 wmsServerBaseUrl.setToolTipText("The base URL to the server retrieving WMS background pictures from.");
    277                 csvImportString.setToolTipText("<html>Import string specification. lat/lon and time are imported.<br>" +
     275                osmDataServer.setToolTipText(tr("The base URL to the OSM server (REST API)"));
     276                osmDataUsername.setToolTipText(tr("Login name (email) to the OSM account."));
     277                osmDataPassword.setToolTipText(tr("Login password to the OSM account. Leave blank to not store any password."));
     278                wmsServerBaseUrl.setToolTipText(tr("The base URL to the server retrieving WMS background pictures from."));
     279                csvImportString.setToolTipText(tr("<html>Import string specification. lat/lon and time are imported.<br>" +
    278280                                "<b>lat</b>: The latitude coordinate<br>" +
    279281                                "<b>lon</b>: The longitude coordinate<br>" +
     
    281283                                "<b>ignore</b>: Skip this field<br>" +
    282284                                "An example: \"ignore ignore lat lon\" will use ' ' as delimiter, skip the first two values and read then lat/lon.<br>" +
    283                 "Other example: \"lat,lon\" will just read lat/lon values comma seperated.</html>");
    284                 drawRawGpsLines.setToolTipText("If your gps device draw to few lines, select this to draw lines along your way.");
    285                 colors.setToolTipText("Colors used by different objects in JOSM.");
     285                "Other example: \"lat,lon\" will just read lat/lon values comma seperated.</html>"));
     286                drawRawGpsLines.setToolTipText(tr("If your gps device draw to few lines, select this to draw lines along your way."));
     287                colors.setToolTipText(tr("Colors used by different objects in JOSM."));
    286288
    287289                // creating the gui
    288290
    289291                // Display tab
    290                 JPanel display = createPreferenceTab("display", "Display Settings", "Various settings that influence the visual representation of the whole program.");
    291                 display.add(new JLabel("Look and Feel"), GBC.std());
     292                JPanel display = createPreferenceTab("display", tr("Display Settings"), tr("Various settings that influence the visual representation of the whole program."));
     293                display.add(new JLabel(tr("Look and Feel")), GBC.std());
    292294                display.add(GBC.glue(5,0), GBC.std().fill(GBC.HORIZONTAL));
    293295                display.add(lafCombo, GBC.eol().fill(GBC.HORIZONTAL));
     
    295297                display.add(forceRawGpsLines, GBC.eop().insets(40,0,0,0));
    296298                display.add(directionHint, GBC.eop().insets(20,0,0,0));
    297                 display.add(new JLabel("Colors"), GBC.eol());
     299                display.add(new JLabel(tr("Colors")), GBC.eol());
    298300                colors.setPreferredScrollableViewportSize(new Dimension(100,112));
    299301                display.add(new JScrollPane(colors), GBC.eol().fill(GBC.BOTH));
     
    302304
    303305                // Connection tab
    304                 JPanel con = createPreferenceTab("connection", "Connection Settings", "Connection Settings to the OSM server.");
    305                 con.add(new JLabel("Base Server URL"), GBC.std());
     306                JPanel con = createPreferenceTab("connection", tr("Connection Settings"), tr("Connection Settings to the OSM server."));
     307                con.add(new JLabel(tr("Base Server URL")), GBC.std());
    306308                con.add(osmDataServer, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,5));
    307                 con.add(new JLabel("OSM username (email)"), GBC.std());
     309                con.add(new JLabel(tr("OSM username (email)")), GBC.std());
    308310                con.add(osmDataUsername, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,5));
    309                 con.add(new JLabel("OSM password"), GBC.std());
     311                con.add(new JLabel(tr("OSM password")), GBC.std());
    310312                con.add(osmDataPassword, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,0));
    311                 JLabel warning = new JLabel("<html>" +
     313                JLabel warning = new JLabel(tr("<html>" +
    312314                                "WARNING: The password is stored in plain text in the preferences file.<br>" +
    313315                                "The password is transfered in plain text to the server, encoded in the url.<br>" +
    314                 "<b>Do not use a valuable Password.</b></html>");
     316                "<b>Do not use a valuable Password.</b></html>"));
    315317                warning.setFont(warning.getFont().deriveFont(Font.ITALIC));
    316318                con.add(warning, GBC.eop().fill(GBC.HORIZONTAL));
     
    318320                //con.add(wmsServerBaseUrl, GBC.eop().fill(GBC.HORIZONTAL));
    319321                //con.add(Box.createVerticalGlue(), GBC.eol().fill(GBC.VERTICAL));
    320                 con.add(new JLabel("CSV import specification (empty: read from first line in data)"), GBC.eol());
     322                con.add(new JLabel(tr("CSV import specification (empty: read from first line in data)")), GBC.eol());
    321323                con.add(csvImportString, GBC.eop().fill(GBC.HORIZONTAL));
    322324                con.add(Box.createVerticalGlue(), GBC.eol().fill(GBC.VERTICAL));
    323325
    324326                // Map tab
    325                 JPanel map = createPreferenceTab("map", "Map Settings", "Settings for the map projection and data interpretation.");
    326                 map.add(new JLabel("Projection method"), GBC.std());
     327                JPanel map = createPreferenceTab("map", tr("Map Settings"), tr("Settings for the map projection and data interpretation."));
     328                map.add(new JLabel(tr("Projection method")), GBC.std());
    327329                map.add(GBC.glue(5,0), GBC.std().fill(GBC.HORIZONTAL));
    328330                map.add(projectionCombo, GBC.eol().fill(GBC.HORIZONTAL).insets(0,0,0,5));
  • src/org/openstreetmap/josm/gui/dialogs/CommandStackDialog.java

    r100 r104  
    11package org.openstreetmap.josm.gui.dialogs;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.awt.BorderLayout;
     
    2830
    2931        public CommandStackDialog(final MapFrame mapFrame) {
    30                 super("Command Stack", "commandstack", "Open a list of all commands (undo buffer).", KeyEvent.VK_C);
     32                super(tr("Command Stack"), "commandstack", tr("Open a list of all commands (undo buffer)."), KeyEvent.VK_C);
    3133                setPreferredSize(new Dimension(320,100));
    3234                mapFrame.mapView.addLayerChangeListener(new LayerChangeListener(){
  • src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java

    r100 r104  
    11package org.openstreetmap.josm.gui.dialogs;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.awt.BorderLayout;
     
    4749
    4850        public ConflictDialog() {
    49                 super("Conflict", "conflict", "Merging conflicts.", KeyEvent.VK_C);
     51                super(tr("Conflict"), "conflict", tr("Merging conflicts."), KeyEvent.VK_C);
    5052                displaylist.setCellRenderer(new OsmPrimitivRenderer());
    5153                displaylist.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
     
    5961
    6062                JPanel buttonPanel = new JPanel(new GridLayout(1,2));
    61                 JButton button = new JButton("Resolve", ImageProvider.get("dialogs", "conflict"));
    62                 button.setToolTipText("Open a merge dialog of all selected items in the list above.");
     63                JButton button = new JButton(tr("Resolve"), ImageProvider.get("dialogs", "conflict"));
     64                button.setToolTipText(tr("Open a merge dialog of all selected items in the list above."));
    6365                button.addActionListener(new ActionListener(){
    6466                        public void actionPerformed(ActionEvent e) {
     
    6870                buttonPanel.add(button);
    6971
    70                 button = new JButton("Select", ImageProvider.get("mapmode", "selection"));
    71                 button.setToolTipText("Set the selected elements on the map to the selected items in the list above.");
     72                button = new JButton(tr("Select"), ImageProvider.get("mapmode/selection/select"));
     73                button.setToolTipText(tr("Set the selected elements on the map to the selected items in the list above."));
    7274                button.addActionListener(new ActionListener(){
    7375                        public void actionPerformed(ActionEvent e) {
     
    102104        private final void resolve() {
    103105                if (displaylist.getSelectedIndex() == -1) {
    104                         JOptionPane.showMessageDialog(Main.parent, "Please select something from the conflict list.");
     106                        JOptionPane.showMessageDialog(Main.parent,tr("Please select something from the conflict list."));
    105107                        return;
    106108                }
     
    111113                }
    112114                ConflictResolver resolver = new ConflictResolver(sel);
    113                 int answer = JOptionPane.showConfirmDialog(Main.parent, resolver, "Resolve Conflicts", JOptionPane.OK_CANCEL_OPTION);
     115                int answer = JOptionPane.showConfirmDialog(Main.parent, resolver, tr("Resolve Conflicts"), JOptionPane.OK_CANCEL_OPTION);
    114116                if (answer != JOptionPane.OK_OPTION)
    115117                        return;
  • src/org/openstreetmap/josm/gui/dialogs/LayerList.java

    r103 r104  
    11package org.openstreetmap.josm.gui.dialogs;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.awt.BorderLayout;
     
    5557                public DeleteLayerAction(Layer layer) {
    5658                        super("Delete", ImageProvider.get("dialogs", "delete"));
    57                         putValue(SHORT_DESCRIPTION, "Delete the selected layer.");
     59                        putValue(SHORT_DESCRIPTION, tr("Delete the selected layer."));
    5860                        this.layer = layer;
    5961                }
     
    7678
    7779                public ShowHideLayerAction(Layer layer) {
    78                         super("Show/Hide", ImageProvider.get("dialogs", "showhide"));
    79                         putValue(SHORT_DESCRIPTION, "Toggle visible state of the selected layer.");
     80                        super(tr("Show/Hide"), ImageProvider.get("dialogs", "showhide"));
     81                        putValue(SHORT_DESCRIPTION, tr("Toggle visible state of the selected layer."));
    8082                        this.layer = layer;
    8183                }
     
    115117         */
    116118        public LayerList(MapFrame mapFrame) {
    117                 super("Layers", "layerlist", "Open a list of all loaded layers.", KeyEvent.VK_L);
     119                super(tr("Layers"), "layerlist", tr("Open a list of all loaded layers."), KeyEvent.VK_L);
    118120                instance = new JList(model);
    119121                setPreferredSize(new Dimension(320,100));
     
    188190                };
    189191
    190                 upButton.setToolTipText("Move the selected layer one row up.");
     192                upButton.setToolTipText(tr("Move the selected layer one row up."));
    191193                upButton.addActionListener(upDown);
    192194                upButton.setActionCommand("up");
    193195                buttonPanel.add(upButton);
    194196
    195                 downButton.setToolTipText("Move the selected layer one row down.");
     197                downButton.setToolTipText(tr("Move the selected layer one row down."));
    196198                downButton.addActionListener(upDown);
    197199                downButton.setActionCommand("down");
     
    206208                buttonPanel.add(deleteButton);
    207209
    208                 mergeButton.setToolTipText("Merge the selected layer into the layer directly below.");
     210                mergeButton.setToolTipText(tr("Merge the selected layer into the layer directly below."));
    209211                mergeButton.addActionListener(new ActionListener(){
    210212                        public void actionPerformed(ActionEvent e) {
  • src/org/openstreetmap/josm/gui/dialogs/LayerListPopup.java

    r103 r104  
    11package org.openstreetmap.josm.gui.dialogs;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.awt.Component;
     
    2123            private final Layer layer;
    2224            public InfoAction(Layer layer) {
    23                 super("Info", ImageProvider.get("info"));
     25                super(tr("Info"), ImageProvider.get("info"));
    2426                    this.layer = layer;
    2527            }
  • src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java

    r100 r104  
    11package org.openstreetmap.josm.gui.dialogs;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
     4import static org.openstreetmap.josm.tools.I18n.trn;
    25
    36import java.awt.BorderLayout;
     
    8386                String key = data.getValueAt(row, 0).toString();
    8487                Collection<OsmPrimitive> sel = Main.ds.getSelected();
    85                 String msg = "<html>This will change "+sel.size()+" object"+(sel.size()==1?"":"s")+".<br><br>"+
    86                 "Please select a new value for '"+key+"'.<br>(Empty string deletes the key.)";
     88                String msg = "<html>"+trn("This will change {0} object.", "This will change {0} objects.", sel.size(), sel.size())+"<br><br> "+tr("Please select a new value for '{0}'.<br>(Empty string deletes the key.)</html>)", key);
    8789                final JComboBox combo = (JComboBox)data.getValueAt(row, 1);
    8890                JPanel p = new JPanel(new BorderLayout());
    89                 p.add(new JLabel(msg+"</html>"), BorderLayout.NORTH);
     91                p.add(new JLabel(msg), BorderLayout.NORTH);
    9092                p.add(combo, BorderLayout.CENTER);
    9193
     
    9698                        }
    9799                };
    98                 final JDialog dlg = optionPane.createDialog(Main.parent, "Change values?");
     100                final JDialog dlg = optionPane.createDialog(Main.parent, tr("Change values?"));
    99101                combo.getEditor().addActionListener(new ActionListener(){
    100102                        public void actionPerformed(ActionEvent e) {
     
    114116
    115117                String value = combo.getEditor().getItem().toString();
    116                 if (value.equals("<different>"))
     118                if (value.equals(tr("<different>")))
    117119                        return;
    118120                if (value.equals(""))
     
    134136
    135137                JPanel p = new JPanel(new BorderLayout());
    136                 p.add(new JLabel("<html>This will change "+sel.size()+" object"+(sel.size()==1?"":"s")+".<br><br>"+
    137                 "Please select a key"), BorderLayout.NORTH);
     138                p.add(new JLabel(trn("<html>This will change {0} object.<br>br>Please select a key",
     139                                "<html>This will change {0} objects.<br>br>Please select a key",
     140                                sel.size(),sel.size())),
     141                                BorderLayout.NORTH);
    138142                TreeSet<String> allKeys = new TreeSet<String>();
    139143                for (OsmPrimitive osm : Main.ds.allNonDeletedPrimitives())
     
    147151                JPanel p2 = new JPanel(new BorderLayout());
    148152                p.add(p2, BorderLayout.SOUTH);
    149                 p2.add(new JLabel("Please select a value"), BorderLayout.NORTH);
     153                p2.add(new JLabel(tr("Please select a value")), BorderLayout.NORTH);
    150154                final JTextField values = new JTextField();
    151155                p2.add(values, BorderLayout.CENTER);
     
    156160                        }
    157161                };
    158                 pane.createDialog(Main.parent, "Change values?").setVisible(true);
     162                pane.createDialog(Main.parent, tr("Change values?")).setVisible(true);
    159163                if (!Integer.valueOf(JOptionPane.OK_OPTION).equals(pane.getValue()))
    160164                        return;
     
    198202         */
    199203        public PropertiesDialog(MapFrame mapFrame) {
    200                 super("Properties", "propertiesdialog", "Property for selected objects.", KeyEvent.VK_P);
     204                super(tr("Properties"), "propertiesdialog", tr("Property for selected objects."), KeyEvent.VK_P);
    201205
    202206                setPreferredSize(new Dimension(320,150));
    203207
    204                 data.setColumnIdentifiers(new String[]{"Key", "Value"});
     208                data.setColumnIdentifiers(new String[]{tr("Key"),tr("Value")});
    205209                propertyTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    206210                propertyTable.setDefaultRenderer(JComboBox.class, new DefaultTableCellRenderer(){
     
    210214                                        String str = ((JComboBox)value).getEditor().getItem().toString();
    211215                                        ((JLabel)c).setText(str);
    212                                         if (str.equals("<different>"))
     216                                        if (str.equals(tr("<different>")))
    213217                                                c.setFont(c.getFont().deriveFont(Font.ITALIC));
    214218                                }
     
    231235                        public void actionPerformed(ActionEvent e) {
    232236                                int sel = propertyTable.getSelectedRow();
    233                                 if (e.getActionCommand().equals("Add"))
     237                                if (e.getActionCommand().equals(tr("Add")))
    234238                                        add();
    235                                 else if (e.getActionCommand().equals("Edit")) {
     239                                else if (e.getActionCommand().equals(tr("Edit"))) {
    236240                                        if (sel == -1)
    237                                                 JOptionPane.showMessageDialog(Main.parent, "Please select the row to edit.");
     241                                                JOptionPane.showMessageDialog(Main.parent, tr("Please select the row to edit."));
    238242                                        else
    239243                                                edit(sel);
    240                                 } else if (e.getActionCommand().equals("Delete")) {
     244                                } else if (e.getActionCommand().equals(tr("Delete"))) {
    241245                                        if (sel == -1)
    242                                                 JOptionPane.showMessageDialog(Main.parent, "Please select the row to delete.");
     246                                                JOptionPane.showMessageDialog(Main.parent, tr("Please select the row to delete."));
    243247                                        else
    244248                                                delete(sel);
     
    246250                        }
    247251                };
    248                 buttonPanel.add(createButton("Add", "Add a new key/value pair to all objects", KeyEvent.VK_A, buttonAction));
    249                 buttonPanel.add(createButton("Edit", "Edit the value of the selected key for all objects", KeyEvent.VK_E, buttonAction));
    250                 buttonPanel.add(createButton("Delete", "Delete the selected key in all objects", KeyEvent.VK_D, buttonAction));
     252                buttonPanel.add(createButton(tr("Add"),tr("Add a new key/value pair to all objects"), KeyEvent.VK_A, buttonAction));
     253                buttonPanel.add(createButton(tr("Edit"),tr( "Edit the value of the selected key for all objects"), KeyEvent.VK_E, buttonAction));
     254                buttonPanel.add(createButton(tr("Delete"),tr("Delete the selected key in all objects"), KeyEvent.VK_D, buttonAction));
    251255                add(buttonPanel, BorderLayout.SOUTH);
    252256        }
     
    294298                        JComboBox value = new JComboBox(e.getValue().toArray());
    295299                        value.setEditable(true);
    296                         value.getEditor().setItem(valueCount.get(e.getKey()) != newSelection.size() ? "<different>" : e.getValue().iterator().next());
     300                        value.getEditor().setItem(valueCount.get(e.getKey()) != newSelection.size() ? tr("<different>") : e.getValue().iterator().next());
    297301                        data.addRow(new Object[]{e.getKey(), value});
    298302                }
  • src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java

    r103 r104  
    11package org.openstreetmap.josm.gui.dialogs;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.awt.BorderLayout;
     
    5355 */
    5456public class SelectionListDialog extends ToggleDialog implements SelectionChangedListener {
    55 
    5657        public static enum SearchMode {replace, add, remove}
    5758
     
    6263                private OsmIdReader idReader = new OsmIdReader();
    6364                public SelectionWebsiteLoader(String urlStr, SearchMode mode) {
    64                 super("Load Selection");
     65                super(tr("Load Selection"));
    6566                this.mode = mode;
    6667                URL u = null;
     
    6970        }
    7071                @Override protected void realRun() {
    71                         currentAction.setText("Contact "+url.getHost()+"...");
     72                        currentAction.setText(tr("Contact {0}...", url.getHost()));
    7273                        sel = mode != SearchMode.remove ? new LinkedList<OsmPrimitive>() : Main.ds.allNonDeletedPrimitives();
    7374                        try {
    7475                        URLConnection con = url.openConnection();
    7576                        InputStream in = new ProgressReader(con, progress, currentAction);
    76                                 currentAction.setText("Downloading...");
     77                                currentAction.setText(tr("Downloading..."));
    7778                                Map<Long, String> ids = idReader.parseIds(in);
    7879                        for (OsmPrimitive osm : Main.ds.allNonDeletedPrimitives()) {
     
    8687                } catch (IOException e) {
    8788                        e.printStackTrace();
    88                         JOptionPane.showMessageDialog(Main.parent, "Could not read from url: '"+url+"'");
     89                        JOptionPane.showMessageDialog(Main.parent, tr("Could not read from url: '{0}'",url));
    8990                } catch (SAXException e) {
    9091                        e.printStackTrace();
    91                         JOptionPane.showMessageDialog(Main.parent, "Parsing error in url: '"+url+"'");
     92                        JOptionPane.showMessageDialog(Main.parent,tr("Parsing error in url: '{0}'",url));
    9293                }
    9394        }
     
    116117         */
    117118        public SelectionListDialog(MapFrame mapFrame) {
    118                 super("Current Selection", "selectionlist", "Open a selection list window.", KeyEvent.VK_E);
     119                super(tr("Current Selection"), "selectionlist", tr("Open a selection list window."), KeyEvent.VK_E);
    119120                setPreferredSize(new Dimension(320,150));
    120121                displaylist.setCellRenderer(new OsmPrimitivRenderer());
     
    132133                JPanel buttonPanel = new JPanel(new GridLayout(1,2));
    133134               
    134                 JButton button = new JButton("Select", ImageProvider.get("mapmode", "selection"));
    135                 button.setToolTipText("Set the selected elements on the map to the selected items in the list above.");
     135                JButton button = new JButton(tr("Select"), ImageProvider.get("mapmode/selection/select"));
     136                button.setToolTipText(tr("Set the selected elements on the map to the selected items in the list above."));
    136137                button.addActionListener(new ActionListener(){
    137138                        public void actionPerformed(ActionEvent e) {
     
    141142                buttonPanel.add(button);
    142143
    143                 button = new JButton("Reload", ImageProvider.get("dialogs", "refresh"));
    144                 button.setToolTipText("Refresh the selection list.");
     144                button = new JButton(tr("Reload"), ImageProvider.get("dialogs", "refresh"));
     145                button.setToolTipText(tr("Refresh the selection list."));
    145146                button.addActionListener(new ActionListener(){
    146147                        public void actionPerformed(ActionEvent e) {
     
    150151                buttonPanel.add(button);
    151152               
    152                 button = new JButton("Search", ImageProvider.get("dialogs", "search"));
    153                 button.setToolTipText("Search for objects.");
     153                button = new JButton(tr("Search"), ImageProvider.get("dialogs", "search"));
     154                button.setToolTipText(tr("Search for objects."));
    154155                button.addActionListener(new ActionListener(){
    155156                        private String lastSearch = "";
    156157                        public void actionPerformed(ActionEvent e) {
    157                                 JLabel label = new JLabel("Please enter a search string.");
     158                                JLabel label = new JLabel(tr("Please enter a search string."));
    158159                                final JTextField input = new JTextField(lastSearch);
    159                                 input.setToolTipText("<html>Fulltext search.<ul>" +
     160                                input.setToolTipText(tr("<html>Fulltext search.<ul>" +
    160161                                                "<li><code>Baker Street</code>  - 'Baker' and 'Street' in any key or name.</li>" +
    161162                                                "<li><code>\"Baker Street\"</code>  - 'Baker Street' in any key or name.</li>" +
     
    163164                                                "<li><code>-name:Bak</code>  - not 'Bak' in the name.</li>" +
    164165                                                "<li><code>foot:</code>  - key=foot set to any value." +
    165                                                 "</ul></html>");
    166 
    167                                 JRadioButton replace = new JRadioButton("replace selection", true);
    168                                 JRadioButton add = new JRadioButton("add to selection", false);
    169                                 JRadioButton remove = new JRadioButton("remove from selection", false);
     166                                                "</ul></html>"));
     167
     168                                JRadioButton replace = new JRadioButton(tr("replace selection"), true);
     169                                JRadioButton add = new JRadioButton(tr("add to selection"), false);
     170                                JRadioButton remove = new JRadioButton(tr("remove from selection"), false);
    170171                                ButtonGroup bg = new ButtonGroup();
    171172                                bg.add(replace);
     
    184185                    }
    185186                                };
    186                                 pane.createDialog(Main.parent, "Search").setVisible(true);
     187                                pane.createDialog(Main.parent,tr("Search")).setVisible(true);
    187188                                if (!Integer.valueOf(JOptionPane.OK_OPTION).equals(pane.getValue()))
    188189                                        return;
  • src/org/openstreetmap/josm/gui/layer/GeoImageLayer.java

    r103 r104  
    11package org.openstreetmap.josm.gui.layer;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
     4import static org.openstreetmap.josm.tools.I18n.trn;
    25
    36import java.awt.BorderLayout;
     
    8083                private final RawGpsLayer gpsLayer;
    8184                public Loader(Collection<File> files, RawGpsLayer gpsLayer) {
    82                         super("Images");
     85                        super(tr("Images"));
    8386                        this.files = files;
    8487                        this.gpsLayer = gpsLayer;
    8588                }
    8689                @Override protected void realRun() throws IOException {
    87                         currentAction.setText("Read GPS...");
     90                        currentAction.setText(tr("Read GPS..."));
    8891                        LinkedList<TimedPoint> gps = new LinkedList<TimedPoint>();
    8992
     
    9598                                        for (GpsPoint p : c) {
    9699                                                if (p.time == null)
    97                                                         throw new IOException("No time for point "+p.latlon.lat()+","+p.latlon.lon());
     100                                                        throw new IOException(tr("No time for point {0},{1}",p.latlon.lat(),p.latlon.lon()));
    98101                                                Matcher m = reg.matcher(p.time);
    99102                                                if (!m.matches())
    100                                                         throw new IOException("Cannot read time from point "+p.latlon.lat()+","+p.latlon.lon());
     103                                                        throw new IOException(tr("Cannot read time from point {0},{1}",p.latlon.lat(),p.latlon.lon()));
    101104                                                Date d = DateParser.parse(m.group(1)+" "+m.group(2));
    102105                                                gps.add(new TimedPoint(d, p.eastNorth));
    103106                                                if (last != null && last.after(d))
    104                                                         throw new IOException("Time loop in gps data.");
     107                                                        throw new IOException(tr("Time loop in gps data."));
    105108                                                last = d;
    106109                                        }
     
    108111                        } catch (ParseException e) {
    109112                                e.printStackTrace();
    110                                 throw new IOException("Incorrect date information");
     113                                throw new IOException(tr("Incorrect date information"));
    111114                        }
    112115
    113116                        if (gps.isEmpty()) {
    114                                 errorMessage = "No images with readable timestamps found.";
     117                                errorMessage = tr("No images with readable timestamps found.");
    115118                                return;
    116119                        }
     
    123126                                if (cancelled)
    124127                                        break;
    125                                 currentAction.setText("Reading "+f.getName()+"...");
     128                                currentAction.setText(tr("Reading {0}...",f.getName()));
    126129                                progress.setValue(i++);
    127130
     
    183186
    184187        private GeoImageLayer(final ArrayList<ImageEntry> data, LinkedList<TimedPoint> gps) {
    185                 super("Geotagged Images");
     188                super(tr("Geotagged Images"));
    186189                this.data = data;
    187190                this.gps = gps;
     
    250253                p.add(new JLabel(getToolTipText()), GBC.eop());
    251254
    252                 p.add(new JLabel("GPS start: "+dateFormat.format(gps.getFirst().time)), GBC.eol());
    253                 p.add(new JLabel("GPS end: "+dateFormat.format(gps.getLast().time)), GBC.eop());
    254 
    255                 p.add(new JLabel("current delta: "+(delta/1000.0)+"s"), GBC.eol());
    256                 p.add(new JLabel("timezone difference: "+(gpstimezone>0?"+":"")+(gpstimezone/1000/60/60)), GBC.eop());
     255                p.add(new JLabel(tr("GPS start: {0}",dateFormat.format(gps.getFirst().time))), GBC.eol());
     256                p.add(new JLabel(tr("GPS end: {0}",dateFormat.format(gps.getLast().time))), GBC.eop());
     257
     258                p.add(new JLabel(tr("current delta: {0}s",(delta/1000.0))), GBC.eol());
     259                p.add(new JLabel(tr("timezone difference: ")+(gpstimezone>0?"+":"")+(gpstimezone/1000/60/60)), GBC.eop());
    257260
    258261                JList img = new JList(data.toArray());
     
    278281                        if (e.pos != null)
    279282                                i++;
    280                 return data.size()+" images, "+i+" within the track.";
     283                return trn("{0} image. {1} within the track.","{0} images. {1} within the track.",data.size(),data.size(),i);
    281284        }
    282285
     
    316319
    317320        @Override public Component[] getMenuEntries() {
    318                 JMenuItem sync = new JMenuItem("Sync clock", ImageProvider.get("clock"));
     321                JMenuItem sync = new JMenuItem(tr("Sync clock"), ImageProvider.get("clock"));
    319322                sync.addActionListener(new ActionListener(){
    320323                        public void actionPerformed(ActionEvent e) {
     
    327330                                        }
    328331                                        @Override public String getDescription() {
    329                                                 return "JPEG images (*.jpg)";
     332                                                return tr("JPEG images (*.jpg)");
    330333                                        }
    331334                                });
     
    369372                Date exifDate = ExifReader.readTime(f);
    370373                JPanel p = new JPanel(new GridBagLayout());
    371                 p.add(new JLabel("Image"), GBC.eol());
     374                p.add(new JLabel(tr("Image")), GBC.eol());
    372375                p.add(new JLabel(loadScaledImage(f, 300)), GBC.eop());
    373                 p.add(new JLabel("Enter shown date (mm/dd/yyyy HH:MM:SS)"), GBC.eol());
     376                p.add(new JLabel(tr("Enter shown date (mm/dd/yyyy HH:MM:SS)")), GBC.eol());
    374377                JTextField gpsText = new JTextField(dateFormat.format(new Date(exifDate.getTime()+delta)));
    375378                p.add(gpsText, GBC.eol().fill(GBC.HORIZONTAL));
    376                 p.add(new JLabel("GPS unit timezome (difference to photo)"), GBC.eol());
     379                p.add(new JLabel(tr("GPS unit timezome (difference to photo)")), GBC.eol());
    377380                String t = Main.pref.get("tagimages.gpstimezone", "0");
    378381                if (t.charAt(0) != '-')
     
    382385
    383386                while (true) {
    384                         int answer = JOptionPane.showConfirmDialog(Main.parent, p, "Syncronize Time with GPS Unit", JOptionPane.OK_CANCEL_OPTION);
     387                        int answer = JOptionPane.showConfirmDialog(Main.parent, p, tr("Syncronize Time with GPS Unit"), JOptionPane.OK_CANCEL_OPTION);
    385388                        if (answer != JOptionPane.OK_OPTION || gpsText.getText().equals(""))
    386389                                return;
     
    398401                                return;
    399402                        } catch (ParseException x) {
    400                                 JOptionPane.showMessageDialog(Main.parent, "Time entered could not be parsed.");
     403                                JOptionPane.showMessageDialog(Main.parent, tr("Time entered could not be parsed."));
    401404                        }
    402405                }
  • src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java

    r103 r104  
    11package org.openstreetmap.josm.gui.layer;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
     4import static org.openstreetmap.josm.tools.I18n.trn;
    25
    36import java.awt.Component;
     
    148151
    149152        @Override public String getToolTipText() {
    150                 return undeletedSize(data.nodes)+" nodes, "+
    151                 undeletedSize(data.segments)+" segments, "+
    152                 undeletedSize(data.ways)+" streets.";
     153                return trn("{0} node", "{0} nodes", undeletedSize(data.nodes), undeletedSize(data.nodes))
     154                +trn("{0} segment", "{0} segments", undeletedSize(data.segments), undeletedSize(data.segments))
     155                +trn("{0} way", "{0} ways", undeletedSize(data.ways), undeletedSize(data.ways));
    153156        }
    154157
     
    162165                final ConflictDialog dlg = Main.map.conflictDialog;
    163166                dlg.add(visitor.conflicts);
    164                 JOptionPane.showMessageDialog(Main.parent, "There were conflicts during import.");
     167                JOptionPane.showMessageDialog(Main.parent,tr("There were conflicts during import."));
    165168                if (!dlg.isVisible())
    166169                        dlg.action.actionPerformed(new ActionEvent(this, 0, ""));
     
    301304                        osm.visit(counter);
    302305                final JPanel p = new JPanel(new GridBagLayout());
    303                 p.add(new JLabel(name+" consists of:"), GBC.eol());
     306                p.add(new JLabel(tr("{0} consists of:", name)), GBC.eol());
    304307                for (int i = 0; i < counter.normal.length; ++i) {
    305                         String s = counter.normal[i]+" "+counter.names[i]+(counter.normal[i] != 1 ?"s":"");
     308                        String s = counter.normal[i]+" "+trn(counter.names[i],counter.names[i]+"s",counter.normal[i]);
    306309                        if (counter.deleted[i] > 0)
    307                                 s += " ("+counter.deleted[i]+" deleted)";
     310                                s += tr(" ({0} deleted.)",counter.deleted[i]);
    308311                        p.add(new JLabel(s, ImageProvider.get("data", counter.names[i]), JLabel.HORIZONTAL), GBC.eop().insets(15,0,0,0));
    309312                }
  • src/org/openstreetmap/josm/gui/layer/RawGpsLayer.java

    r103 r104  
    11package org.openstreetmap.josm.gui.layer;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
     4import static org.openstreetmap.josm.tools.I18n.trn;
    25
    36import java.awt.Color;
     
    4649        public class ConvertToDataLayerAction extends AbstractAction {
    4750                public ConvertToDataLayerAction() {
    48                         super("Convert to data layer", ImageProvider.get("converttoosm"));
     51                        super(tr("Convert to data layer"), ImageProvider.get("converttoosm"));
    4952        }
    5053                public void actionPerformed(ActionEvent e) {
     
    6568                                ds.ways.add(w);
    6669                        }
    67                         Main.main.addLayer(new OsmDataLayer(ds, "Data Layer", true));
     70                        Main.main.addLayer(new OsmDataLayer(ds, tr("Data Layer"), true));
    6871                        Main.main.removeLayer(RawGpsLayer.this);
    6972        }
     
    127130                for (Collection<GpsPoint> c : data)
    128131                        points += c.size();
    129                 return data.size()+" tracks, "+points+" points.";
     132                return trn("{0} track", "{0} tracks", data.size(), data.size())
     133                +" "+trn("{0} point", "{0} points", points, points);
    130134        }
    131135
     
    149153                int points = 0;
    150154                for (Collection<GpsPoint> c : data) {
    151                         b.append("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a track with "+c.size()+" points<br>");
     155                        b.append("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+trn("a track with {0} point","a track with {0} points", c.size(), c.size())+"<br>");
    152156                        points += c.size();
    153157                }
    154158                b.append("</html>");
    155                 return "<html>"+name+" consists of "+data.size()+" tracks ("+points+" points)<br>"+b.toString();
     159                return "<html>"+tr("{0} consists of ")+trn("{0} track", "{0} tracks", data.size(), data.size())+" ("+trn("{0} point", "{0} points", points, points)+")<br>"+b.toString();
    156160        }
    157161
    158162        @Override public Component[] getMenuEntries() {
    159                 JMenuItem color = new JMenuItem("Customize Color", ImageProvider.get("colorchooser"));
     163                JMenuItem color = new JMenuItem(tr("Customize Color"), ImageProvider.get("colorchooser"));
    160164                color.addActionListener(new ActionListener(){
    161165                        public void actionPerformed(ActionEvent e) {
    162166                                String col = Main.pref.get("color.layer "+name, Main.pref.get("color.gps point", ColorHelper.color2html(Color.gray)));
    163167                                JColorChooser c = new JColorChooser(ColorHelper.html2color(col));
    164                                 Object[] options = new Object[]{"OK", "Cancel", "Default"};
    165                                 int answer = JOptionPane.showOptionDialog(Main.parent, c, "Choose a color", JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE, null, options, options[0]);
     168                                Object[] options = new Object[]{tr("OK"), tr("Cancel"), tr("Default")};
     169                                int answer = JOptionPane.showOptionDialog(Main.parent, c, tr("Choose a color"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE, null, options, options[0]);
    166170                                switch (answer) {
    167171                                case 0:
     
    178182                });
    179183               
    180                 JMenuItem tagimage = new JMenuItem("Import images", ImageProvider.get("tagimages"));
     184                JMenuItem tagimage = new JMenuItem(tr("Import images"), ImageProvider.get("tagimages"));
    181185                tagimage.addActionListener(new ActionListener(){
    182186                        public void actionPerformed(ActionEvent e) {
     
    190194                                        }
    191195                                        @Override public String getDescription() {
    192                                                 return "JPEG images (*.jpg)";
     196                                                return tr("JPEG images (*.jpg)");
    193197                                        }
    194198                                });
  • src/org/openstreetmap/josm/gui/layer/WmsServerLayer.java

    r103 r104  
    11package org.openstreetmap.josm.gui.layer;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.awt.Component;
     
    4244                // unprojected scale.
    4345                if (Projection.MAX_LON != 180)
    44                         throw new IllegalArgumentException("Wrong longitude transformation for tile cache. Can't operate on "+Main.proj);
     46                        throw new IllegalArgumentException(tr("Wrong longitude transformation for tile cache. Can't operate on {0}",Main.proj));
    4547
    4648                this.url = url;
     
    5355
    5456        @Override public String getToolTipText() {
    55                 return "WMS layer: "+url;
     57                return tr("WMS layer: {0}", url);
    5658        }
    5759
  • src/org/openstreetmap/josm/io/OsmConnection.java

    r103 r104  
    11package org.openstreetmap.josm.io;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.awt.Font;
     
    6668                                JPanel p = new JPanel(new GridBagLayout());
    6769                                if (!username.equals("") && !password.equals(""))
    68                                         p.add(new JLabel("Incorrect password or username."), GBC.eop());
    69                                 p.add(new JLabel("Username"), GBC.std().insets(0,0,10,0));
     70                                        p.add(new JLabel(tr("Incorrect password or username.")), GBC.eop());
     71                                p.add(new JLabel(tr("Username")), GBC.std().insets(0,0,10,0));
    7072                                JTextField usernameField = new JTextField(username, 20);
    7173                                p.add(usernameField, GBC.eol());
    72                                 p.add(new JLabel("Password"), GBC.std().insets(0,0,10,0));
     74                                p.add(new JLabel(tr("Password")), GBC.std().insets(0,0,10,0));
    7375                                JPasswordField passwordField = new JPasswordField(password, 20);
    7476                                p.add(passwordField, GBC.eol());
    75                                 JLabel warning = new JLabel("Warning: The password is transferred unencrypted.");
     77                                JLabel warning = new JLabel(tr("Warning: The password is transferred unencrypted."));
    7678                                warning.setFont(warning.getFont().deriveFont(Font.ITALIC));
    7779                                p.add(warning, GBC.eop());
    7880
    79                                 JCheckBox savePassword = new JCheckBox("Save user and password (unencrypted)", !username.equals("") && !password.equals(""));
     81                                JCheckBox savePassword = new JCheckBox(tr("Save user and password (unencrypted)"), !username.equals("") && !password.equals(""));
    8082                                p.add(savePassword, GBC.eop());
    8183
    82                                 int choice = JOptionPane.showConfirmDialog(Main.parent, p, "Enter Password", JOptionPane.OK_CANCEL_OPTION);
     84                                int choice = JOptionPane.showConfirmDialog(Main.parent, p, tr("Enter Password"), JOptionPane.OK_CANCEL_OPTION);
    8385                                if (choice == JOptionPane.CANCEL_OPTION) {
    8486                                        authCancelled = true;
     
    120122
    121123        public void cancel() {
    122                 currentAction.setText("Aborting...");
     124                currentAction.setText(tr("Aborting..."));
    123125                cancel = true;
    124126                if (activeConnection != null) {
  • src/org/openstreetmap/josm/io/OsmIdReader.java

    r103 r104  
    11package org.openstreetmap.josm.io;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.io.IOException;
     
    3032                        } catch (Exception e) {
    3133                                e.printStackTrace();
    32                                 throw new SAXException("Error during parse.");
     34                                throw new SAXException(tr("Error during parse."));
    3335                        }
    3436                }
  • src/org/openstreetmap/josm/io/OsmReader.java

    r103 r104  
    11package org.openstreetmap.josm.io;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.io.IOException;
     
    9395                                if (qName.equals("osm")) {
    9496                                        if (atts == null)
    95                                                 throw new SAXException("Unknown version.");
     97                                                throw new SAXException(tr("Unknown version."));
    9698                                        if (!"0.3".equals(atts.getValue("version")))
    97                                                 throw new SAXException("Unknown version "+atts.getValue("version"));
     99                                                throw new SAXException(tr("Unknown version {0}",atts.getValue("version")));
    98100                                } else if (qName.equals("node")) {
    99101                                        current = new Node(new LatLon(getDouble(atts, "lat"), getDouble(atts, "lon")));
     
    111113                                        Collection<Long> list = ways.get(current);
    112114                                        if (list == null)
    113                                                 throw new SAXException("Found <seg> tag on non-way.");
     115                                                throw new SAXException(tr("Found <seg> tag on non-way."));
    114116                                        long id = getLong(atts, "id");
    115117                                        if (id == 0)
    116                                                 throw new SAXException("Incomplete segment with id=0");
     118                                                throw new SAXException(tr("Incomplete segment with id=0"));
    117119                                        list.add(id);
    118120                                } else if (qName.equals("tag"))
     
    123125                        } catch (NullPointerException x) {
    124126                                x.printStackTrace(); // SAXException does not chain correctly
    125                                 throw new SAXException("NullPointerException. Possible some missing tags.", x);
     127                                throw new SAXException(tr("NullPointerException. Possible some missing tags."), x);
    126128                        }
    127129                }
     
    138140                current.id = getLong(atts, "id");
    139141                if (current.id == 0)
    140                         throw new SAXException("Illegal object with id=0");
     142                        throw new SAXException(tr("Illegal object with id=0"));
    141143
    142144                String time = atts.getValue("timestamp");
     
    147149                        } catch (ParseException e) {
    148150                                e.printStackTrace();
    149                                 throw new SAXException("Couldn't read time format '"+time+"'.");
     151                                throw new SAXException(tr("Couldn't read time format '{0}'.",time));
    150152                        }
    151153                }
     
    162164                String s = atts.getValue(value);
    163165                if (s == null)
    164                         throw new SAXException("Missing required attirbute '"+value+"'");
     166                        throw new SAXException(tr("Missing required attirbute '{0}'.",value));
    165167                return Long.parseLong(s);
    166168        }
     
    209211                        progress.setValue(0);
    210212                if (currentAction != null)
    211                         currentAction.setText("Preparing data...");
     213                        currentAction.setText(tr("Preparing data..."));
    212214                for (Node n : osm.nodes.values())
    213215                        osm.adder.visit(n);
     
    218220                } catch (NumberFormatException e) {
    219221                        e.printStackTrace();
    220                         throw new SAXException("Illformed Node id");
     222                        throw new SAXException(tr("Illformed Node id"));
    221223                }
    222224
  • src/org/openstreetmap/josm/io/OsmServerReader.java

    r103 r104  
    55import java.net.HttpURLConnection;
    66import java.net.URL;
    7 import java.util.Collection;
    8 import java.util.LinkedList;
    97
    108import org.openstreetmap.josm.Main;
    11 import org.openstreetmap.josm.data.osm.DataSet;
    12 import org.openstreetmap.josm.gui.layer.RawGpsLayer.GpsPoint;
    13 import org.xml.sax.SAXException;
    149
    1510/**
     
    1813 * @author imi
    1914 */
    20 public class OsmServerReader extends OsmConnection {
    21 
    22         /**
    23          * The boundings of the desired map data.
    24          */
    25         private final double lat1;
    26         private final double lon1;
    27         private final double lat2;
    28         private final double lon2;
    29 
    30         /**
    31          * Construct the reader and store the information for attaching
    32          */
    33         public OsmServerReader(double lat1, double lon1, double lat2, double lon2) {
    34                 this.lon2 = lon2;
    35                 this.lat2 = lat2;
    36                 this.lon1 = lon1;
    37                 this.lat1 = lat1;
    38         }
    39 
    40 
    41         /**
    42          * Retrieve raw gps waypoints from the server API.
    43          * @return A list of all primitives retrieved. Currently, the list of lists
    44          *              contain only one list, since the server cannot distinguish between
    45          *              ways.
    46          */
    47         public Collection<Collection<GpsPoint>> parseRawGps() throws IOException, SAXException {
    48                 try {
    49                         String url = Main.pref.get("osm-server.url")+"/0.3/trackpoints?bbox="+lon1+","+lat1+","+lon2+","+lat2+"&page=";
    50                         Collection<Collection<GpsPoint>> data = new LinkedList<Collection<GpsPoint>>();
    51                         Collection<GpsPoint> list = new LinkedList<GpsPoint>();
    52 
    53                         for (int i = 0;;++i) {
    54                                 currentAction.setText("Downloading points "+(i*5000)+" to "+((i+1)*5000)+"...");
    55                                 InputStream in = getInputStream(url+i);
    56                                 if (in == null)
    57                                         break;
    58                                 Collection<Collection<GpsPoint>> allWays = RawGpsReader.parse(in);
    59                                 boolean foundSomething = false;
    60                                 for (Collection<GpsPoint> t : allWays) {
    61                                         if (!t.isEmpty()) {
    62                                                 foundSomething = true;
    63                                                 list.addAll(t);
    64                                         }
    65                                 }
    66                                 if (!foundSomething)
    67                                         break;
    68                                 in.close();
    69                                 activeConnection = null;
    70                         }
    71 
    72                         data.add(list);
    73                         return data;
    74                 } catch (IOException e) {
    75                         if (cancel)
    76                                 return null;
    77                         throw e;
    78                 } catch (SAXException e) {
    79                         throw e;
    80                 } catch (Exception e) {
    81                         if (cancel)
    82                                 return null;
    83                         if (e instanceof RuntimeException)
    84                                 throw (RuntimeException)e;
    85                         throw new RuntimeException(e);
    86                 }
    87         }
    88 
    89 
    90         /**
    91          * Read the data from the osm server address.
    92          * @return A data set containing all data retrieved from that url
    93          */
    94         public DataSet parseOsm() throws SAXException, IOException {
    95                 try {
    96                         final InputStream in = getInputStream(Main.pref.get("osm-server.url")+"/0.3/map?bbox="+lon1+","+lat1+","+lon2+","+lat2);
    97                         if (in == null)
    98                                 return null;
    99                         currentAction.setText("Downloading OSM data...");
    100                         final DataSet data = OsmReader.parseDataSet(in, currentAction, progress);
    101                         in.close();
    102                         activeConnection = null;
    103                         return data;
    104                 } catch (IOException e) {
    105                         if (cancel)
    106                                 return null;
    107                         throw e;
    108                 } catch (SAXException e) {
    109                         throw e;
    110                 } catch (Exception e) {
    111                         if (cancel)
    112                                 return null;
    113                         if (e instanceof RuntimeException)
    114                                 throw (RuntimeException)e;
    115                         throw new RuntimeException(e);
    116                 }
    117         }
    118 
    119 
     15abstract class OsmServerReader extends OsmConnection {
    12016        /**
    12117         * Open a connection to the given url and return a reader on the input stream
     
    12420         * @return An reader reading the input stream (servers answer) or <code>null</code>.
    12521         */
    126         private InputStream getInputStream(String urlStr) throws IOException {
     22        protected InputStream getInputStream(String urlStr) throws IOException {
     23                urlStr = Main.pref.get("osm-server.url")+"/0.3/" + urlStr;
    12724                System.out.println("download: "+urlStr);
    12825                initAuthentication();
    12926                URL url = new URL(urlStr);
    13027                activeConnection = (HttpURLConnection)url.openConnection();
     28                System.out.println("got return: "+activeConnection.getResponseCode());
    13129                activeConnection.setConnectTimeout(15000);
    13230                if (isAuthCancelled() && activeConnection.getResponseCode() == 401)
  • src/org/openstreetmap/josm/io/OsmServerWriter.java

    r103 r104  
    11package org.openstreetmap.josm.io;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.io.BufferedReader;
     
    6769                                        return;
    6870                                osm.visit(v);
    69                                 currentAction.setText("Upload "+v.className+" "+v.name+" ("+osm.id+")...");
     71                                currentAction.setText(tr("Upload {0} {1} ({2})...", v.className, v.name, osm.id));
    7072                                osm.visit(this);
    7173                                progress.setValue(progress.getValue()+1);
     
    152154                try {
    153155                        URL url = new URL(Main.pref.get("osm-server.url") + "/0.3/" + urlSuffix + "/" + osm.id);
    154                         System.out.println("upload to: "+url);
     156                        System.out.println(tr("upload to: {0}"));
    155157                        activeConnection = (HttpURLConnection) url.openConnection();
    156158                        activeConnection.setConnectTimeout(15000);
     
    169171                        if (retCode == 200 && osm.id == 0)
    170172                                osm.id = readId(activeConnection.getInputStream());
    171                         System.out.println("got return: "+retCode+" with id "+osm.id);
     173                        System.out.println(tr("got return: {0} with id {1}",retCode,osm.id));
    172174                        String retMsg = activeConnection.getResponseMessage();
    173175                        activeConnection.disconnect();
     
    181183                        }
    182184                } catch (UnknownHostException e) {
    183                         throw new RuntimeException("Unknown host: "+e.getMessage(), e);
     185                        throw new RuntimeException(tr("Unknown host: ")+e.getMessage(), e);
    184186                } catch (Exception e) {
    185187                        if (cancel)
  • src/org/openstreetmap/josm/io/RawCsvReader.java

    r103 r104  
    11package org.openstreetmap.josm.io;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.io.BufferedReader;
     
    3537                        formatStr = in.readLine();
    3638                if (formatStr == null)
    37                         throw new SAXException("Could not detect data format string.");
     39                        throw new SAXException(tr("Could not detect data format string."));
    3840
    3941                // get delimiter
     
    5860                if (!format.contains("lat") || !format.contains("lon")) {
    5961                        if (Main.pref.get("csv.importstring").equals(""))
    60                                 throw new SAXException("Format string in data is incomplete or not found. Try setting an manual format string in Preferences.");
    61                         throw new SAXException("Format string is incomplete. Need at least 'lat' and 'lon' specification");
     62                                throw new SAXException(tr("Format string in data is incomplete or not found. Try setting an manual format string in Preferences."));
     63                        throw new SAXException(tr("Format string is incomplete. Need at least 'lat' and 'lon' specification"));
    6264                }
    6365
     
    7981                                                st.nextToken();
    8082                                        else
    81                                                 throw new SAXException("Unknown data type: '"+token+"'."+(Main.pref.get("csv.importstring").equals("") ? " Maybe add an format string in preferences." : ""));
     83                                                throw new SAXException(tr("Unknown data type: '{0}'.{1}",token,(Main.pref.get("csv.importstring").equals("") ? (" "+tr("Maybe add an format string in preferences.")) : "")));
    8284                                }
    8385                                data.add(new GpsPoint(new LatLon(lat, lon), time));
    8486                        }
    8587                } catch (RuntimeException e) {
    86                         throw new SAXException("Parsing error in line "+lineNo, e);
     88                        throw new SAXException(tr("Parsing error in line {0}",lineNo), e);
    8789                }
    8890                return data;
  • src/org/openstreetmap/josm/io/RawGpsReader.java

    r103 r104  
    11package org.openstreetmap.josm.io;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.io.IOException;
     
    3739                        double lon = Double.parseDouble(atts.getValue("lon"));
    3840                                if (Math.abs(lat) > 90)
    39                                         throw new SAXException("Data error: lat value '"+lat+"' is out of bound.");
     41                                        throw new SAXException(tr("Data error: lat value '{0}' is out of bound.", lat));
    4042                                if (Math.abs(lon) > 180)
    41                                         throw new SAXException("Data error: lon value '"+lon+"' is out of bound.");
     43                                        throw new SAXException(tr("Data error: lon value '{0}' is out of bound.", lon));
    4244                        currentLatLon = new LatLon(lat, lon);
    4345                } catch (NumberFormatException e) {
  • src/org/openstreetmap/josm/tools/BugReportExceptionHandler.java

    r103 r104  
    11package org.openstreetmap.josm.tools;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.awt.GridBagLayout;
     
    2527 * @author imi
    2628 */
    27 public final class BugReportExceptionHandler implements Thread.UncaughtExceptionHandler {
     29public final class BugReportExceptionHandler implements Thread.UncaughtExceptionHandler {       
     30
    2831        public void uncaughtException(Thread t, Throwable e) {
    2932                e.printStackTrace();
     
    3437                        }
    3538                       
    36                         Object[] options = new String[]{"Do nothing", "Report Bug"};
    37                         int answer = JOptionPane.showOptionDialog(Main.parent, "An unexpected exception occoured.\n\n" +
     39                        Object[] options = new String[]{tr("Do nothing"), tr("Report Bug")};
     40                        int answer = JOptionPane.showOptionDialog(Main.parent, tr("An unexpected exception occoured.\n\n" +
    3841                                        "This is always a coding error. If you are running the latest\n" +
    39                                         "version of JOSM, please consider be kind and file a bug report.",
    40                                         "Unexpected Exception", JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE,
     42                                        "version of JOSM, please consider be kind and file a bug report."),
     43                                        tr("Unexpected Exception"), JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE,
    4144                                        null, options, options[0]);
    4245                        if (answer == 1) {
  • src/org/openstreetmap/josm/tools/DateParser.java

    r102 r104  
    11package org.openstreetmap.josm.tools;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.text.ParseException;
     
    2527                        try {return sdf.parse(d);} catch (ParseException pe) {}
    2628                }
    27                 throw new ParseException("No applicable parse format", 0);
     29                throw new ParseException(tr("No applicable parse format"), 0);
    2830        }
    2931}
  • src/org/openstreetmap/josm/tools/ExifReader.java

    r99 r104  
    22
    33import java.io.File;
    4 import java.text.SimpleDateFormat;
    54import java.util.Date;
    65import java.util.Iterator;
     
    2423                        Tag tag = tagIt.next();
    2524                        if (tag.getTagType() == 0x132 || tag.getTagType() == 0x9003 || tag.getTagType() == 0x9004)
    26                                 return new SimpleDateFormat("yyyy:MM:dd HH:mm:ss").parse(tag.getDescription());
     25                                return DateParser.parse(tag.getDescription());
    2726                    }
    2827                }
  • src/org/openstreetmap/josm/tools/ShortCutLabel.java

    r94 r104  
    11package org.openstreetmap.josm.tools;
    22
     3import static org.openstreetmap.josm.tools.I18n.tr;
     4
    35import java.awt.event.KeyEvent;
     6
    47
    58public class ShortCutLabel {
     
    710                String s = "";
    811                if ((modifiers & KeyEvent.CTRL_MASK) != 0)
    9                         s += "Ctrl-";
     12                        s += tr("Ctrl-");
    1013                if ((modifiers & KeyEvent.ALT_MASK) != 0)
    11                         s += "Alt-";
     14                        s += tr("Alt-");
    1215                if ((modifiers & KeyEvent.ALT_GRAPH_MASK) != 0)
    13                         s += "AltGr-";
     16                        s += tr("AltGr-");
    1417                if ((modifiers & KeyEvent.SHIFT_MASK) != 0)
    15                         s += "Shift-";
     18                        s += tr("Shift-");
    1619                s += Character.toUpperCase((char)shortCut);
    1720                return s;
  • src/org/openstreetmap/josm/tools/UrlLabel.java

    r69 r104  
    1111public class UrlLabel extends JEditorPane implements HyperlinkListener {
    1212
     13        private final String url;
     14
    1315        public UrlLabel(String url) {
     16                this.url = url;
    1417                setContentType("text/html");
    1518                setText("<html><a href=\""+url+"\">"+url+"</a></html>");
     
    2124        public void hyperlinkUpdate(HyperlinkEvent e) {
    2225                if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
    23                         OpenBrowser.displayUrl("http://wiki.eigenheimstrasse.de/wiki/JOSM");
     26                        OpenBrowser.displayUrl(url);
    2427                }
    2528        }
Note: See TracChangeset for help on using the changeset viewer.