refactor code
This commit is contained in:
parent
92bf8352d0
commit
f12965dd6b
|
@ -242,6 +242,7 @@
|
||||||
<script src="scripts/filters/substring.js"></script>
|
<script src="scripts/filters/substring.js"></script>
|
||||||
<script src="scripts/filters/taskOrderBy.js"></script>
|
<script src="scripts/filters/taskOrderBy.js"></script>
|
||||||
<script src="scripts/filters/volumn.js"></script>
|
<script src="scripts/filters/volumn.js"></script>
|
||||||
|
<script src="scripts/langs/config.js"></script>
|
||||||
<script src="scripts/langs/en-US.js"></script>
|
<script src="scripts/langs/en-US.js"></script>
|
||||||
<script src="scripts/langs/zh-CN.js"></script>
|
<script src="scripts/langs/zh-CN.js"></script>
|
||||||
<script src="scripts/services/aria2HttpRpcService.js"></script>
|
<script src="scripts/services/aria2HttpRpcService.js"></script>
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
(function () {
|
(function () {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('ariaNg').controller('AriaNgSettingsController', ['$scope', 'SweetAlert', 'ariaNgSettingService', function ($scope, SweetAlert, ariaNgSettingService) {
|
angular.module('ariaNg').controller('AriaNgSettingsController', ['$scope', 'ariaNgLanguages', 'ariaNgSettingService', function ($scope, ariaNgLanguages, ariaNgSettingService) {
|
||||||
|
$scope.languages = ariaNgLanguages;
|
||||||
$scope.settings = ariaNgSettingService.getAllOptions();
|
$scope.settings = ariaNgSettingService.getAllOptions();
|
||||||
$scope.settingService = ariaNgSettingService;
|
$scope.settingService = ariaNgSettingService;
|
||||||
}]);
|
}]);
|
||||||
|
|
12
app/scripts/langs/config.js
Normal file
12
app/scripts/langs/config.js
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
(function () {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
angular.module('ariaNg').constant('ariaNgLanguages', {
|
||||||
|
'en-US': {
|
||||||
|
name: 'English'
|
||||||
|
},
|
||||||
|
'zh-CN': {
|
||||||
|
name: 'Simplified Chinese'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})();
|
|
@ -5,9 +5,9 @@
|
||||||
<span translate>Language</span>
|
<span translate>Language</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="setting-value col-sm-8">
|
<div class="setting-value col-sm-8">
|
||||||
<select class="form-control" style="width: 100%;" ng-model="settings.language" ng-change="settingService.setLanguage(settings.language)">
|
<select class="form-control" style="width: 100%;" ng-model="settings.language"
|
||||||
<option value="en-US" translate translate-language="en-US">English</option>
|
ng-options="type as (language.name | translate) for (type, language) in languages"
|
||||||
<option value="zh-CN" translate translate-language="zh-CN">Simplified Chinese</option>
|
ng-change="settingService.setLanguage(settings.language)">
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Reference in a new issue