Let's follow up this discussion at the Neptune Community

(this forum will be kept in read-only mode)

Translation Inside Javascript Code

Hi All.

It is possible to use Translated values inside application into my Javascript code (for example errors/alerts Message Toast) whitout using hardcoding text?

Into SAPUI5/Fiori projects, for example, i use module jQuery.sap.resources, into NAD there is the Translation panel but i can only redefine values for existing Views.


There is a mode for use this feature for create/editing custom string for runtime translation or I must create locals resource files like in SAPUI5 projects?

1 Comment

Hi Andrea


I suggest using sap.m.Text elements. These can be translated and you can use the text for them in your javascript. 


Example:


jQuery.sap.require("sap.m.MessageToast");

sap.m.MessageToast.show(txtTranslateUpdated.getText());


Regards

Ole Andre 


Login or Signup to post a comment