title: How to use SAPUI5 i18n in controller?
body: <p>Below is my scenario: </p>
  
  <p>Output(sample)</p>
  
  <p>Visit type: court<br>
  Purpose    :<br>
     (or) if</p>
  
  <p>Visit type: Site Visit (Factory)<br>
  Factory Name:             </p>
  
  <p>(*this is the split app, Master list contains two different text values "court" &amp; "Site Visit (Factory)" based on the list user. *Now if the list contains the value "court" the label should change to purpose and if the list contains the value "Site Visit (Factory)" the label should change to Factory Name)</p>
  
  <p>Kindly help me in it.</p>
  
  <p>View</p>
  
  <pre><code>&lt;Label id="idVisitType" text="{i18n&gt;perdmm}" design="Bold" /&gt;
              &lt;Text id="perdm_id" class="secondtable"&gt;&lt;/Text&gt;
  </code></pre>
  
  <p>Controller</p>
  
  <pre><code>sap.ui.getCore().byId("detail_form_id--idsitevisit--visittypee").setText(oData.VisitType);
  if (oData.VisitType == "Site Visit (Factory)") {
      sap.ui.getCore().byId("detail_form_id--idsitevisit--idVisitType").setText('{i18n&gt;reasonfactory}');
  } else {
      sap.ui.getCore().byId("detail_form_id--idsitevisit--idVisitType").setText('{i18n&gt;perdmm}');
  }
  </code></pre>
  
  <p>based on the above code the output is getting like this,</p>
  
  <p><a href="https://i.stack.imgur.com/ZevUW.png" rel="nofollow noreferrer">Output</a></p>
  
  <p>Thanks in advance</p>