title: How to translate the content of an attribute with angular-translate
body: <p>in my mongo schema i have an enum with predefined types:</p>
  
  <pre><code>let MeterSchema = new Schema({
  [...]
  type: {
      type: String,
      enum: ['Prepayment', 'TimeOfDay', 'PowerExport']
  },
  [...]
  }
  </code></pre>
  
  <p>What i want is to display this value internationalized with i18n files on my angular view.
  I looked at the Variale replacement of angular translate (<a href="https://angular-translate.github.io/docs/#/guide/06_variable-replacement" rel="nofollow noreferrer">https://angular-translate.github.io/docs/#/guide/06_variable-replacement</a>), but could not figure it out how do it properly with this.</p>
  
  <p>At the moment i translate it that way:</p>
  
  <h3>View</h3>
  
  <pre><code>&lt;div class="md-summary"&gt;{{vm.getMeterType(meter) | translate}}&lt;/div&gt;
  </code></pre>
  
  <h3>Controller</h3>
  
  <pre><code>public getMeterType(meter): String {
      return 'app.masterData.meters.type.' + meter.type;
  }
  </code></pre>
  
  <p>But i think there has to be a better way to this.</p>