Localized field hidden despite nonempty subkeys #10323
Labels
bug
A bug - let's fix this!
field
An issue with a field in the user interface
good first issue
Best for first-time contributors. No experience necessary!
localization
Adapting iD across languages, regions, and cultures
The Name field is a
localized
field that displays not onlyname=*
but also a very large number of potentialname:xyz=*
subkeys. The Name field is universal, so it’s enabled for every preset. However, some presets don’t display it by default. For these presets, the field stays hidden even if the feature hasname:xyz=*
set.Steps to reproduce
To reproduce this issue, create a Windpump (
man_made=windpump
) and manually tag it withname:es=El Gran Molino
. Observe that the Name field doesn’t appear.Impact
In general, it’s incorrect to set
name:xyz=*
without settingname=*
. However, this is a subject of debate for some very international features, such as oceans and seas. Even if it’s a tagging error, the field should automatically show because it isn’t empty. This will be a bigger problem for the name fields being added in openstreetmap/id-tagging-schema#215. Those fields are universal but aren’t included by default in any preset, because the local language isn’t guaranteed to need them all, even as some other language may need one of them.Diagnosis
The logic for showing a field needs a special case for fields of type
localized
that tests for any key beginning with the field’s key and a colon:iD/modules/ui/field.js
Lines 90 to 102 in aaa1441
We should use the same regular expression added in #9124 to test whether the field would show the subkey:
iD/modules/ui/fields/localized.js
Lines 127 to 131 in aaa1441
The text was updated successfully, but these errors were encountered: