refactor code
This commit is contained in:
parent
46ea17055f
commit
2b0e844656
|
@ -4,10 +4,6 @@
|
||||||
"Error": "错误",
|
"Error": "错误",
|
||||||
"OK": "确定",
|
"OK": "确定",
|
||||||
"Cancel": "取消",
|
"Cancel": "取消",
|
||||||
"True": "是",
|
|
||||||
"true": "是",
|
|
||||||
"False": "否",
|
|
||||||
"false": "否",
|
|
||||||
"New": "新建",
|
"New": "新建",
|
||||||
"Start": "开始下载任务",
|
"Start": "开始下载任务",
|
||||||
"Pause": "暂停下载任务",
|
"Pause": "暂停下载任务",
|
||||||
|
@ -105,20 +101,6 @@
|
||||||
"Disabled": "禁用",
|
"Disabled": "禁用",
|
||||||
"Changes to the settings take effect after refreshing page.": "设置将在页面刷新后生效.",
|
"Changes to the settings take effect after refreshing page.": "设置将在页面刷新后生效.",
|
||||||
"Type is illegal!": "类型错误!",
|
"Type is illegal!": "类型错误!",
|
||||||
"none": "无",
|
|
||||||
"http": "Http",
|
|
||||||
"https": "Https",
|
|
||||||
"ftp": "Ftp",
|
|
||||||
"mem": "仅内存",
|
|
||||||
"plain": "明文",
|
|
||||||
"arc4": "ARC4",
|
|
||||||
"binary": "二进制",
|
|
||||||
"ascii": "ASCII",
|
|
||||||
"debug": "调试 (Debug)",
|
|
||||||
"info": "普通 (Info)",
|
|
||||||
"notice": "一般 (Notice)",
|
|
||||||
"warn": "警告 (Warn)",
|
|
||||||
"error": "错误 (Error)",
|
|
||||||
"format": {
|
"format": {
|
||||||
"time.millisecond": "{{value}} 毫秒",
|
"time.millisecond": "{{value}} 毫秒",
|
||||||
"time.milliseconds": "{{value}} 毫秒",
|
"time.milliseconds": "{{value}} 毫秒",
|
||||||
|
@ -138,6 +120,25 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"options": {
|
"options": {
|
||||||
|
"true": "是",
|
||||||
|
"false": "否",
|
||||||
|
"default": "默认",
|
||||||
|
"none": "无",
|
||||||
|
"hide": "隐藏",
|
||||||
|
"full": "完整",
|
||||||
|
"http": "Http",
|
||||||
|
"https": "Https",
|
||||||
|
"ftp": "Ftp",
|
||||||
|
"mem": "仅内存",
|
||||||
|
"plain": "明文",
|
||||||
|
"arc4": "ARC4",
|
||||||
|
"binary": "二进制",
|
||||||
|
"ascii": "ASCII",
|
||||||
|
"debug": "调试 (Debug)",
|
||||||
|
"info": "普通 (Info)",
|
||||||
|
"notice": "一般 (Notice)",
|
||||||
|
"warn": "警告 (Warn)",
|
||||||
|
"error": "错误 (Error)",
|
||||||
"dir.name": "下载路径",
|
"dir.name": "下载路径",
|
||||||
"dir.description": "",
|
"dir.description": "",
|
||||||
"log.name": "日志文件",
|
"log.name": "日志文件",
|
||||||
|
@ -174,7 +175,7 @@
|
||||||
"no-proxy.name": "不使用代理服务器列表",
|
"no-proxy.name": "不使用代理服务器列表",
|
||||||
"no-proxy.description": "设置不使用代理服务器的主机名, 域名, 包含或不包含子网掩码的网络地址, 多个使用逗号分隔.",
|
"no-proxy.description": "设置不使用代理服务器的主机名, 域名, 包含或不包含子网掩码的网络地址, 多个使用逗号分隔.",
|
||||||
"proxy-method.name": "代理服务器请求方法",
|
"proxy-method.name": "代理服务器请求方法",
|
||||||
"proxy-method.description": "设置用来请求代理服务器的方法. 方法可设置为 get 或 tunnel. HTTPS 下载将忽略此选项并总是使用 tunnel.",
|
"proxy-method.description": "设置用来请求代理服务器的方法. 方法可设置为 GET 或 TUNNEL. HTTPS 下载将忽略此选项并总是使用 TUNNEL.",
|
||||||
"remote-time.name": "获取服务器文件时间",
|
"remote-time.name": "获取服务器文件时间",
|
||||||
"remote-time.description": "从 HTTP/FTP 服务获取远程文件的时间戳, 如果可用将设置到本地文件",
|
"remote-time.description": "从 HTTP/FTP 服务获取远程文件的时间戳, 如果可用将设置到本地文件",
|
||||||
"reuse-uri.name": "URI 复用",
|
"reuse-uri.name": "URI 复用",
|
|
@ -11,8 +11,8 @@
|
||||||
prefix: 'langs/',
|
prefix: 'langs/',
|
||||||
suffix: '.json'
|
suffix: '.json'
|
||||||
}).useLoaderCache(true)
|
}).useLoaderCache(true)
|
||||||
.preferredLanguage('en-US')
|
.preferredLanguage('en')
|
||||||
.fallbackLanguage('en-US')
|
.fallbackLanguage('en')
|
||||||
.useSanitizeValueStrategy('escape');
|
.useSanitizeValueStrategy('escape');
|
||||||
}]);
|
}]);
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
optionStorageKey: 'Options',
|
optionStorageKey: 'Options',
|
||||||
lazySaveTimeout: 500
|
lazySaveTimeout: 500
|
||||||
}).constant('ariaNgDefaultOptions', {
|
}).constant('ariaNgDefaultOptions', {
|
||||||
language: 'en-US',
|
language: 'en',
|
||||||
rpcHost: '',
|
rpcHost: '',
|
||||||
rpcPort: '6800',
|
rpcPort: '6800',
|
||||||
protocol: 'http',
|
protocol: 'http',
|
||||||
|
|
|
@ -2,16 +2,12 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('ariaNg').config(['$translateProvider', function ($translateProvider) {
|
angular.module('ariaNg').config(['$translateProvider', function ($translateProvider) {
|
||||||
$translateProvider.translations('en-US', {
|
$translateProvider.translations('en', {
|
||||||
'English': 'English',
|
'English': 'English',
|
||||||
'Operation Succeeded': 'Operation Succeeded',
|
'Operation Succeeded': 'Operation Succeeded',
|
||||||
'Error': 'Error',
|
'Error': 'Error',
|
||||||
'OK': 'OK',
|
'OK': 'OK',
|
||||||
'Cancel': 'Cancel',
|
'Cancel': 'Cancel',
|
||||||
'True': 'True',
|
|
||||||
'true': 'True',
|
|
||||||
'False': 'False',
|
|
||||||
'false': 'False',
|
|
||||||
'New': 'New',
|
'New': 'New',
|
||||||
'Start': 'Start',
|
'Start': 'Start',
|
||||||
'Pause': 'Pause',
|
'Pause': 'Pause',
|
||||||
|
@ -109,20 +105,6 @@
|
||||||
'Disabled': 'Disabled',
|
'Disabled': 'Disabled',
|
||||||
'Changes to the settings take effect after refreshing page.': 'Changes to the settings take effect after refreshing page.',
|
'Changes to the settings take effect after refreshing page.': 'Changes to the settings take effect after refreshing page.',
|
||||||
'Type is illegal!': 'Type is illegal!',
|
'Type is illegal!': 'Type is illegal!',
|
||||||
'none': 'None',
|
|
||||||
'http': 'Http',
|
|
||||||
'https': 'Https',
|
|
||||||
'ftp': 'Ftp',
|
|
||||||
'mem': 'Memory Only',
|
|
||||||
'plain': 'Plain',
|
|
||||||
'arc4': 'ARC4',
|
|
||||||
'binary': 'Binary',
|
|
||||||
'ascii': 'ASCII',
|
|
||||||
'debug': 'Debug',
|
|
||||||
'info': 'Info',
|
|
||||||
'notice': 'Notice',
|
|
||||||
'warn': 'Warn',
|
|
||||||
'error': 'Error',
|
|
||||||
'format': {
|
'format': {
|
||||||
'time.millisecond': '{{value}} Millisecond',
|
'time.millisecond': '{{value}} Millisecond',
|
||||||
'time.milliseconds': '{{value}} Milliseconds',
|
'time.milliseconds': '{{value}} Milliseconds',
|
||||||
|
@ -142,6 +124,44 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'options': {
|
'options': {
|
||||||
|
'true': 'True',
|
||||||
|
'false': 'False',
|
||||||
|
'default': 'Default',
|
||||||
|
'none': 'None',
|
||||||
|
'hide': 'Hide',
|
||||||
|
'full': 'Full',
|
||||||
|
'http': 'Http',
|
||||||
|
'https': 'Https',
|
||||||
|
'ftp': 'Ftp',
|
||||||
|
'mem': 'Memory Only',
|
||||||
|
'get': 'GET',
|
||||||
|
'tunnel': 'TUNNEL',
|
||||||
|
'plain': 'Plain',
|
||||||
|
'arc4': 'ARC4',
|
||||||
|
'binary': 'Binary',
|
||||||
|
'ascii': 'ASCII',
|
||||||
|
'debug': 'Debug',
|
||||||
|
'info': 'Info',
|
||||||
|
'notice': 'Notice',
|
||||||
|
'warn': 'Warn',
|
||||||
|
'error': 'Error',
|
||||||
|
'adaptive': 'adaptive',
|
||||||
|
'epoll': 'epoll',
|
||||||
|
'falloc': 'falloc',
|
||||||
|
'feedback': 'feedback',
|
||||||
|
'geom': 'geom',
|
||||||
|
'inorder': 'inorder',
|
||||||
|
'kqueue': 'kqueue',
|
||||||
|
'poll': 'poll',
|
||||||
|
'port': 'port',
|
||||||
|
'prealloc': 'prealloc',
|
||||||
|
'random': 'random',
|
||||||
|
'select': 'select',
|
||||||
|
'trunc': 'trunc',
|
||||||
|
'SSLv3': 'SSLv3',
|
||||||
|
'TLSv1': 'TLSv1',
|
||||||
|
'TLSv1.1': 'TLSv1.1',
|
||||||
|
'TLSv1.2': 'TLSv1.2',
|
||||||
'dir.name': 'Download Path',
|
'dir.name': 'Download Path',
|
||||||
'dir.description': '',
|
'dir.description': '',
|
||||||
'log.name': 'Log File',
|
'log.name': 'Log File',
|
||||||
|
@ -179,7 +199,7 @@
|
||||||
'no-proxy.name': 'No Proxy List',
|
'no-proxy.name': 'No Proxy List',
|
||||||
'no-proxy.description': 'Specify a comma separated list of host names, domains and network addresses with or without a subnet mask where no proxy should be used.',
|
'no-proxy.description': 'Specify a comma separated list of host names, domains and network addresses with or without a subnet mask where no proxy should be used.',
|
||||||
'proxy-method.name': 'Proxy Method',
|
'proxy-method.name': 'Proxy Method',
|
||||||
'proxy-method.description': 'Set the method to use in proxy request. METHOD is either get or tunnel. HTTPS downloads always use tunnel regardless of this option.',
|
'proxy-method.description': 'Set the method to use in proxy request. METHOD is either GET or TUNNEL. HTTPS downloads always use TUNNEL regardless of this option.',
|
||||||
'remote-time.name': 'Remote File Timestamp',
|
'remote-time.name': 'Remote File Timestamp',
|
||||||
'remote-time.description': 'Retrieve timestamp of the remote file from the remote HTTP/FTP server and if it is available, apply it to the local file.',
|
'remote-time.description': 'Retrieve timestamp of the remote file from the remote HTTP/FTP server and if it is available, apply it to the local file.',
|
||||||
'reuse-uri.name': 'Reuse Uri',
|
'reuse-uri.name': 'Reuse Uri',
|
||||||
|
|
|
@ -2,10 +2,10 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('ariaNg').constant('ariaNgLanguages', {
|
angular.module('ariaNg').constant('ariaNgLanguages', {
|
||||||
'en-US': {
|
'en': {
|
||||||
name: 'English'
|
name: 'English'
|
||||||
},
|
},
|
||||||
'zh-CN': {
|
'zh_CN': {
|
||||||
name: 'Simplified Chinese'
|
name: 'Simplified Chinese'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -68,6 +68,23 @@
|
||||||
descriptionKey: 'options.' + key + '.description'
|
descriptionKey: 'options.' + key + '.description'
|
||||||
}, option);
|
}, option);
|
||||||
|
|
||||||
|
if (option.type == 'boolean') {
|
||||||
|
option.options = ['true', 'false'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (option.options) {
|
||||||
|
var availableOptions = [];
|
||||||
|
|
||||||
|
for (var j = 0; j < option.options.length; j++) {
|
||||||
|
availableOptions.push({
|
||||||
|
name: 'options.' + option.options[j],
|
||||||
|
value: option.options[j]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
option.options = availableOptions;
|
||||||
|
}
|
||||||
|
|
||||||
options.push(option);
|
options.push(option);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,22 +25,11 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group" ng-if="option.type == 'boolean'" ng-class="[optionStatus.getStatusFeedbackStyle()]">
|
<div class="form-group" ng-if="option.type == 'boolean' || option.type == 'option'" ng-class="[optionStatus.getStatusFeedbackStyle()]">
|
||||||
<div class="has-feedback">
|
|
||||||
<select class="form-control" style="width: 100%;" ng-disabled="!!option.readonly" ng-model="optionValue" ng-change="changeValue(optionValue, false)">
|
|
||||||
<option value="true" translate>True</option>
|
|
||||||
<option value="false" translate>False</option>
|
|
||||||
</select>
|
|
||||||
<div class="form-control-icon" ng-if="optionStatus.isShowStatusIcon()">
|
|
||||||
<span class="fa form-control-feedback" ng-class="[optionStatus.getStatusIcon()]"></span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group" ng-if="option.type == 'option'" ng-class="[optionStatus.getStatusFeedbackStyle()]">
|
|
||||||
<div class="has-feedback">
|
<div class="has-feedback">
|
||||||
<select class="form-control" style="width: 100%;" ng-disabled="!!option.readonly"
|
<select class="form-control" style="width: 100%;" ng-disabled="!!option.readonly"
|
||||||
ng-model="optionValue" ng-change="changeValue(optionValue, false)"
|
ng-model="optionValue" ng-change="changeValue(optionValue, false)"
|
||||||
ng-options="(value | translate) for value in option.options">
|
ng-options="value.value as (value.name | translate) for value in option.options">
|
||||||
</select>
|
</select>
|
||||||
<div class="form-control-icon" ng-if="optionStatus.isShowStatusIcon()">
|
<div class="form-control-icon" ng-if="optionStatus.isShowStatusIcon()">
|
||||||
<span class="fa form-control-feedback" ng-class="[optionStatus.getStatusIcon()]"></span>
|
<span class="fa form-control-feedback" ng-class="[optionStatus.getStatusIcon()]"></span>
|
||||||
|
|
Reference in a new issue