-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More flexible format in 'Search Features' when searching by element id #7627
Comments
It would be great if we could allow more than one translated word for the regex, e.g. „Punkt“ and „Knoten“ for the german translation of node or maybe even „Weg“ and „Fläche“ for way. |
I think this would be pretty straightforward. Ideally, iD would expose a translatable string for “node id” in Transifex. With the current locale’s translation in hand, iD could convert that into a regex dynamically.
Or iD could expose two translatable lists of prefixes and suffixes (similar to the presets’ synonym lists), which would allow for variation. Hopefully no language needs both a prefix and suffix at the same time, though. |
Would it be possible to update the regex to exclude spaces before or after element ids? As that would solve #7467. |
Ignore whitespace before, after or between: |
Consider merging this issue with with #7282. Also, I had indicated I might make a pull request. I'm abandoning that for now. |
These are examples of positive matches: |
I think we could just have Lines 125 to 149 in 0789b86
So check location first, don't bother checking id if location is matched. Thoughts? |
@SilentSpike Sounds fine, I'd welcome a PR for that. |
Currently, User can search for a specific feature with a 'Search Features' query like
n1234
. When I copy an element from JOSM (or other places) I get a string likenode 1234
. But when I search in iD for this string, I get nothing. When I search for1234
it offersnode 1234
as an option.I suggest supporting search queries of the form
node 1234
.After looking at the code...
iD/modules/ui/feature_list.js
Line 125 in 63aa47f
it could use the regex
/^(node|way|relation|[nwr]) ?([0-9]+)$/i
and in four places immediately blow, replace
idMatch[1]
withidMatch[1][0]
But this would only support English. A step further would be to get the user's current language, and support the localized word for each element type.
The text was updated successfully, but these errors were encountered: