title: How can I have Angular-Translate preload my translation before I can use it inside my controller?
body: <p>I am trying out Angular Translate and I need to use the translations inside my controller, but the controller runs the code before my translation is even loaded yet..here is my code:</p>
  
  <pre><code>var myApp = angular.module('myApp', ['pascalprecht.translate']);
  
  angular.module('myApp').config(function ($translateProvider) {
    $translateProvider.useStaticFilesLoader({
      prefix: 'locales/validation-',
      suffix: '.json'
    });
    // load 'en' table on startup
      $translateProvider.preferredLanguage('en');
  });
  
  angular.module('myApp').controller('Ctrl', ['$scope', '$translate', function ($scope, $translate) {
  
    console.debug($translate('INVALID_INTEGER'));
  
    $scope.switchLanguage = function (key) {
      $translate.uses(key);
      console.debug($translate('INVALID_INTEGER'));
    };
  }]);
  </code></pre>
  
  <p>when calling the <code>console.debug($translate('INVALID_INTEGER'));</code> it always shows <code>INVALID_INTEGER</code> instead of the real translation, so I conclude that my translation is not yet loaded. I'm new to both Angular and the Angular-Translate, so I'm not sure of what to do next? Do I have to a <code>promise</code>, I would prefer a built-in function within <code>angular-translate</code> instead. I want simple locale languages which are coming from external and separate <code>json</code> files for each language.
  <br>EDIT<br>
  The real problem I have is that all my translations are used directly inside the controller and not in the view. It seems that <code>angular-translate</code> works good for whatever is displayed in the view but in the controller it doesn't refresh the code inside the controller itself. 
  <br>Please note that I now have a working Beta Project on Github which is where I use the translation... <br><br><a href="https://github.com/ghiscoding/angular-validation" rel="nofollow">Angular-Validation</a> <em>(form validation made easy)</em>.<br><br> My project is an Angular directive and uses the locales languages, if you run the project and choose a language before loading the template then it works, but after that calling the <code>$scope.switchLanguage()</code> won't have any effect on the controller, though any translation on the view would work.</p>