-
Notifications
You must be signed in to change notification settings - Fork 6
/
translate.js
132 lines (128 loc) · 7.3 KB
/
translate.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/**
* Created by lihui on 15-2-26.
*/
module.exports = function (mock2easy, preferredLanguage) {
var languages = {
'en': {
'DELETE': 'Delete',
'ADD': 'Add',
'APPLY':'Apply',
'OPTIONAL': 'Optional',
'REQUIRED': 'Required',
'RECORD': 'Record',
'ERROR-ALREADY-EXISTS': 'Interface already exists',
'PARAMETERS': 'Parameters',
'SUCCESS': 'Success',
'IMPORT': 'Import',
'OPERATING': 'Operation',
'VARIATION-LAW': 'Variation-law',
'TYPE': 'Type',
'SUBMIT': 'Submit',
'CANCEL': 'Cancle',
'MAIN-LIST-CHANGE': 'Change the interface path',
'MAIN-LIST-TITLE': 'Interface list',
'MAIN-LIST-Filter': 'Input filter interface',
'MAIN-LIST-DELAY': 'Delay time',
'MAIN-LIST-DELAY-EXPLANATION': 'Simulate the situation which the interface is executing very slowly in extreme environment',
'MAIN-LIST-OPERATING': 'Operating',
'MAIN-ADD-TITLE': 'Add new interface',
'MAIN-ADD-TITLE-EXPLANATION': 'The path of the interfaces cannot be duplicated. The interface entered has to start with ‘/’ and end with {{interfaceSuffix}}',
'MAIN-ADD-EXPLANATION': ' The interface format is incorrect',
'MAIN-RECORD-TITLE': 'Interface recording',
'MAIN-RECORD-TITLE-EXPLANATION': 'Recording interface has to confirm you system support Curl and it is able to record the returning results though accessing',
'MAIN-RECORD-URL-EXPLANATION': 'Url of the request',
'MAIN-ERROR-LOG-TITLE': 'Error log',
'MAIN-ERROR-LOG-TITLE-EXPLANATION': 'Verify the difference between request and interface document:blue stands for invalid request type, eg. Misuse POST for GET. Yellow means your code need to be updated, your interface document is not the latest, please update you interface document. Red means when your code send the request, the parameters do not fulfill the rules defined in the current interface document. ',
'DETAIL-TITLE': 'Interface details',
'DETAIL-URL': 'Interface request address',
'DETAIL-URL-NEW': 'New interface request address',
'DETAIL-LAZY-LOAD': 'Whether to be lasy-loading or not',
'DETAIL-TYPE': 'Interface type',
'DETAIL-JSONP': 'Offer support for jsonp or not',
'DETAIL-REMARK': 'Remark',
'DETAIL-REQUEST-PARAMETERS': 'Request parameters',
'DETAIL-PARAMETERS-NAME': 'Parameters name',
'DETAIL-RETURN-DYNAMIC-INTERFACE': 'Return dynamic interface',
'DETAIL-RETURN-STATIC-INTERFACE': ' Return static interface',
'DETAIL-RETURN-INTERFACE': 'Return interface',
'DETAIL-FILL-OUT': 'Fill out interface',
'DETAIL-MOCKJS-DEMO': 'See Mockjs demo',
'DETAIL-IMPORT-TITLE': 'Import returning json data',
'DETAIL-IMPORT-INPUT': 'Import new json datam, the previous json data will be replaced',
'DETAIL-IMPORT-ERROR': 'Invalid json format',
'MAIN-DELETE-CONTENT':'Are you sure you want to delete?',
'SERVER-ERROR-LOG': 'Request interface => {{url}} not created',
'SERVER-MENU-TITLE': '### Interface document index\n|sequence number |interface request address|interface description |\n| -------- | -------- |-------- | \n',
'SERVER-CURL-LOG': 'Curl command',
'SERVER-PARAMETER-TITLE': '#### Request parameters\n|sequence number |parameter names |if required |description |\n| -------- | -------- |-------- |-------- | \n',
'SERVER-MEDTH-ERROR': 'Invalid request type error ',
'SERVER-ERROR-PARAMETER-1': 'Request parameters[{{parameters}}]are required',
'SERVER-ERROR-PARAMETER-2': 'Missing definition in the ducoment for[{{parameters}}]as request parameters',
'SERVER-WARN': ' Interface warning',
'SERVER-WARN-TEXT': 'Request type error, please verify ',
'GITBOOK-UNINSTALL': 'You have not installed Gitbook',
'GITBOOK-UNINSTALL-CONTENT': 'GitBook can be installed from NPM using:<code>$ npm install gitbook-cli -g</code>'
},
'cn': {
'DELETE': '删除',
'ADD': '添加',
'APPLY':'应用',
'OPTIONAL': '选填',
'REQUIRED': '必填',
'RECORD': '录制',
'ERROR-ALREADY-EXISTS': '接口已经存在',
'PARAMETERS': '参数',
'SUCCESS': '操作成功',
'IMPORT': '导入',
'OPERATING': '操作',
'VARIATION-LAW': '变量规律',
'TYPE': '类型',
'SUBMIT': '提交',
'CANCEL': '取消',
'MAIN-LIST-CHANGE': '更改接口路径',
'MAIN-LIST-TITLE': '接口列表',
'MAIN-LIST-Filter': '输入内容筛选接口',
'MAIN-LIST-DELAY': '延时',
'MAIN-LIST-DELAY-EXPLANATION': '模拟极端环境中,接口调用缓慢的情况',
'MAIN-LIST-OPERATING': '操作',
'MAIN-ADD-TITLE': '添加新接口',
'MAIN-ADD-TITLE-EXPLANATION': '接口路径不能重复,输入的接口必须为/开始且{{interfaceSuffix}}结尾',
'MAIN-ADD-EXPLANATION': '接口格式不正确',
'MAIN-RECORD-TITLE': '接口录制',
'MAIN-RECORD-TITLE-EXPLANATION': '录制接口必须保证你的电脑支持Curl,可以通过访问将返回的结果记录下来',
'MAIN-RECORD-URL-EXPLANATION': '请求的url地址',
'MAIN-ERROR-LOG-TITLE': '错误日志',
'MAIN-ERROR-LOG-TITLE-EXPLANATION': '验证代码请求和接口文档之间的差异:蓝色代表请求方式不正确,eg. POST 用成了 GET。黄色代表你的代码有更新,你的接口文档没有及时更新,请及时更新你的接口文档。 红色表示你的代码发出请求的时候,参数不满足当时的接口文档的约定。',
'MAIN-DELETE-CONTENT':'你确认要删除?',
'DETAIL-TITLE': '接口详情',
'DETAIL-URL': '接口请求地址',
'DETAIL-URL-NEW': '新接口请求地址',
'DETAIL-LAZY-LOAD': '是否需要延时加载',
'DETAIL-TYPE': '接口类型',
'DETAIL-JSONP': '是否提供Jsonp服务',
'DETAIL-REMARK': '备注',
'DETAIL-REQUEST-PARAMETERS': '请求参数',
'DETAIL-PARAMETERS-NAME': '变量名',
'DETAIL-RETURN-DYNAMIC-INTERFACE': '返回动态接口',
'DETAIL-RETURN-STATIC-INTERFACE': '返回静态接口',
'DETAIL-RETURN-INTERFACE': '返回接口',
'DETAIL-FILL-OUT': '填写接口',
'DETAIL-MOCKJS-DEMO': '查看Mockjs例子',
'DETAIL-IMPORT-TITLE': '导入返回JSON数据',
'DETAIL-IMPORT-INPUT': '导入新的JSON数据,之前的JSON数据将会被覆盖...',
'DETAIL-IMPORT-ERROR': 'json格式不正确',
'SERVER-ERROR-LOG': '请求接口 => {{url}} 未创建',
'SERVER-MENU-TITLE': '### 接口文档目录\n|序号 |接口请求地址 |接口说明 |\n| -------- | -------- |-------- | \n',
'SERVER-CURL-LOG': 'Curl命令',
'SERVER-PARAMETER-TITLE': '#### 请求参数\n|序号 |参数名 |是否必填 |说明 |\n| -------- | -------- |-------- |-------- | \n',
'SERVER-MEDTH-ERROR': '请求类型异常请确认',
'SERVER-ERROR-PARAMETER-1': '请求参数[{{parameters}}]应该为必填项',
'SERVER-ERROR-PARAMETER-2': '接口文档缺少[{{parameters}}]做为请求参数',
'SERVER-WARN': '接口警告',
'SERVER-WARN-TEXT': '请求类型异常请确认',
'GITBOOK-UNINSTALL': '没有安装Gitbook',
'GITBOOK-UNINSTALL-CONTENT': '你可以用:<code>$ npm install gitbook-cli -g</code>命令安装Gitbook'
}
}
return languages[preferredLanguage] || languages['cn'];
}