Fix localized field hidden despite nonempty subkeys (Closes#10323)

This commit is contained in:
Sam Ho
2024-07-16 12:38:06 +01:00
parent aaa144191c
commit 43c65bf994

View File

@@ -97,6 +97,15 @@ export function uiField(context, presetField, entityIDs, options) {
}
return false;
}
if (field.type === 'localized') {
for (let tagKey in _tags) {
// matches for field:<code>, where <code> is a BCP 47 locale code
let match = tagKey.match(/^(.*):([a-z]{2,3}(?:-[A-Z][a-z]{3})?(?:-[A-Z]{2})?)$/);
if (match && match[1] === field.key && match[2]) {
return true;
}
}
}
return _tags[key] !== undefined;
});
}