Changeset 2844 in josm for trunk


Ignore:
Timestamp:
2010-01-13T19:47:32+01:00 (10 years ago)
Author:
mjulius
Message:

fix messages for commands

Location:
trunk/src/org/openstreetmap/josm/command
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/command/AddPrimitivesCommand.java

    r2405 r2844  
    22package org.openstreetmap.josm.command;
    33
    4 import static org.openstreetmap.josm.tools.I18n.tr;
     4import static org.openstreetmap.josm.tools.I18n.trn;
    55
    66import java.util.ArrayList;
     
    4747    public MutableTreeNode description() {
    4848        return new DefaultMutableTreeNode(
    49                 new JLabel(tr("Added {0} objects", data.size()), null,
     49                new JLabel(trn("Added {0} object", "Added {0} objects", data.size(), data.size()), null,
    5050                        JLabel.HORIZONTAL
    5151                )
  • trunk/src/org/openstreetmap/josm/command/ChangePropertyCommand.java

    r2025 r2844  
    115115        } else {
    116116            text = value == null
    117             ? tr("Remove \"{0}\" for {1} {2}", key, objects.size(), trn("object","objects",objects.size()))
    118                     : tr("Set {0}={1} for {2} {3}",key,value, objects.size(), trn("object","objects",objects.size()));
     117            ? tr("Remove \"{0}\" for {1} objects", key, objects.size())
     118                    : tr("Set {0}={1} for {2} objects", key, value, objects.size());
    119119        }
    120120        DefaultMutableTreeNode root = new DefaultMutableTreeNode(new JLabel(text, ImageProvider.get("data", "key"), JLabel.HORIZONTAL));
  • trunk/src/org/openstreetmap/josm/command/Command.java

    r2683 r2844  
    2121import org.openstreetmap.josm.gui.layer.Layer;
    2222import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     23import org.openstreetmap.josm.tools.CheckParameterUtil;
    2324
    2425/**
     
    6364     */
    6465    public Command(OsmDataLayer layer) throws IllegalArgumentException {
    65         if (layer == null)
    66             throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null", "layer"));
     66        CheckParameterUtil.ensureParameterNotNull(layer, "layer");
    6767        this.layer = layer;
    6868    }
  • trunk/src/org/openstreetmap/josm/command/ConflictAddCommand.java

    r2512 r2844  
    3232                tr("<html>Layer ''{0}'' already has a conflict for primitive<br>"
    3333                        + "''{1}''.<br>"
    34                         + "This conflict can't be added.</html>",
     34                        + "This conflict cannot be added.</html>",
    3535                        getLayer().getName(),
    3636                        conflict.getMy().getDisplayName(DefaultNameFormatter.getInstance())
     
    5252    @Override public void undoCommand() {
    5353        if (! Main.map.mapView.hasLayer(getLayer())) {
    54             System.out.println(tr("Warning: Layer ''{0}'' doesn't exist any more. Can't remove conflict for primitive ''{1}''.",
     54            System.out.println(tr("Warning: Layer ''{0}'' does not exist any more. Cannot remove conflict for primitive ''{1}''.",
    5555                    getLayer().getName(),
    5656                    conflict.getMy().getDisplayName(DefaultNameFormatter.getInstance())
  • trunk/src/org/openstreetmap/josm/command/ConflictResolveCommand.java

    r2512 r2844  
    6565
    6666        if (! Main.map.mapView.hasLayer(getLayer())) {
    67             logger.warning(tr("Can''t undo command ''{0}'' because layer ''{1}'' is not present any more",
     67            logger.warning(tr("Cannot undo command ''{0}'' because layer ''{1}'' is not present any more",
    6868                    this.toString(),
    6969                    getLayer().toString()
  • trunk/src/org/openstreetmap/josm/command/DeleteCommand.java

    r2769 r2844  
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55import static org.openstreetmap.josm.tools.I18n.trn;
     6import static org.openstreetmap.josm.tools.I18n.marktr;
    67
    78import java.awt.GridBagLayout;
     
    3536import org.openstreetmap.josm.gui.actionsupport.DeleteFromRelationConfirmationDialog;
    3637import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     38import org.openstreetmap.josm.tools.CheckParameterUtil;
    3739import org.openstreetmap.josm.tools.ImageProvider;
    3840
     
    5557    public DeleteCommand(Collection<? extends OsmPrimitive> data) throws IllegalArgumentException {
    5658        if (data == null)
    57             throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be empty"));
     59            throw new IllegalArgumentException("Parameter 'data' must not be empty");
    5860        if (data.isEmpty())
    5961            throw new IllegalArgumentException(tr("At least one object to delete required, got empty collection"));
     
    6870     */
    6971    public DeleteCommand(OsmPrimitive data) throws IllegalArgumentException {
    70         if (data == null)
    71             throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null", "data"));
     72        CheckParameterUtil.ensureParameterNotNull(data, "data");
    7273        this.toDelete = Collections.singleton(data);
    7374    }
     
    8485    public DeleteCommand(OsmDataLayer layer, OsmPrimitive data) throws IllegalArgumentException {
    8586        super(layer);
    86         if (data == null)
    87             throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null", "data"));
     87        CheckParameterUtil.ensureParameterNotNull(data, "data");
    8888        this.toDelete = Collections.singleton(data);
    8989    }
     
    101101        super(layer);
    102102        if (data == null)
    103             throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be empty"));
     103            throw new IllegalArgumentException("Parameter 'data' must not be empty");
    104104        if (data.isEmpty())
    105105            throw new IllegalArgumentException(tr("At least one object to delete required, got empty collection"));
     
    159159            String msg = "";
    160160            switch(OsmPrimitiveType.from(primitive)) {
    161             case NODE: msg = "Delete node {0}"; break;
    162             case WAY: msg = "Delete way {0}"; break;
    163             case RELATION:msg = "Delete relation {0}"; break;
     161            case NODE: msg = marktr("Delete node {0}"); break;
     162            case WAY: msg = marktr("Delete way {0}"); break;
     163            case RELATION:msg = marktr("Delete relation {0}"); break;
    164164            }
    165165
     
    213213     */
    214214    public static Command deleteWithReferences(OsmDataLayer layer, Collection<? extends OsmPrimitive> selection, boolean silent) throws IllegalArgumentException {
    215         if (layer == null)
    216             throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null", "layer"));
     215        CheckParameterUtil.ensureParameterNotNull(layer, "layer");
    217216        if (selection == null || selection.isEmpty()) return null;
    218217        Set<OsmPrimitive> parents = OsmPrimitive.getReferrer(selection);
     
    436435                                tr("You are about to delete nodes outside of the area you have downloaded."
    437436                                        + "<br>"
    438                                         + "This can cause problems because other objects (that you don't see) might use them."
     437                                        + "This can cause problems because other objects (that you do not see) might use them."
    439438                                        + "<br>" + "Do you really want to delete?") + "</html>"));
    440439                        return ConditionalOptionPaneUtil.showConfirmationDialog(
  • trunk/src/org/openstreetmap/josm/command/ModifiedConflictResolveCommand.java

    r2624 r2844  
    3939        String msg = "";
    4040        switch(OsmPrimitiveType.from(conflict.getMy())) {
    41         case NODE: msg = marktr("Set the 'modified' flag for node {0}"); break;
    42         case WAY: msg = marktr("Set the 'modified' flag for way {0}"); break;
    43         case RELATION: msg = marktr("Set the 'modified' flag for relation {0}"); break;
     41        case NODE: msg = marktr("Set the ''modified'' flag for node {0}"); break;
     42        case WAY: msg = marktr("Set the ''modified'' flag for way {0}"); break;
     43        case RELATION: msg = marktr("Set the ''modified'' flag for relation {0}"); break;
    4444        }
    4545        return new DefaultMutableTreeNode(
  • trunk/src/org/openstreetmap/josm/command/PurgePrimitivesCommand.java

    r2565 r2844  
    33
    44import static org.openstreetmap.josm.tools.I18n.tr;
     5import static org.openstreetmap.josm.tools.I18n.trn;
    56
    67import java.util.Collection;
     
    109110
    110111        DefaultMutableTreeNode root = new DefaultMutableTreeNode(
    111                 tr("Purged {0} objects", primitives.size())
     112                trn("Purged {0} object", "Purged {0} objects", primitives.size(), primitives.size())
    112113        );
    113114        for (OsmPrimitive p : primitives) {
     
    201202    public void undoCommand() {
    202203        if (! Main.map.mapView.hasLayer(getLayer())) {
    203             logger.warning(tr("Can''t undo command ''{0}'' because layer ''{1}'' is not present any more",
     204            logger.warning(tr("Cannot undo command ''{0}'' because layer ''{1}'' is not present any more",
    204205                    this.toString(),
    205206                    getLayer().toString()
  • trunk/src/org/openstreetmap/josm/command/RelationMemberConflictResolverCommand.java

    r2569 r2844  
    8787    public void undoCommand() {
    8888        if (! Main.map.mapView.hasLayer(layer)) {
    89             logger.warning(tr("Can''t undo command ''{0}'' because layer ''{1}'' is not present any more",
     89            logger.warning(tr("Cannot undo command ''{0}'' because layer ''{1}'' is not present any more",
    9090                    this.toString(),
    9191                    layer.toString()
  • trunk/src/org/openstreetmap/josm/command/UndeletePrimitivesCommand.java

    r2512 r2844  
    22package org.openstreetmap.josm.command;
    33
    4 import static org.openstreetmap.josm.tools.I18n.tr;
     4import static org.openstreetmap.josm.tools.I18n.trn;
    55
    66import java.util.ArrayList;
     
    5959        return new DefaultMutableTreeNode(
    6060                new JLabel(
    61                         tr("Undelete {0} primitives", toUndelete.size()),
     61                        trn("Undelete {0} primitive", "Undelete {0} primitives", toUndelete.size(), toUndelete.size()),
    6262                        ImageProvider.get("data", "object"),
    6363                        JLabel.HORIZONTAL
  • trunk/src/org/openstreetmap/josm/command/VersionConflictResolveCommand.java

    r2512 r2844  
    3939        String msg = "";
    4040        switch(OsmPrimitiveType.from(conflict.getMy())) {
    41             case NODE: msg = marktr("Resolve version conflicts for node {0}"); break;
    42             case WAY: msg = marktr("Resolve version conflicts for way {0}"); break;
    43             case RELATION: msg = marktr("Resolve version conflicts for relation {0}"); break;
     41            case NODE: msg = marktr("Resolve version conflict for node {0}"); break;
     42            case WAY: msg = marktr("Resolve version conflict for way {0}"); break;
     43            case RELATION: msg = marktr("Resolve version conflict for relation {0}"); break;
    4444        }
    4545        return new DefaultMutableTreeNode(
Note: See TracChangeset for help on using the changeset viewer.