Skip to Content
Technical Articles
Author's profile photo Mohit Bansal

Multi language label texts handling in CDS based Fiori Elements apps

Fiori Elements Multi Language Text Handling:

This Blog is about maintaining the multi- language label text for Fiori elements-based applications which is generated with the help of CDS. Annotations plays a key for role generating and rendering of the respective UI applications.

(For more information on Fiori Elements check this link: https://experience.sap.com/fiori-design-web/smart-templates/)

Generally, we use I18N properties for Language based text handling in UI5 applications but in case Fiori Elements CDS based applications, UI elements texts can be handled effectively with CDS UI annotations and Translator editor.

How to guide

  • Create the consumption CDS with the help of UI Annotations(which can be exposed for ODATA , directly or via SEGW reference data source).
  • Use Label Annotation for defining the text for the respective UI elements (for example: Line Item, selection fields, header, Identification etc)
  • Once CDS are created and activated, maintain the multi-language Text for the CDS in Translator editor -SE63
  • Create the Fiori elements-based app from the WEBIDE tool, select the Template (i.e. List Report/ Overview Page)

 

Detailed explanation with example

Consumption CDS with the UI annotations

Annotations for Label for the UI Elements as below:

 

 

Maintain Text for the UI Labels used in CDS

a) Go to T Code SE63 and select Short Text

b)Drill Down to A5 and select DDLS- CDS views

c) Enter the CDS Information and Maintain the Texts. In the below example, we are maintaining the Text in French(FR), Click on Edit.

d)Text Maintenance in French Language, For Example I have used “FR” as prefix to show the Text in French:

 

Create the Fiori Elements based List Report

Consume the generated ODATA Service in WEBIDE and select List Report. For more information for generating the list report refer following link

ABAP Programming Model for HANA

Testing the Application(Multi Language Test)

Initially I have default language set in Chrome Browser as English, report will show all the label in English

 

Now change the Language to French (FR) in Chrome browser , clear the cache and test again.

 

Output 

Clear the browser cache and execute the application again, we can see all the Labels for which Texts are maintained in French

 

Summary:

Multi Language  Label texts can be maintained directly by backend Translator edittor(SE63) for the CDS based Fiori elements applications. No need for maintaining label texts explicitly in generated UI5 application’s I18N files.

Assigned Tags

      16 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo ANURAG SINGH
      ANURAG SINGH

      Very informative blog Mohit..

      Author's profile photo Nabheet Madan
      Nabheet Madan

      Thanks Mohit for this informative blog. We are still using Se63 for translation in world of S4 HANA and cloud surprise me sometime:P. I hope we have a better translation tool available in place of SE63( if already their is not aware of).

      Author's profile photo Aman Gupta
      Aman Gupta

      very informative Mohit.. Keep it coming!

      Author's profile photo Dhiraj Jain
      Dhiraj Jain

      Good One Mohit

      Author's profile photo Yogesh KishoreKumar
      Yogesh KishoreKumar

      Very Informative Content Mohit . 

      Author's profile photo Gaurav Kashinath Pednekar
      Gaurav Kashinath Pednekar

      Great Blog Sir. Very helpful

      Author's profile photo DHIRAJ KUMAR
      DHIRAJ KUMAR

      Hi Mohit,

       

      I was trying to do same but getting the error "Incorrect Page Code".

      When I click on F4 in Target Language  getting only a single record - enUS.

      Please could you suggest if I am doing wrong way.

       

      Thanks & Regards,

      Dhiraj

      Author's profile photo Mark Lewis
      Mark Lewis

      HI Mohit

      I have defined a Metadata Extension with Fieldgroups for a Fiori Elements List Report.

      e.g.

      @UI.facet: [
      { label : 'Details', id: 'idDetail', type: #COLLECTION , position: 20, importance: #HIGH },

      I tried the above approach to translate the Labels for the Field Groups but the Field Group labels do not appear. Can you advise how we can translate FieldGroup Labels please?

      Regards

      Mark

      Author's profile photo Paul McFarling
      Paul McFarling

      Did you ever find a solution?

      Author's profile photo Mark Lewis
      Mark Lewis

      Hi Paul - at the time I think I ended up using Run Time Adaptations to do this.

      I've seen OTR being used but not sure if that is relevant in facet, just not had time to investigate it though.

      Author's profile photo James Marlin
      James Marlin

      Question about 'forcing' a specific language irregardless of the browser language, system default language, etc.  Is their an annotation which can be use which will force the data dictionary texts?

      This is a hypothetical.

      Author's profile photo Murthy Sannidhi
      Murthy Sannidhi

      Hi Mohit,

      it is very nice and helpful for beginner like me. Hope to see more blogs from you.

      Author's profile photo Jens Schwendemann
      Jens Schwendemann

      Is this somehow connected to using UI5 flexibility services / UI adaption to change standard apps? When I change a label with UI Adaption, how can this be translated?

      Author's profile photo Swamy swamy
      Swamy swamy

      Hi,

      I have tried above approach for CDS View column Headings translations in German its not reflecting

      Text Translations:SE63----->Short Texts---->A5---->CDS Views--->ZXX_EXT2   ie EN to DE

      Extended STD CDS as ZCDS_EXT, can please help us.

       

      @AbapCatalog.sqlViewAppendName: 'ZXX_EXT2SQL'

      @EndUserText.label: 'Supplier Invoice List C'

      extend view C_SupplierInvoiceList with ZXX_EXT2

      {

      @EndUserText: {label: ' Heading2'}

      invoice.Field2,

      @EndUserText: {label: ' Heading1'}

      invoice.Field1}

      Author's profile photo Geert Nackers
      Geert Nackers

      Hi,

      For translating texts in the metadata file, goto SE63 in the backend

      Your CDS extension is in a transport somewhere with the key R3TR | DDLX | <your metadata extension >

      Use this in SE63 --> Translation --> ABAP objects --> Transport object

      Use the key and translate.

      Kind regards,

      Geert

      Author's profile photo Ramin Shafai
      Ramin Shafai

      How do you transport the translated text of a CDS views.

      This:

      SE63 --> Translation --> ABAP objects --> Transport object

      does not transport, it translates what's in the transport. I need to transport what I already translated.