cancel
Showing results for 
Search instead for 
Did you mean: 

MII Localization Javascript

former_member193964
Active Participant
0 Kudos

Hello All,

I want to use a localization Meta-inf at workbench in the irpt page. Is it possible?

I created a bundle files in the root and i use the code below to get the text:

var oBundle = jQuery.sap.resources({url : "/XMII/CM/Test/i18n.properties"});

oBundle.getText("Title");

But i want to use meta-inf in the workbench and i get a error if i use this location.

Regards,

Marcelo

Accepted Solutions (1)

Accepted Solutions (1)

former_member193964
Active Participant
0 Kudos

Hello all.

I tried to do on this way : sap.ui.getCore().byId('teste').setLabel("{##teste}") but not works.

I created a bundle file on root project with this code and works fine.

var oBundle = jQuery.sap.resources({url : "/XMII/CM/projectTeste/i18n.properties",locale: lang });

sap.ui.getCore().byId('teste').setLabel(oBundle.getText("N.MassaReal"));

Thanks

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Marcelo,

Use Localization key like this in your IRPT page:

{##Title}

Also have a look at this link for information about Localization in MII:

SAP Library - MII Visualization Services

Regards,

Rohit Negi.

former_member193964
Active Participant
0 Kudos

Hello Rohit,

But i need to put the localization in the UI5 Object. I need to pass this value by javascript.

This bundle works but i need to know if is possible to user the bundle in the workbench.

Regards,

Marcelo

Former Member
0 Kudos

Hi Marcelo,

Wherever you want to get the Localization key, You can use as Rohit mentioned {##Key}

If you want to set UI5Objects Title.

You can use Java Script Methods and set like this.

ChartObj.getChartObject().setTitle("{##Key}");

Pls Try it.

Regards,

Sriram

Former Member
0 Kudos

Hi Sriram,

I tried you mentioned approach as below,

sap.ui.getCore().getElementById("TitleText").setText("{##Title}");

But, it is displaying {##Title} instead of displaying the right value.

Thanks,

Shashi