-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
115 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* ! | ||
* Tencent is pleased to support the open source community by making Tencent Server Web available. | ||
* Copyright (C) 2018 THL A29 Limited, a Tencent company. All rights reserved. | ||
* Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at | ||
* http://opensource.org/licenses/MIT | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. | ||
*/ | ||
|
||
const i18n = require('i18n'); | ||
const fs = require('fs'); | ||
const config = require('config'); | ||
const language = config.language || 'cn'; | ||
const forder = __dirname + '/../../../locales'; | ||
|
||
const getSupportLang = function() { | ||
const langList = (fs.readdirSync(forder) || []).map(function(item) { | ||
return (item.split('.'))[0]; | ||
}); | ||
return langList; | ||
}; | ||
|
||
i18n.configure({ | ||
locales: getSupportLang(), | ||
defaultLocale: 'cn', | ||
extension: '.json', | ||
objectNotation: true, | ||
directory: forder, | ||
register: this | ||
}); | ||
|
||
i18n.setLocale(language); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"mail": { | ||
"errorStack": "错误堆栈", | ||
"memoryExceedingWaring": " 内存超限告警", | ||
"memoryExceedingTips": "内存超限,服务已重启,请开发人员关注是否存在内存泄露。", | ||
"singleCoreCpu": "单核CPU", | ||
"CPUUsageRate": "CPU使用率", | ||
"UsageRateGreaterThan80%": "使用率超过80%", | ||
"fiveSecondsCpuProfiler": "最近5秒钟CPU Profiler见附件", | ||
"processSnapshot": "进程快照", | ||
"IPAggregationNotice": "IP聚集自动拉黑周知", | ||
"IPAggregationWarning": "IP聚集告警", | ||
"viewDocsForIPAggregation": "IP聚集相关信息,详情请参阅文档", | ||
"serverIP": "服务器IP", | ||
"maliciousIP": "恶意IP", | ||
"autoIntoBlackList":"自动拉黑", | ||
"IPAggregationDegree":"IP聚集度", | ||
"warningThreshold":"告警阈值", | ||
"normalValue": "正常值", | ||
"testingTimeConsuming":"检测耗时", | ||
"evidenceList": "证据列表", | ||
"yes": "是", | ||
"no": "否" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"mail": { | ||
"errorStack": "Error stack", | ||
"memoryExceedingWaring": "Memory exceeding waring", | ||
"memoryExceedingContent": "Memory exceeding,the server has been restarted,please pay attention to whether the memory is leaked", | ||
"singleCoreCpu": "Mononuclear CPU", | ||
"CPUUsageRate": "CPU usage rate", | ||
"UsageRateGreaterThan80%": "usage rate of over 80 per cent", | ||
"fiveSecondsCpuProfiler": "you can view the last 5 seconds CPU Profiler in attachment", | ||
"processSnapshot": "Process snapshot", | ||
"IPAggregationNotice": "Notice:Auto pull aggregated IP into blackList", | ||
"IPAggregationWarning": "IP aggregation warning", | ||
"viewDocsForIPAggregation": "You can view the documents to get related information and detail of IP aggregation", | ||
"serverIP": "Server IP", | ||
"maliciousIP": "Malicious IP", | ||
"autoIntoBlackList":"Auto pull aggregated IP into blackList", | ||
"IPAggregationDegree":"Degree of IP aggregation", | ||
"warningThreshold":"Threshold of warning", | ||
"normalValue": "Normal value", | ||
"testingTimeConsuming":"Time consuming for testing", | ||
"evidenceList": "Evidence list", | ||
"yes": "yes", | ||
"no": "no" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters