Modify

Opened 5 years ago

Closed 5 years ago

#18643 closed enhancement (fixed)

Improve i18n strings with undistinguished singular/plural form

Reported by: simon04 Owned by: team
Priority: minor Milestone: 20.03
Component: Core Version:
Keywords: i18n Cc:

Description

tr("With the currently used mappaint style(s) the style for outer way mismatches the area style")
tr("Multipolygon rings share node(s)")
tr("Multipolygon outer way shares segment(s) with other ring")
tr("Multipolygon member(s) repeated with different role")
tr("Multipolygon member(s) repeated with same role")
tr("Could not access data file(s):\n{0}", errorSources)
tr("Disable access to the given resource(s), separated by comma")
tr("Zoom to selected element(s)")
tr("Copy the key and value of the selected tag(s) to clipboard")
tr("Remove photo(s) from layer")
tr("Delete photo file(s) from disk")
tr("Delete file(s) from disk")

Attachments (0)

Change History (13)

comment:1 by simon04, 5 years ago

Milestone: 20.0220.03

in reply to:  description ; comment:2 by Hb---, 5 years ago

Replying to simon04:

"Multipolygon rings share node(s)"

If this message is only called with two or more modes affected, then please use equal source strings for the singular and for the plural form, see #18814.

tr("Zoom to selected element(s)")

This is accompanied with Zoom to selection in the same context menu. The meanings seem to contradict. Please consider to simply use Zoom to. This would be similar to Edit and Delete already present there. It would be equal to the context menu item in the relation editor.

in reply to:  2 comment:3 by stoecker, 5 years ago

Replying to Hb---:

Replying to simon04:

"Multipolygon rings share node(s)"

If this message is only called with two or more modes affected, then please use equal source strings for the singular and for the plural form, see #18814.

Can you please stop to ask for changes which violate our guidelines. I18n always has to have full strings independent from the possibly used numbers in the code, as:

  • each language defines the strings different and
  • code may change

comment:4 by simon04, 5 years ago

In 16072/josm:

see #18643 - I18n: improve plural forms

comment:5 by simon04, 5 years ago

I was unsuccessful for most strings. What about using the plural form instead of the nasty and typographically catastrophic word(s)?

  • src/org/openstreetmap/josm/data/validation/tests/MultipolygonTest.java

    diff --git a/src/org/openstreetmap/josm/data/validation/tests/MultipolygonTest.java b/src/org/openstreetmap/josm/data/validation/tests/MultipolygonTest.java
    index 48f82e26f..a891fb000 100644
    a b private void checkStyleConsistency(Relation r, Multipolygon polygon) {  
    163163                    if (areaOuter != null) {
    164164                        if (!area.equals(areaOuter)) {
    165165                            String message = !areaStyle ? tr("Style for outer way mismatches")
    166                                     : tr("With the currently used mappaint style(s) the style for outer way mismatches the area style");
     166                                    : tr("With the currently used mappaint style the style for outer way mismatches the area style");
    167167                            errors.add(TestError.builder(this, Severity.OTHER, OUTER_STYLE_MISMATCH)
    168168                                    .message(message)
    169169                                    .primitives(Arrays.asList(r, wOuter))
    private void checkPolygonsForSharedNodes(Relation r, PolyData pd1, PolyData pd2,  
    378378            }
    379379            if (errorCode == RINGS_SHARE_NODES) {
    380380                errors.add(TestError.builder(this, Severity.OTHER, errorCode)
    381                         .message(tr("Multipolygon rings share node(s)"))
     381                        .message(tr("Multipolygon rings share nodes"))
    382382                        .primitives(prims)
    383383                        .highlight(sharedByPolygons)
    384384                        .build());
    private static boolean checkIfNodeIsInsidePolygon(Node n, PolyData p) {  
    577577                    } else if (loop == 0 || samePoly || (loop == 1 && !allInner)) {
    578578                        String msg = loop == 0 ? tr("Intersection between multipolygon ways")
    579579                                : samePoly ? tr("Multipolygon ring contains segments twice")
    580                                         : tr("Multipolygon outer way shares segment(s) with other ring");
     580                                        : tr("Multipolygon outer way shares segments with other ring");
    581581                        errors.add(TestError.builder(this, Severity.ERROR, CROSSING_WAYS)
    582582                                .message(msg)
    583583                                .primitives(Arrays.asList(r, ways.get(0), ways.get(1)))
    private boolean checkMembersAndRoles(Relation r, List<TestError> tmpErrors) {  
    692692
    693693    /**
    694694     * Check for:<ul>
    695      * <li>{@link #REPEATED_MEMBER_DIFF_ROLE}: Multipolygon member(s) repeated with different role</li>
    696      * <li>{@link #REPEATED_MEMBER_SAME_ROLE}: Multipolygon member(s) repeated with same role</li>
     695     * <li>{@link #REPEATED_MEMBER_DIFF_ROLE}: Multipolygon members repeated with different role</li>
     696     * <li>{@link #REPEATED_MEMBER_SAME_ROLE}: Multipolygon members repeated with same role</li>
    697697     * </ul>
    698698     * @param r relation
    699699     * @return true if repeated members have been detected, false otherwise
    private boolean checkRepeatedWayMembers(Relation r) {  
    737737                    repeatedSameRole.addAll(primitives);
    738738                }
    739739            }
    740             addRepeatedMemberError(r, repeatedDiffRole, REPEATED_MEMBER_DIFF_ROLE, tr("Multipolygon member(s) repeated with different role"));
    741             addRepeatedMemberError(r, repeatedSameRole, REPEATED_MEMBER_SAME_ROLE, tr("Multipolygon member(s) repeated with same role"));
     740            addRepeatedMemberError(r, repeatedDiffRole, REPEATED_MEMBER_DIFF_ROLE, tr("Multipolygon members repeated with different role"));
     741            addRepeatedMemberError(r, repeatedSameRole, REPEATED_MEMBER_SAME_ROLE, tr("Multipolygon members repeated with same role"));
    742742        }
    743743        return hasDups;
    744744    }
  • src/org/openstreetmap/josm/gui/dialogs/properties/CopyKeyValueAction.java

    diff --git a/src/org/openstreetmap/josm/gui/dialogs/properties/CopyKeyValueAction.java b/src/org/openstreetmap/josm/gui/dialogs/properties/CopyKeyValueAction.java
    index d0aa336d1..b493b7056 100644
    a b  
    3131    public CopyKeyValueAction(JTable tagTable, IntFunction<String> keyFn, Supplier<Collection<? extends Tagged>> objectSp) {
    3232        super(tagTable, keyFn, objectSp);
    3333        setName(0);
    34         putValue(SHORT_DESCRIPTION, tr("Copy the key and value of the selected tag(s) to clipboard"));
     34        putValue(SHORT_DESCRIPTION, tr("Copy the key and value of the selected tags to clipboard"));
    3535    }
    3636
    3737    private void setName(long n) {
  • src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java

    diff --git a/src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java b/src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java
    index b4f833894..5f18bc28a 100644
    a b public void actionPerformed(ActionEvent e) {  
    289289
    290290    private class ImageRemoveAction extends JosmAction {
    291291        ImageRemoveAction() {
    292             super(null, new ImageProvider("dialogs", "delete"), tr("Remove photo(s) from layer"), Shortcut.registerShortcut(
    293                     "geoimage:deleteimagefromlayer", tr("Geoimage: {0}", tr("Remove photo(s) from layer")), KeyEvent.VK_DELETE, Shortcut.SHIFT),
     292            super(null, new ImageProvider("dialogs", "delete"), tr("Remove photo from layer"), Shortcut.registerShortcut(
     293                    "geoimage:deleteimagefromlayer", tr("Geoimage: {0}", tr("Remove photo from layer")), KeyEvent.VK_DELETE, Shortcut.SHIFT),
    294294                  false, null, false);
    295295        }
    296296
    public void actionPerformed(ActionEvent e) {  
    304304
    305305    private class ImageRemoveFromDiskAction extends JosmAction {
    306306        ImageRemoveFromDiskAction() {
    307             super(null, new ImageProvider("dialogs", "geoimage/deletefromdisk"), tr("Delete photo file(s) from disk"),
     307            super(null, new ImageProvider("dialogs", "geoimage/deletefromdisk"), tr("Delete photo file from disk"),
    308308                  Shortcut.registerShortcut(
    309                     "geoimage:deletefilefromdisk", tr("Geoimage: {0}", tr("Delete file(s) from disk")), KeyEvent.VK_DELETE, Shortcut.CTRL_SHIFT),
     309                    "geoimage:deletefilefromdisk", tr("Geoimage: {0}", tr("Delete file from disk")), KeyEvent.VK_DELETE, Shortcut.CTRL_SHIFT),
    310310                  false, null, false);
    311311        }
    312312

in reply to:  5 comment:6 by stoecker, 5 years ago

Replying to simon04:

I was unsuccessful for most strings. What about using the plural form instead of the nasty and typographically catastrophic word(s)?

Sounds better to me for the given cases.

comment:7 by simon04, 5 years ago

Resolution: fixed
Status: newclosed

In 16076/josm:

fix #18643 - I18n: improve plural forms

comment:8 by GerdP, 5 years ago

For MultipolygonTest I'd prefer the singular form in all cases where you use the plural form.

comment:9 by simon04, 5 years ago

@GerdP, no objections. Would you change the strings?

comment:10 by GerdP, 5 years ago

In 16078/josm:

see #18643: I18n: improve plural forms

comment:11 by Hb---, 5 years ago

Resolution: fixed
Status: closedreopened

The term photo file occurs only once in the JOSM translation set now.

The term image file is used 16 times. Even the confirmation dialog of this action uses it (18 lines below in ImageViewerDialog.java).

Please replace photo file completely with image file.

  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java

    a b  
    304304
    305305    private class ImageRemoveFromDiskAction extends JosmAction {
    306306        ImageRemoveFromDiskAction() {
    307             super(null, new ImageProvider("dialogs", "geoimage/deletefromdisk"), tr("Delete photo file from disk"),
     307            super(null, new ImageProvider("dialogs", "geoimage/deletefromdisk"), tr("Delete image file from disk"),
    308308                  Shortcut.registerShortcut(
    309                     "geoimage:deletefilefromdisk", tr("Geoimage: {0}", tr("Delete photo file from disk")), KeyEvent.VK_DELETE, Shortcut.CTRL_SHIFT),
     309                    "geoimage:deletefilefromdisk", tr("Geoimage: {0}", tr("Delete image file from disk")), KeyEvent.VK_DELETE, Shortcut.CTRL_SHIFT),
    310310                  false, null, false);
    311311        }
    312312
    313313        @Override
    314314        public void actionPerformed(ActionEvent e) {
    315315            if (currentData != null && currentData.getSelectedImage() != null) {
    316316                List<ImageEntry> toDelete = currentData.getSelectedImages();
    317317                int size = toDelete.size();
    318318
    319319                int result = new ExtendedDialog(
    320320                        MainApplication.getMainFrame(),
    321321                        tr("Delete image file from disk"),
    322322                        tr("Cancel"), tr("Delete"))
    323323                        .setButtonIcons("cancel", "dialogs/delete")
    324324                        .setContent(new JLabel("<html><h3>"
    325325                                + trn("Delete the file from disk?",
    326326                                      "Delete the {0} files from disk?", size, size)
    327327                                + "<p>" + trn("The image file will be permanently lost!",
    328328                                              "The images files will be permanently lost!", size) + "</h3></html>",
    329329                                ImageProvider.get("dialogs/geoimage/deletefromdisk"), SwingConstants.LEFT))

comment:12 by simon04, 5 years ago

In 16107/josm:

see #18643: I18n: improve plural forms (patch by Hb---)

comment:13 by simon04, 5 years ago

Resolution: fixed
Status: reopenedclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.