Quantcast
Viewing all articles
Browse latest Browse all 2806

Re: Getting i18n text in controller

xxx.i18n = function (property) {

   if (arguments.length > 1) {

   var text = sap.ui.getCore().getModel("i18n").getProperty(arguments[0]);

 

   if (text) {

   for (index = 1; index < arguments.length; ++index) {

   text = text.replace("{" + index + "}", arguments[index]);

  }

  }

 

   return text;

  }

   else {

   return sap.ui.getCore().getModel("i18n").getProperty(property);

  }

};

 

xxx.i18n("NAME_OF_THE_PROPERTY", param1, param2);//will replace {1} with value from param1 and {2} with param2 etc


Viewing all articles
Browse latest Browse all 2806

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>