Browse Source

twig function tagTransList: translate lists of values (e.g. cuisine=kebab;pizza)

master
parent
commit
f79c0720ef
  1. 2
      gastro.json
  2. 6
      shop.json

2
gastro.json

@ -5,7 +5,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) }}<br/>{{ tagTrans('cuisine') }}: {{ tagTrans('cuisine', tags.cuisine)|default('unknown') }}",
"body": "{{ tagTrans('amenity', tags.amenity) }}<br/>{{ tagTrans('cuisine') }}: {{ tagTransList('cuisine', tags.cuisine)|default('unknown') }}",
"description": "{{ tagTrans('amenity', tags.amenity) }}"
}
}

6
shop.json

@ -7,9 +7,9 @@
},
"minZoom": 14,
"feature": {
"pre": "{% set current = const.default %}{% for v in const.shops %}{% if tags.shop in v.types %}{% set current = v %}{% endif %}{% endfor %}",
"body": "{{ tagTrans('shop', tags.shop) }}",
"description": "{{ tagTrans('shop', tags.shop) }}",
"pre": "{% set shop0 = tags.shop|split(';')[0] %}{% set current = const.default %}{% for v in const.shops %}{% if shop0 in v.types %}{% set current = v %}{% endif %}{% endfor %}",
"body": "{{ tagTransList('shop', tags.shop) }}",
"description": "{{ tagTransList('shop', tags.shop) }}",
"markerSign": "{% set c = current.sign %}{% if c|slice(0, 3) == 'fa-' %}<i class=\"fa {{ c }}\"></i>{% else %}{{ c|raw }}{% endif %}",
"__": "need better icons for: bakery, butcher, cheese, ice_cream, ",
"__": "no icons for: brewing_supplies, charity, second_hand, variety_store"

Loading…
Cancel
Save