From 07d9e0b6adcf5c5879df20a2704608f7f73b998d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Wed, 26 Jul 2017 09:17:54 +0200 Subject: [PATCH] keyTrans() to translate keys --- children.json | 4 ++-- communication.json | 2 +- education.json | 2 +- gastro.json | 2 +- places.json | 2 +- power.json | 2 +- public.json | 2 +- railway.json | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/children.json b/children.json index 5ba1b210b..246ec080f 100644 --- a/children.json +++ b/children.json @@ -4,7 +4,7 @@ "minZoom": 15, "feature": { "markerSign": "{% if tags.leisure=='playground' %}⛹{% elseif tags.leisure=='summer_camp'%}🏕{% elseif tags.leisure=='indoor_play' or tags.kids_area %}🏠{% elseif tags.shop=='baby_goods' or tags.shop=='toys' %}{% elseif tags.amenity=='toilets' and tags.diaper %}🚽🚼{% endif %}", - "body": "{% if tags.leisure=='playground' %}{{ tagTrans('leisure', 'playground') }}{% elseif tags.leisure=='summer_camp'%}{{ tagTrans('leisure', 'summer_camp') }}{% elseif tags.leisure=='indoor_play' %}{{ tagTrans('leisure', 'indoor_play') }}{% elseif tags.kids_area %}{{ tagTrans('kids_area') }}{% elseif tags.shop=='baby_goods' or tags.shop=='toys' %}{{ tagTrans('shop') }}: {{ tagTrans('shop', tags.shop) }}{% elseif tags.amenity=='toilets' and tags.diaper %}{{ tagTrans('amenity', 'toilets') }} with diaper changing table{% endif %}", - "description": "{% if tags.leisure=='playground' %}{{ tagTrans('leisure', 'playground') }}{% elseif tags.leisure=='summer_camp'%}{{ tagTrans('leisure', 'summer_camp') }}{% elseif tags.leisure=='indoor_play' %}{{ tagTrans('leisure', 'indoor_play') }}{% elseif tags.kids_area %}{{ tagTrans('kids_area') }}{% elseif tags.shop=='baby_goods' or tags.shop=='toys' %}{{ tagTrans('shop') }}: {{ tagTrans('shop', tags.shop) }}{% elseif tags.amenity=='toilets' and tags.diaper %}{{ tagTrans('amenity', 'toilets') }} with diaper changing table{% endif %}" + "body": "{% if tags.leisure=='playground' %}{{ tagTrans('leisure', 'playground') }}{% elseif tags.leisure=='summer_camp'%}{{ tagTrans('leisure', 'summer_camp') }}{% elseif tags.leisure=='indoor_play' %}{{ tagTrans('leisure', 'indoor_play') }}{% elseif tags.kids_area %}{{ keyTrans('kids_area') }}{% elseif tags.shop=='baby_goods' or tags.shop=='toys' %}{{ keyTrans('shop') }}: {{ tagTrans('shop', tags.shop) }}{% elseif tags.amenity=='toilets' and tags.diaper %}{{ tagTrans('amenity', 'toilets') }} with diaper changing table{% endif %}", + "description": "{% if tags.leisure=='playground' %}{{ tagTrans('leisure', 'playground') }}{% elseif tags.leisure=='summer_camp'%}{{ tagTrans('leisure', 'summer_camp') }}{% elseif tags.leisure=='indoor_play' %}{{ tagTrans('leisure', 'indoor_play') }}{% elseif tags.kids_area %}{{ keyTrans('kids_area') }}{% elseif tags.shop=='baby_goods' or tags.shop=='toys' %}{{ keyTrans('shop') }}: {{ tagTrans('shop', tags.shop) }}{% elseif tags.amenity=='toilets' and tags.diaper %}{{ tagTrans('amenity', 'toilets') }} with diaper changing table{% endif %}" } } diff --git a/communication.json b/communication.json index 62ac5144e..419a9397b 100644 --- a/communication.json +++ b/communication.json @@ -8,7 +8,7 @@ "feature": { "title": "{{ localizedTag(tags, 'name') |default(localizedTag(tags, 'operator')) |default(tagTrans('amenity', tags.amenity)) }}", "markerSign": "{% if tags.amenity=='post_office' %}🏤{% elseif tags.amenity=='post_box'%}📮{% elseif tags.amenity=='internet_cafe' %}💻{% elseif tags.amenity=='telephone' %}✆{% endif %}", - "body": "{{ tagTrans('amenity', tags.amenity) }}
{% if tags.operator %}{{ tagTrans('operator') }}: {{ localizedTag(tags, 'operator') }}
{% endif %}", + "body": "{{ tagTrans('amenity', tags.amenity) }}
{% if tags.operator %}{{ keyTrans('operator') }}: {{ localizedTag(tags, 'operator') }}
{% endif %}", "description": "{{ tagTrans('amenity', tags.amenity) }}" } } diff --git a/education.json b/education.json index 1d92afabf..266958c12 100644 --- a/education.json +++ b/education.json @@ -8,7 +8,7 @@ "minZoom": 11, "feature": { "markerSign": "{% if tags.amenity == 'university' or tags.amenity == 'college' %}🎓{% elseif tags.amenity == 'library' %}🕮{% elseif tags.amenity == 'school' or tags.amenity == 'language_school' %}🏫{% elseif tags.amenity == 'kindergarten' %}⛹{% elseif tags.amenity == 'public_bookcase' %}📚{% endif %}", - "body": "{{ tagTrans('amenity', tags.amenity) }}
{% if tags.operator %}{{ tagTrans('operator') }}: {{ tags.operator }}
{% endif %}", + "body": "{{ tagTrans('amenity', tags.amenity) }}
{% if tags.operator %}{{ keyTrans('operator') }}: {{ tags.operator }}
{% endif %}", "description": "{{ tagTrans('amenity', tags.amenity) }}", "priority": "{% if tags.amenity == 'university' %}0{% elseif tags.amenity == 'college' %}1{% elseif tags.amenity == 'library' %}2{% elseif tags.amenity == 'school' or tags.amenity == 'language_school' %}3{% elseif tags.amenity == 'kindergarten' %}4{% elseif tags.amenity == 'public_bookcase' %}5{% endif %}" } diff --git a/gastro.json b/gastro.json index a9629db2a..b42cf9ef4 100644 --- a/gastro.json +++ b/gastro.json @@ -4,7 +4,7 @@ "minZoom": 16, "feature": { "markerSign": "{% if tags.amenity=='bar' %}🍸{% elseif tags.amenity=='biergarten'%}🍻{% elseif tags.amenity=='cafe' %}☕{% elseif tags.amenity=='fast_food' %}🍔{% elseif tags.amenity=='ice_cream' %}🍨{% elseif tags.amenity=='pub' %}🍺{% else %}🍴{% endif %}", - "body": "{{ tagTrans('amenity', tags.amenity) }}
{{ tagTrans('cuisine') }}: {{ tagTransList('cuisine', tags.cuisine)|default(trans('unknown')) }}", + "body": "{{ tagTrans('amenity', tags.amenity) }}
{{ keyTrans('cuisine') }}: {{ tagTransList('cuisine', tags.cuisine)|default(trans('unknown')) }}", "description": "{{ tagTrans('amenity', tags.amenity) }}" } } diff --git a/places.json b/places.json index 8bd249225..77dcd99e4 100644 --- a/places.json +++ b/places.json @@ -13,7 +13,7 @@ "minZoom": 0, "feature": { "title": "{% set loc_name = localizedTag(tags, 'name') %}{{ loc_name }}{% if loc_name != tags.name %} ({{ tags.name }}){% endif %}", - "body": "{{ tagTrans('place', tags.place) }}\n{% if tags.population %}
{{ tagTrans('population') }}: {{ tags.population }}{% endif %} \n", + "body": "{{ tagTrans('place', tags.place) }}\n{% if tags.population %}
{{ keyTrans('population') }}: {{ tags.population }}{% endif %} \n", "description": "{{ tagTrans('place', tags.place) }}", "priority": "{% set priorities = { 'continent': 0, 'country': 1, 'state': 2, 'region': 3, 'city': 4, 'town': 5, 'village': 6, 'suburb': 7, 'hamlet': 8, 'quarter': 9, neighbourhood: 10, 'isolated_dwelling': 11, 'farm': 12 } %}{{ priorities[tags.place] }}" } diff --git a/power.json b/power.json index bd045a735..09039c575 100644 --- a/power.json +++ b/power.json @@ -9,7 +9,7 @@ "minZoom": 11, "feature": { "markerSign": "", - "body": "{{ tagTrans('power', tags.power) }}\n{% set x='generator:source' %}{% if tags[x] %}
{{ tagTrans('generator:source') }}: {{ tagTransList('generator:source', tags[x]) }}{% endif %}\n{% set x='generator:method' %}{% if tags[x] %}
{{ tagTrans('generator:method') }}: {{ tagTransList('generator:method', tags[x]) }}{% endif %}\n{% set x='generator:type' %}{% if tags[x] %}
{{ tagTransList('generator:type') }}: {{ tagTrans('generator:type', tags[x]) }}{% endif %}", + "body": "{{ tagTrans('power', tags.power) }}\n{% set x='generator:source' %}{% if tags[x] %}
{{ keyTrans('generator:source') }}: {{ tagTransList('generator:source', tags[x]) }}{% endif %}\n{% set x='generator:method' %}{% if tags[x] %}
{{ keyTrans('generator:method') }}: {{ tagTransList('generator:method', tags[x]) }}{% endif %}\n{% set x='generator:type' %}{% if tags[x] %}
{{ tagTransList('generator:type') }}: {{ tagTrans('generator:type', tags[x]) }}{% endif %}", "description": "{{ tagTrans('power', tags.power) }}{% set x='generator:source' %}{% if tags[x] %}, {{ tagTransList('generator:source', tags[x]) }}{% endif %}", "priority": "{% if tags.power == 'plant' %}0{% elseif tags.power == 'generator' or tags.power == 'line' %}1{% elseif tags.power == 'substation' %}2{% else %}3{% endif %}" } diff --git a/public.json b/public.json index b9a3763e0..980ffc4b9 100644 --- a/public.json +++ b/public.json @@ -8,7 +8,7 @@ "feature": { "title": "{{ tags.name|default(tags.operator)|default(tagTrans('amenity', tags.amenity)) }}", "markerSign": "{% if tags.amenity=='post_office' %}🏤{% elseif tags.amenity=='post_box'%}📮{% elseif tags.amenity=='internet_cafe' %}💻{% elseif tags.amenity=='telephone' %}✆{% endif %}", - "body": "{{ tagTrans('amenity', tags.amenity) }}
{% if tags.operator %}{{ tagTrans('operator') }}: {{ tags.operator }}
{% endif %}", + "body": "{{ tagTrans('amenity', tags.amenity) }}
{% if tags.operator %}{{ keyTrans('operator') }}: {{ tags.operator }}
{% endif %}", "description": "{{ tagTrans('amenity', tags.amenity) }}" } } diff --git a/railway.json b/railway.json index 517abd51d..2543a78d6 100644 --- a/railway.json +++ b/railway.json @@ -16,7 +16,7 @@ "opacity": 1.0 }, "markerSign": "", - "body": "{{ tagTrans('railway', tags.railway) }}
\n{% if tags.operator %}{{ tagTrans('operator') }}: {{ localizedTag(tags, 'operator') }}
{% endif %}\n{% if tags.usage %}{{ tagTrans('usage') }}: {{ tagTrans('usage', tags.usage)|default(trans('unknown')) }}
{% endif %}\n{% if tags.service %}{{ tagTrans('service') }}: {{ tagTrans('service', tags.service ) }}
{% endif %}\n{{ tagTrans('gauge') }}: {{ tags.gauge|default(trans('unknown')) }}
\n{% if tags.electrified == 'no' %}{{ tagTrans('electrified') }}: {{ tagTrans('electrified', 'no') }}{% elseif tags.electrified %}{{ tagTrans('electrified') }}: {{ tagTrans('electrified', tags.electrified) }}, {{ tagTrans('voltage') }}: {{ tags.voltage|default(trans('unknown')) }}, {{ tagTrans('frequency') }}: {{ tags.frequency|default(trans('unknown')) }}
{% endif %}\n", + "body": "{{ tagTrans('railway', tags.railway) }}
\n{% if tags.operator %}{{ keyTrans('operator') }}: {{ localizedTag(tags, 'operator') }}
{% endif %}\n{% if tags.usage %}{{ keyTrans('usage') }}: {{ tagTrans('usage', tags.usage)|default(trans('unknown')) }}
{% endif %}\n{% if tags.service %}{{ keyTrans('service') }}: {{ tagTrans('service', tags.service ) }}
{% endif %}\n{{ keyTrans('gauge') }}: {{ tags.gauge|default(trans('unknown')) }}
\n{% if tags.electrified == 'no' %}{{ keyTrans('electrified') }}: {{ tagTrans('electrified', 'no') }}{% elseif tags.electrified %}{{ keyTrans('electrified') }}: {{ tagTrans('electrified', tags.electrified) }}, {{ keyTrans('voltage') }}: {{ tags.voltage|default(trans('unknown')) }}, {{ keyTrans('frequency') }}: {{ tags.frequency|default(trans('unknown')) }}
{% endif %}\n", "description": "{{ tagTrans('railway', tags.railway) }}", "priority": "{% if tags.railway == 'station' %}0{% elseif tags.railway in [ 'halt', 'tram_stop' ] %}1{% else %}5{% endif %}", "title": "{% if tags.ref %}{{ localizedTag(tags, 'ref') }} - {% endif %}{{ localizedTag(tags, 'name')|default(localizedTag(tags, 'operator'))|default(trans('unnamed')) }}"