Changeset 8975 in josm


Ignore:
Timestamp:
2015-11-02T09:40:18+01:00 (9 years ago)
Author:
simon04
Message:

fix #12041 - Wrong message in relation member deletion confirmation

Location:
trunk/src/org/openstreetmap/josm
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/PasteTagsAction.java

    r8931 r8975  
    2525import org.openstreetmap.josm.data.osm.TagCollection;
    2626import org.openstreetmap.josm.gui.conflict.tags.PasteTagsConflictResolverDialog;
     27import org.openstreetmap.josm.tools.I18n;
    2728import org.openstreetmap.josm.tools.Shortcut;
    2829import org.openstreetmap.josm.tools.TextTagParser;
     
    302303            String title1 = trn("Pasting {0} tag", "Pasting {0} tags", commands.size(), commands.size());
    303304            String title2 = trn("to {0} object", "to {0} objects", selection.size(), selection.size());
     305            @I18n.QuirkyPluralString
     306            final String title = title1 + ' ' + title2;
    304307            Main.main.undoRedo.add(
    305308                    new SequenceCommand(
    306                             title1 + ' ' + title2,
     309                            title,
    307310                            commands
    308311                    ));
  • trunk/src/org/openstreetmap/josm/command/ChangePropertyCommand.java

    r8961 r8975  
    2121import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
    2222import org.openstreetmap.josm.gui.DefaultNameFormatter;
     23import org.openstreetmap.josm.tools.I18n;
    2324import org.openstreetmap.josm.tools.ImageProvider;
    2425
     
    148149    @Override
    149150    public String getDescriptionText() {
    150         String text;
     151        @I18n.QuirkyPluralString
     152        final String text;
    151153        if (objects.size() == 1 && tags.size() == 1) {
    152154            OsmPrimitive primitive = objects.get(0);
  • trunk/src/org/openstreetmap/josm/gui/dialogs/DeleteFromRelationConfirmationDialog.java

    r8836 r8975  
    4242import org.openstreetmap.josm.gui.help.HelpUtil;
    4343import org.openstreetmap.josm.gui.widgets.HtmlPanel;
     44import org.openstreetmap.josm.tools.I18n;
    4445import org.openstreetmap.josm.tools.ImageProvider;
    4546import org.openstreetmap.josm.tools.WindowGeometry;
     
    106107        int numObjectsToDelete = model.getNumObjectsToDelete();
    107108        int numParentRelations = model.getNumParentRelations();
    108         String msg;
    109         if (numObjectsToDelete == 1 && numParentRelations == 1) {
    110             msg = tr("<html>Please confirm to remove <strong>1 object</strong> from <strong>1 relation</strong>.</html>");
    111         } else if (numObjectsToDelete == 1 && numParentRelations > 1) {
    112             msg = tr("<html>Please confirm to remove <strong>1 object</strong> from <strong>{0} relations</strong>.</html>",
    113                     numParentRelations);
    114         } else if (numObjectsToDelete > 1 && numParentRelations == 1) {
    115             msg = tr("<html>Please confirm to remove <strong>1 object</strong> from <strong>{0} relations</strong>.</html>",
    116                     numParentRelations);
     109        @I18n.QuirkyPluralString
     110        final String msg;
     111        if (numParentRelations == 1) {
     112            msg = trn(
     113                    "<html>Please confirm to remove <strong>{0} object</strong> from <strong>1 relation</strong>.</html>",
     114                    "<html>Please confirm to remove <strong>{0} objects</strong> from <strong>1 relation</strong>.</html>",
     115                    numObjectsToDelete, numObjectsToDelete);
    117116        } else {
    118             msg = tr("<html>Please confirm to remove <strong>{0} objects</strong> from <strong>{1} relations</strong>.</html>",
    119                     numObjectsToDelete, numParentRelations);
     117            msg = trn(
     118                    "<html>Please confirm to remove <strong>{0} object</strong> from <strong>{1} relations</strong>.</html>",
     119                    "<html>Please confirm to remove <strong>{0} objects</strong> from <strong>{1} relations</strong>.</html>",
     120                    numObjectsToDelete, numObjectsToDelete, numParentRelations);
    120121        }
    121122        htmlPanel.getEditorPane().setText(msg);
  • trunk/src/org/openstreetmap/josm/tools/I18n.java

    r8972 r8975  
    88import java.io.IOException;
    99import java.io.InputStream;
     10import java.lang.annotation.Retention;
     11import java.lang.annotation.RetentionPolicy;
    1012import java.net.URL;
    1113import java.nio.charset.StandardCharsets;
     
    3638 */
    3739public final class I18n {
     40
     41    /**
     42     * This annotates strings which do not permit a clean i18n. This is mostly due to strings
     43     * containing two nouns which can occur in singular or plural form.
     44     */
     45    @Retention(RetentionPolicy.SOURCE)
     46    public @interface QuirkyPluralString {
     47    }
    3848
    3949    private I18n() {
Note: See TracChangeset for help on using the changeset viewer.