title: Internationalization-of-dynamic-data-in-angular
body: <p>I am using internationalization [i18n] in my angular project. For static content it is working properly. But dynamic content it is not working.</p>
  
  <p>My code is as follows:</p>
  
  <p><strong>Static:</strong></p>
  
  <pre><code>     &lt;div&gt;{{ 'ADD ENTRY' | translate }} &lt;/div&gt;
  </code></pre>
  
  <p><strong>Dynamic:</strong></p>
  
  <pre><code>    &lt;div&gt;{{ status | translate }} &lt;/div&gt;
  </code></pre>
  
  <p>I am getting status code from the back end API, that I am mapping to the variable <strong>status</strong> in the ts file.
  In my case I am getting status code as <strong>404</strong>. So I reconfigured that 404  in <strong>i18n</strong> configuration file. 
  But it is not working if I try to translate that variable.But instead of passing that status variable, if I directly pass <strong>'404'</strong> as string then the internationalization working properly.</p>
  
  <p><strong>My code is as follows:</strong></p>
  
  <pre><code>    &lt;div class="error" *ngIf="status"&gt;**{{ '404' | translate }} **&lt;/div&gt;
  </code></pre>
  
  <p>for this internationalization working.</p>
  
  <p>But I need to internationalize the variable status, but facing issue. </p>
  
  <p><strong>My code is as follows:</strong></p>
  
  <p><strong>In HTML:</strong></p>
  
  <pre><code>  &lt;div class="error" *ngIf="status"&gt;{{ status | translate }} &lt;/div&gt;
  </code></pre>
  
  <p><strong>In ts:</strong></p>
  
  <pre><code>    status: string;
      this.status = error.status;
  </code></pre>
  
  <p>I also tried as:</p>
  
  <pre><code>        &lt;div class="error" *ngIf="status"&gt;{{"'"+{{status}}+"'"}} | translate}}&lt;/div&gt;
  </code></pre>
  
  <p>But it is not working.</p>