Browse Source

name-etymology: show various variants of name tags

name-etym
parent
commit
fc8a16e994
  1. 24
      name-etymology.json

24
name-etymology.json

@ -6,8 +6,9 @@
"query": {
"14": [
"(",
"nwr[~\"^(old_|alt_|loc_)name(:[0-9\\-]+)$\"~\".\"];",
"nwr[~\"^(old_|alt_|loc_|)name:([0-9\\-]+:)?etymology$\"~\".\"];",
"nwr[~\"^(old_|alt_|loc_|int_|nat_|official_|reg_)name(:[0-9\\-]+)$\"~\".\"];",
"nwr[~\"^(old_|alt_|loc_|int_|nat_|official_|reg_)name([0-9]*)$\"~\".\"];",
"nwr[~\"^(old_|alt_|loc_|int_|nat_|official_|reg_|)name:([0-9\\-]+:)?etymology$\"~\".\"];",
");"
]
},
@ -20,24 +21,23 @@
"body": [
"<ul>",
"{% if attribute(tags, \"name:etymology\") %}<li>{{ keyTrans('name:etymology') }}: {{ attribute(tags, \"name:etymology\")|enumerate }}</li>{% endif %}",
"<li>{{ keyTrans('start_date') }} ({{ keyTrans('name') }}): {% if attribute(tags, \"name:start_date\") %}{{ attribute(tags, \"name:start_date\")|osmFormatDate({ format: \"long\" }) }}{% else %}{{ trans('unknown') }}{% endif %}</li>",
"{% if attribute(tags, \"name:start_date\") %}<li>{{ keyTrans('start_date') }} ({{ keyTrans('name') }}): {% if attribute(tags, \"name:start_date\") %}{{ attribute(tags, \"name:start_date\")|osmFormatDate({ format: \"long\" }) }}{% endif %}</li>{% endif %}",
"",
"{% for k in [\"old_name\", \"alt_name\", \"loc_name\"] if attribute(tags, k) %}<li>",
" {{ keyTrans(k) }}{% if attribute(tags, k ~ ':start_date') or attribute(tags, k ~ ':end_date') %} ({{ (attribute(tags, k ~ ':start_date') ~ \"..\" ~ attribute(tags, k ~ ':end_date'))|osmFormatDate({ format: 'short' }) }}){% endif %}:",
"{% for k, v in tags|ksort %}",
" {% set m = k|matches(\"^(old_|alt_|loc_|int_|nat_|official_|reg_|)name([0-9]*)$\") %}",
" {% if m and k != 'name' %}<li>",
" {{ keyTrans(m[1] ~ 'name') }}{% if m[2] %} #{{ m[2] }}{% endif %}{% if attribute(tags, k ~ ':start_date') or attribute(tags, k ~ ':end_date') %} ({{ (attribute(tags, k ~ ':start_date') ~ \"..\" ~ attribute(tags, k ~ ':end_date'))|osmFormatDate({ format: 'short' }) }}){% endif %}:",
" {{ attribute(tags, k)|enumerate }}",
" {% if attribute(tags, k ~ ':etymology') %}({{ attribute(tags, k ~ ':etymology')|enumerate }}){% endif %}",
"</li>{% endfor %}",
" </li>{% endif %}",
"",
"{% for k, v in tags|ksort %}",
" {% set m = k|matches(\"^(old_|alt_|loc_|)name:(([0-9]{4})?-([0-9]{4})?|([0-9\\-]+)?--([0-9\\-]+)?)$\") %}",
"{% if m %}",
" <li>",
" {% if m %}<li>",
" {% if m and (m[3] or m[4]) %}{{ keyTrans(m[1] ~ 'name') }} ({{ (m[3] ~ '..' ~ m[4])|osmFormatDate({ format: \"short\" }) }}): {{ v }}{% endif %}",
" {% if m and (m[5] or m[6]) %}{{ keyTrans(m[1] ~ 'name') }} ({{ (m[5] ~ '..' ~ m[6])|osmFormatDate({ format: \"short\" }) }}): {{ v }}{% endif %}",
" {% if attribute(tags, k ~ ':etymology') %}({{ attribute(tags, k ~ ':etymology') }}){% endif %}",
" </li>",
"{% endif %}{% endfor %}",
"</ul>"
" </li>{% endif %}",
"{% endfor %}</ul>"
]
}
}
Loading…
Cancel
Save