Skip to content

Commit 3c826f2

Browse files
Support for @UI.HeaderInfo.TypeName (#124)
Hi colleagues, for the object type column the label of the entity is being used. However it is not common that entities are annoyed with a label. Instead they usually have the `@UI.HeaderInfo` annotation annotated as it dictates app, object page and table names in Fiori elements. Thus change tracking should also consider this annotation as a fallback. `@UI.HeaderInfo.TypeNamePlural` is also an option if desired. Moreover `@UI.HeaderInfo.Title` defines the object page identifier for a rotation and it might make sense to consider this for a nicer Object Key (or consider @Common.SemanticKey). BR, Marten Co-authored-by: Wenjun Zheng <[email protected]>
1 parent 0fd23c3 commit 3c826f2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/localization.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ const _getLabelI18nKeyOnEntity = function (entityName, /** optinal */ attribute)
9898
let def = cds.model.definitions[entityName];
9999
if (attribute) def = def?.elements[attribute]
100100
if (!def) return "";
101-
return def['@Common.Label'] || def['@title'];
101+
return def['@Common.Label'] || def['@title'] || def['@UI.HeaderInfo.TypeName'];
102102
};
103103

104104
const localizeLogFields = function (data, locale) {

0 commit comments

Comments
 (0)