Allow special pitchnames for pitch-sport combinations #9
Merged
plepe
merged 1 commits from Hufkratzer/main:pitchnames
into master
5 years ago
Loading…
Reference in new issue
There is no content yet.
Delete Branch 'Hufkratzer/main:pitchnames'
Deleting a branch is permanent. It CANNOT be undone. Continue?
This is a proposal to allow to display special names for frequently used pitch-sport combinations in the "Leisure" category via weblate where these names can also be translated.
I had found several similar entries for translations of tag combinations in weblate (e.g. for "tag:amenity=toilets diaper=yes") and have followed this scheme.
The new code constructs a string like e.g. "tag:leisure=pitch sport=tennis" and tries to find a translation. If it finds one (which in this case should be "Tennis Court") it will be used, if it doesn't the old description "Pitch - Tennis" will be displayed.
Compare iD presets for frecuently used pitches
Makes sense?
I couldn't find out yet how to insert the necessary entries in weblate. How does this work?
Yes, this is possible, but there's no "native" support for it.
You should use the following syntax:
Which will generate the string "tag:leisure=pitch sport=tennis" => "Tennispitch" (or so).
tagTransList
will handle multivalue tags, so if the tag 'sport' is "tennis;squash", it will generate a list: Tennispitch and Squashpitch.There's no way (yet) to check, whether a string "tag:leisure=pitch sport=tennis" actually exists, nor whether it has been translated. The return value defaults to "tennis".
You can add the tags the the
tags/en.json
file in openstreetmap-tag-translations yourself (there's an executable "tag-add" in that repo), or I can do that for you.I also added commit
8512e6855c
to allow multi-values.Thanks for your contribution!
8fb281747a
.