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

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

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

Legend:

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