Using i18n text in ABAP CDS
Doing CAP projects You have usually the i18n files in the same service project. In ABAP we have no such, only transaction SE63 to translate text annotations of CDS Metadata Extensions (MDE). The possibility is however given to do this outside ABAP CDS, this means You can refer i18n properties placed in the frontend UI5/Fiori project from the MDE, which is more easy to translate with modern tooling on the FrontEnd side and can be automated.
To do so simply use the well known UI5 syntax in ABAP CDS when defining text elements.
@UI.Facet: [ { label: '{@i18n>@GeneralInfoFacetLabel}', targetQualifier: 'GeneralInformation', type: #FIELDGROUP_REFERENCE, purpose: #STANDARD }, { id: 'FurtherData', label: '{@i18n>@FurtherData}', type: #COLLECTION, purpose: #STANDARD }, { parentId: 'FurtherData', purpose: #STANDARD } ] product;
To make this working the manifest.json of the Fiori project must contain the resource model @i18n. Working with Fiori Elements template this is added by default, no actions needed from our side.
"models": { "@i18n": { "type": "sap.ui.model.resource.ResourceModel", "uri": "i18n/i18n.properties" } }
The rest is as usual. Define your text elements which require translation in the i18n file within the frontend UI5 / Fiori project.
Share this content: