store and use preferred language from user (#55)

This commit is contained in:
Athou
2013-05-11 22:49:33 +02:00
parent dab151ce37
commit ca47270db1
9 changed files with 79 additions and 16 deletions

View File

@@ -798,6 +798,15 @@ function($scope, $location, SettingsService, AnalyticsService) {
AnalyticsService.track();
$scope.languages = [ {
id : 'en',
label : 'English'
}, {
id : 'fr',
label : 'Français'
} ];
$scope.settingsService = SettingsService;
$scope.$watch('settingsService.settings', function(value) {
$scope.settings = angular.copy(value);
@@ -811,7 +820,7 @@ function($scope, $location, SettingsService, AnalyticsService) {
$scope.save = function() {
SettingsService.settings = $scope.settings;
SettingsService.save(function() {
$location.path('/');
window.location.href = window.location.href.substring(0, window.location.href.lastIndexOf('#'));
});
};
}]);

View File

@@ -19,6 +19,14 @@
<div class="tab-content">
<div class="tab-pane active" id="general">
<div class="form-horizontal">
<div class="control-group">
<label class="control-label">Language</label>
<div class="controls">
<select name="language" ng-model="settings.language" class="input-block-level"
ng-options="lang.id as lang.label for lang in languages" required>
</select>
</div>
</div>
<div class="control-group">
<label class="checkbox">
<input type="checkbox" name="showRead"