#11275 closed enhancement (fixed)
[Patch] More info when multiple tag values present (helps prevent mistakes when editing multiple values)
Reported by: | brycenesbitt | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 15.04 |
Component: | Core | Version: | |
Keywords: | Cc: |
Description (last modified by )
Attachments (3)
Change History (24)
by , 10 years ago
Attachment: | Selection_194.png added |
---|
comment:1 by , 10 years ago
Description: | modified (diff) |
---|
comment:2 by , 10 years ago
Note the code does a string compare on "<different>" in two places. It seems fine relative to this patch,
but would break if this idea were extended.
follow-up: 5 comment:4 by , 10 years ago
Milestone: | → 15.04 |
---|
Good idea indeed. Maybe "unset" is a better wording?
comment:5 by , 10 years ago
Replying to Don-vip:
Good idea indeed. Maybe "unset" is a better wording?
+1
I'm not a native speaker, but "unique" means that something exists only once. I.e. "N unique other values" implies, that non of the tags exists twice or more in the current selection. Maybe "distinct" fits better in this case.
Also it seems to be miscounting by 1 when there is no unset value.
comment:6 by , 10 years ago
Fix uploaded for miscount Don-vip noticed.
Thinking about it: "unique" and "other" are redundant, and thus confusing.
English is pretty flexible, and a lot of wordings work. But how about this:
<2233 unset, 1 other value>
Extending the idea of the patch, how about taking the common case of one value with:
<2233 unset, 55 nodes with value "cluster">
or
<2233 unset, 55 "this is a really long value">
by , 10 years ago
Attachment: | josm_patch_multiple_select_more_info.diff added |
---|
Updated patch with correct count in case of zero unset.
by , 10 years ago
Attachment: | josm_patch_multiselect_rev_2.diff added |
---|
Enhanced patch, shows value if there is just unset and one value.
comment:8 by , 10 years ago
I'm sorry for complaining, but strings like , {0} unset
are nonsense from an internationalization point of view. Can you please use complete messages? Or at least give more context to translators so they know what the other part of the message is and what the possible combinations are.
comment:9 by , 10 years ago
@holgermappt space is at a premium for these messages, thus the short form.
The best you'd get anyway is "<{0} unset, {00} other values>".
Is there a method that allows inserting a note to the translators?
http://xnap-commons.sourceforge.net/gettext-commons/apidocs/org/xnap/commons/i18n/I18n.html
What do you suggest as a fix?
comment:10 by , 10 years ago
Notes are any comments in front of the string to translate.
Optimum for translators would be to switch between all possible complete strings, but this also does not work, as trn() can only take one number as base. This is one of the cases where perfect translation is impossible.
comment:11 by , 10 years ago
I played with the tags and got these combinations:
foo: bar
- one or more with key foo and the same valuefoo: <n different>
- same key foo, n different values, n is a number > 1foo: <n 'bar', o unset>
- n have the same key foo and value bar, n >= 1, o don't have key foo, o >= 1foo: <n different, o unset>
- key foo has n different values, n > 1, o don't have key foo, o >= 1
That means we have these build rules, all are translatable strings:
- indication that this is not a value but a message about different values:
<{0}>
with tr() - concatenation of two message parts:
{0}, {1}
with tr(), this is the generic version for multiple concatenations, an alternative is<{0}, {1}>
as there is no more than two parts - n elements with same key:
{0} '{1}'
with trn(),{0}
is the number (this might look silly, but there might be languages that need this) - n different:
{0} different
with trn(), this is tr() now, which is wrong - o unset:
{0} unset
with trn()
Or with complete strings:
<{0} different>
with trn()<{0} '{1}', {2} unset>
- this doesn't work as{0}
and{2}
are numbers<{0} different, {1} unset>
- this doesn't work as{0}
and{1}
are numbers
So my suggestion is to implement the build rules with comments what the strings mean and how they are used. If other code should/could use the same build rules it would make sense to write a class for this.
comment:12 by , 10 years ago
The other place this code could be used is after you double click to set a value, the dialog also uses the word "different".
Search the code for the string different, and that's the list of places this might be useful.
comment:13 by , 10 years ago
I also vote for fixing the localizability of this. But I understand there are quite a few combinations of the string fragments so I am not yet sure what the right fix would be. But at least, why does "unset" have plural forms (with trn) but "different) doesn't (tr only)?
follow-up: 15 comment:14 by , 10 years ago
@aceman I used the plural for "different" only because the number is always 2 or greater. Is there a language for which the necessary word depends on the number before it?
comment:15 by , 10 years ago
Replying to brycenesbitt:
@aceman I used the plural for "different" only because the number is always 2 or greater. Is there a language for which the necessary word depends on the number before it?
Sure. There are languages which have up to 6 plural forms.
See r8189.
comment:16 by , 10 years ago
Yes please, never assume you can optimize out some form (e.g. singular). Other languages will still need the full pluralization support (trn). There may be different a form for 0, 1, 2, 10, x1, 100, etc. Just let the code and the localizers worry about it ;)
follow-up: 21 comment:17 by , 10 years ago
@brycenesbitt See e.g. here: https://translations.launchpad.net/+languages/ar
There are also languages that go from right to left. For those languages something like str += ", {0} unset"
would produce a message with items in the wrong (left to right) order. That's why I wrote the 5 build rules. They are all necessary to cover all languages. Even the <...>
should be translatable as it might have a different meaning in other cultures or languages.
comment:18 by , 10 years ago
comment:19 by , 10 years ago
I think in these cases the no-text strings should be "<{0}, {1}>" (including the comma and brackets) so that localizers know what is the context and also can change the position of the comma or the brackets. Then you can have {0} be the "X different" string and {1} be the "X unset" string (both with trn).
comment:21 by , 10 years ago
Replying to holgermappt:
There are also languages that go from right to left. For those languages something like
str += ", {0} unset"
would produce a message with items in the wrong (left to right) order.
My comment was wrong. It's the display that is right-to-left, the logical order would still be correct - first, second.
Showing object count / blank count / unique value count