Skip to content

Commit

Permalink
close #7 internationalization angular complete
Browse files Browse the repository at this point in the history
  • Loading branch information
BioQwer committed Apr 10, 2016
1 parent 81b3f90 commit fc3b8bc
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
6 changes: 6 additions & 0 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@
<script src="/bower_components/angular-animate/angular-animate.js"></script>
<script src="/bower_components/angular-audio/app/angular.audio.js"></script>
<script src="/bower_components/angular-translate/angular-translate.js"></script>
<script src="/bower_components/angular-translate-loader-static-files/angular-translate-loader-static-files.js"></script>
<script src="/bower_components/angular-cookies/angular-cookies.js"></script>
<script src="/bower_components/angular-translate-storage-cookie/angular-translate-storage-cookie.js"></script>
<script src="/bower_components/angular-translate-storage-local/angular-translate-storage-local.js"></script>
<script src="/bower_components/angular-translate-handler-log/angular-translate-handler-log.js"></script>
<script src="/bower_components/angular-dynamic-locale/src/tmhDynamicLocale.js"></script>
<!-- endbower -->
<!-- endbuild -->

Expand Down
12 changes: 7 additions & 5 deletions app/scripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,17 @@
this.checkState();
};

var _isRussian = true;
this.changeLanguage = function () {
console.log($translate);
if ($translate.langKey == 'ru') {
if(_isRussian) {
$translate.use('en');
} else {
_isRussian = false;
}
else {
$translate.use('ru');
_isRussian = true;
}
$translate.$nextLang;
};
}
}]);

app.controller('GameController',
Expand Down
8 changes: 4 additions & 4 deletions app/templates/win.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@
</div>
<br>
<div class="alert alert-info">
<h1 class="h1-navigation">Этот снимок сделан при помощи
EzSensor от VATECH</h1>
<h1 class="h1-navigation">{{'WIN_MESSAGE'|translate}}</h1>
</div>
<h2 class="text-center nav " style="color: white;">Пожалуйста, заполните форму и получите подарок</h2>
<h2 class="text-center nav " style="color: white;">{{'ACTION_MESSAGE'|translate}}</h2>
<br>

<div class="row">
Expand All @@ -22,7 +21,8 @@ <h2 class="text-center nav " style="color: white;">Пожалуйста, зап
</div>

<div class="col-md-6">
<button class="btn btn-default btn-lg btn-block" ng-click="redirect()" style="height: 100%">Click to try again</button>
<button class="btn btn-default btn-lg btn-block" ng-click="redirect()" style="height: 100%">Click to try again
</button>
</div>
</div>
</div>

0 comments on commit fc3b8bc

Please sign in to comment.