title: Ember: how to use i18n translations in controller code?
body: <p>I am using Ember i18n in my app.  I also want to use the translation strings in the controllers (in most cases in an alert or confirm message).  How can this be done ?</p>
  
  <p>See <a href="http://jsfiddle.net/cyclomarc/36VS3/2/" rel="nofollow">http://jsfiddle.net/cyclomarc/36VS3/2/</a></p>
  
  <p>Clicking on the button should alert "info" and not "T1005" ...</p>
  
  <pre><code>&lt;script type="text/x-handlebars"&gt;
      {{t T1005}}&lt;br&gt;
      &lt;button {{action 'clickMe' content}}&gt;{{t T1005}} - Click me&lt;/button&gt;
  &lt;/script&gt;
  
  CLDR.defaultLanguage = 'en';
  
  App.ApplicationController = Ember.Controller.extend({
      clickMe: function(){
          alert('T1005');
      }
  })
  </code></pre>
  
  <p>I know that a possible workaround is to no longer use alert and confirm and replace them by for example the bootstrap alternatives.  However, I could imagine that in certain cases you will want to do something with the strings in Javascript (e.g. update a certain label via jQuery or so).</p>
  
  <p>Any ideas on how to use the i18n strings in the controllers is helpful.  Using an i18n library is only usefull if all aspects of the application can be translated ...</p>