stellar/stellar-client — pull request #632 by bartekn (2014-08-13 16:09:51+00:00)
Title: Translations

**Don't merge before carefully checking if everything is working well and all strings are in their places.**
***
This pull request introduces ability to translate stellar-client to different languages. It's based on [angular-translate](https://github.com/angular-translate/angular-translate) module. All strings has been moved to `/app/scripts/locale/en.js`. Adding another language is as simple as adding a locale file and updating config in `app.js` file.

Translation files are loaded asynchronously (we load only one translation file for a user - it will save bandwidth when there'll be many translations). Because of this, it's important to check if locale file has been already loaded when getting a translated string value in code areas where translation file might not have been loaded yet. For example, when you're setting a value in controller just after it's loaded:
```js
angular.module('stellarClient').controller('RegistrationRewardCtrl', function ($scope, $translate) {
$scope.reward_name = $translate.instant('rewards.registration_reward_name');
});
```
Instead you should try this:
```js
angular.module('stellarClient').controller('RegistrationRewardCtrl', function ($scope, $translate) {
$scope.reward_name = $translate.instant('rewards.registration_reward_name');
$translate(['rewards.registration_reward_name'])
.then(function(translations) {
$scope.reward_name = translations['rewards.registration_reward_name'];
});
});
```
When you're sure that translation file is loaded (callbacks etc.) simple `$translate.instant` is enough. You will find many examples in code below.

In templates use one [translate filter](http://angular-translate.github.io/docs/#/guide/04_using-translate-filter) or [translate directive](http://angular-translate.github.io/docs/#/guide/05_using-translate-directive).

It is very large commit that may potentially break many parts of the app. Please, check carefully if it works before merging.