Changeset 6507 in josm for trunk/src/org


Ignore:
Timestamp:
2013-12-22T00:38:43+01:00 (11 years ago)
Author:
simon04
Message:

fix #9110 - i18n: fix errors in usage of plural forms

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

Legend:

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

    r6453 r6507  
    33
    44import static org.openstreetmap.josm.tools.I18n.tr;
     5import static org.openstreetmap.josm.tools.I18n.trn;
    56
    67import java.awt.event.ActionEvent;
     
    8586
    8687    public static boolean confirmLaunchMultiple(int numBrowsers) {
    87         String msg  = tr(
     88        String msg  = /* for correct i18n of plural forms - see #9110 */ trn(
    8889                "You are about to launch {0} browser windows.<br>"
    89                 + "This may both clutter your screen with browser windows<br>"
    90                 + "and take some time to finish.", numBrowsers);
     90                        + "This may both clutter your screen with browser windows<br>"
     91                        + "and take some time to finish.",
     92                "You are about to launch {0} browser windows.<br>"
     93                        + "This may both clutter your screen with browser windows<br>"
     94                        + "and take some time to finish.", numBrowsers, numBrowsers);
    9195        msg = "<html>" + msg + "</html>";
    9296        ButtonSpec[] spec = new ButtonSpec[] {
     
    9498                        tr("Continue"),
    9599                        ImageProvider.get("ok"),
    96                         tr("Click to continue and to open {0} browsers", numBrowsers),
     100                        trn("Click to continue and to open {0} browsers", "Click to continue and to open {0} browsers", numBrowsers, numBrowsers),
    97101                        null // no specific help topic
    98102                ),
  • trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java

    r6380 r6507  
    44import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
    55import static org.openstreetmap.josm.tools.I18n.tr;
     6import static org.openstreetmap.josm.tools.I18n.trc;
     7import static org.openstreetmap.josm.tools.I18n.trn;
    68
    79import java.awt.event.ActionEvent;
     
    188190        cmds.addAll(resolution);
    189191        cmds.add(new DeleteCommand(deletedWays));
    190         final SequenceCommand sequenceCommand = new SequenceCommand(tr("Combine {0} ways", ways.size()), cmds);
     192        final SequenceCommand sequenceCommand = new SequenceCommand(/* for correct i18n of plural forms - see #9110 */
     193                trn("Combine {0} ways", "Combine {0} ways", ways.size(), ways.size()), cmds);
    191194
    192195        return new Pair<Way, Command>(targetWay, sequenceCommand);
  • trunk/src/org/openstreetmap/josm/actions/MergeNodesAction.java

    r6380 r6507  
    44import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
    55import static org.openstreetmap.josm.tools.I18n.tr;
     6import static org.openstreetmap.josm.tools.I18n.trn;
    67
    78import java.awt.event.ActionEvent;
     
    354355                cmds.add(new DeleteCommand(waysToDelete));
    355356            }
    356             Command cmd = new SequenceCommand(tr("Merge {0} nodes", nodes.size()), cmds);
    357             return cmd;
     357            return new SequenceCommand(/* for correct i18n of plural forms - see #9110 */
     358                    trn("Merge {0} nodes", "Merge {0} nodes", nodes.size(), nodes.size()), cmds);
    358359        } catch (UserCancelException ex) {
    359360            return null;
  • trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java

    r6380 r6507  
    505505        return new SplitWayResult(
    506506                new SequenceCommand(
    507                         tr("Split way {0} into {1} parts", way.getDisplayName(DefaultNameFormatter.getInstance()),wayChunks.size()),
     507                        /* for correct i18n of plural forms - see #9110 */
     508                        trn("Split way {0} into {1} parts", "Split way {0} into {1} parts", wayChunks.size(),
     509                                way.getDisplayName(DefaultNameFormatter.getInstance()), wayChunks.size()),
    508510                        commandList
    509511                        ),
  • trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java

    r6380 r6507  
    379379        fixRelations(selectedNode, cmds, newNodes);
    380380
    381         Main.main.undoRedo.add(new SequenceCommand(tr("Dupe into {0} nodes", newNodes.size()+1), cmds));
     381        Main.main.undoRedo.add(new SequenceCommand(/* for correct i18n of plural forms - see #9110 */
     382                trn("Dupe into {0} nodes", "Dupe into {0} nodes", newNodes.size() + 1, newNodes.size() + 1), cmds));
    382383        // select one of the new nodes
    383384        getCurrentDataSet().setSelected(newNodes.getFirst());
  • trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java

    r6380 r6507  
    806806                    new String[]{tr("Move them"), tr("Undo move")});
    807807            ed.setButtonIcons(new String[]{"reorder.png", "cancel.png"});
    808             ed.setContent(tr("You moved more than {0} elements. " + "Moving a large number of elements is often an error.\n" + "Really move them?", max));
     808            ed.setContent(
     809                    /* for correct i18n of plural forms - see #9110 */
     810                    trn(
     811                            "You moved more than {0} elements. " + "Moving a large number of elements is often an error.\n" + "Really move them?",
     812                            "You moved more than {0} elements. " + "Moving a large number of elements is often an error.\n" + "Really move them?",
     813                            max, max));
    809814            ed.setCancelButton(2);
    810815            ed.toggleEnable("movedManyElements");
  • trunk/src/org/openstreetmap/josm/command/ChangePropertyCommand.java

    r6380 r6507  
    44import static org.openstreetmap.josm.tools.I18n.marktr;
    55import static org.openstreetmap.josm.tools.I18n.tr;
     6import static org.openstreetmap.josm.tools.I18n.trn;
    67
    78import java.util.AbstractMap;
     
    165166        } else if (objects.size() > 1 && tags.size() == 1) {
    166167            Map.Entry<String, String> entry = tags.entrySet().iterator().next();
    167             if (entry.getValue() == null)
    168                 text = tr("Remove \"{0}\" for {1} objects", entry.getKey(), objects.size());
    169             else
    170                 text = tr("Set {0}={1} for {2} objects", entry.getKey(), entry.getValue(), objects.size());
     168            if (entry.getValue() == null) {
     169                /* for correct i18n of plural forms - see #9110 */
     170                text = trn("Remove \"{0}\" for {1} objects", "Remove \"{0}\" for {1} objects", objects.size(), entry.getKey(), objects.size());
     171            } else {
     172                /* for correct i18n of plural forms - see #9110 */
     173                text = trn("Set {0}={1} for {2} objects", "Set {0}={1} for {2} objects", objects.size(), entry.getKey(), entry.getValue(), objects.size());
     174            }
    171175        }
    172176        else {
     
    180184
    181185            if (allnull) {
    182                 text = tr("Deleted {0} tags for {1} objects", tags.size(), objects.size());
    183             } else
    184                 text = tr("Set {0} tags for {1} objects", tags.size(), objects.size());
     186                /* for correct i18n of plural forms - see #9110 */
     187                text = trn("Deleted {0} tags for {1} objects", "Deleted {0} tags for {1} objects", objects.size(), tags.size(), objects.size());
     188            } else {
     189                /* for correct i18n of plural forms - see #9110 */
     190                text = trn("Set {0} tags for {1} objects", "Set {0} tags for {1} objects", objects.size(), tags.size(), objects.size());
     191            }
    185192        }
    186193        return text;
  • trunk/src/org/openstreetmap/josm/command/TagConflictResolveCommand.java

    r5816 r6507  
    44import static org.openstreetmap.josm.tools.I18n.marktr;
    55import static org.openstreetmap.josm.tools.I18n.tr;
     6import static org.openstreetmap.josm.tools.I18n.trn;
    67
    78import java.util.Collection;
     
    5657    @Override
    5758    public String getDescriptionText() {
    58         String msg = "";
    59         switch(OsmPrimitiveType.from(conflict.getMy())) {
    60         case NODE: msg = marktr("Resolve {0} tag conflicts in node {1}"); break;
    61         case WAY: msg = marktr("Resolve {0} tag conflicts in way {1}"); break;
    62         case RELATION: msg = marktr("Resolve {0} tag conflicts in relation {1}"); break;
     59        switch (OsmPrimitiveType.from(conflict.getMy())) {
     60            case NODE:
     61                /* for correct i18n of plural forms - see #9110 */
     62                return trn("Resolve {0} tag conflicts in node {1}", "Resolve {0} tag conflicts in node {1}", getNumDecidedConflicts(), getNumDecidedConflicts(), conflict.getMy().getId());
     63            case WAY:
     64                /* for correct i18n of plural forms - see #9110 */
     65                return trn("Resolve {0} tag conflicts in way {1}", "Resolve {0} tag conflicts in way {1}", getNumDecidedConflicts(), getNumDecidedConflicts(), conflict.getMy().getId());
     66            case RELATION:
     67                /* for correct i18n of plural forms - see #9110 */
     68                return trn("Resolve {0} tag conflicts in relation {1}", "Resolve {0} tag conflicts in relation {1}", getNumDecidedConflicts(), getNumDecidedConflicts(), conflict.getMy().getId());
    6369        }
    64         return tr(msg,getNumDecidedConflicts(), conflict.getMy().getId());
     70        return "";
    6571    }
    6672
  • trunk/src/org/openstreetmap/josm/gui/conflict/tags/CombinePrimitiveResolverDialog.java

    r6093 r6507  
    596596            }
    597597        }));
    598         String msg = tr("You are about to combine {0} objects, "
     598        String msg = /* for correct i18n of plural forms - see #9110 */ trn("You are about to combine {0} objects, "
     599                + "but the following tags are used conflictingly:<br/>{1}"
     600                + "If these objects are combined, the resulting object may have unwanted tags.<br/>"
     601                + "If you want to continue, you are shown a dialog to fix the conflicting tags.<br/><br/>"
     602                + "Do you want to continue?", "You are about to combine {0} objects, "
    599603                + "but the following tags are used conflictingly:<br/>{1}"
    600604                + "If these objects are combined, the resulting object may have unwanted tags.<br/>"
    601605                + "If you want to continue, you are shown a dialog to fix the conflicting tags.<br/><br/>"
    602606                + "Do you want to continue?",
    603                 primitives.size(), conflicts);
     607                primitives.size(), primitives.size(), conflicts);
    604608
    605609        if (!ConditionalOptionPaneUtil.showConfirmationDialog(
  • trunk/src/org/openstreetmap/josm/gui/dialogs/FilterTableModel.java

    r6278 r6507  
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55import static org.openstreetmap.josm.tools.I18n.trc;
     6import static org.openstreetmap.josm.tools.I18n.trn;
    67
    78import java.awt.Color;
     
    374375
    375376        if (disabledAndHiddenCount != 0) {
    376             message += tr("<p><b>{0}</b> objects hidden", disabledAndHiddenCount);
     377            /* for correct i18n of plural forms - see #9110 */
     378            message += trn("<p><b>{0}</b> objects hidden", "<p><b>{0}</b> objects hidden", disabledAndHiddenCount, disabledAndHiddenCount);
    377379        }
    378380
     
    382384
    383385        if (disabledCount != 0) {
    384             message += tr("<b>{0}</b> objects disabled", disabledCount);
     386            /* for correct i18n of plural forms - see #9110 */
     387            message += trn("<b>{0}</b> objects disabled", "<b>{0}</b> objects disabled", disabledCount, disabledCount);
    385388        }
    386389
Note: See TracChangeset for help on using the changeset viewer.