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
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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));
Note: See TracChangeset for help on using the changeset viewer.