diff --git a/agent/i18n/i18n.go b/agent/i18n/i18n.go index cb0153c11..22bc0990a 100644 --- a/agent/i18n/i18n.go +++ b/agent/i18n/i18n.go @@ -70,6 +70,16 @@ func GetMsgByKey(key string) string { return content } +func Get(key string) string { + content, _ := global.I18n.Localize(&i18n.LocalizeConfig{ + MessageID: key, + }) + if content != "" { + return content + } + return key +} + func GetWithName(key string, name string) string { var ( dataMap = make(map[string]interface{}) diff --git a/agent/i18n/lang/en.yaml b/agent/i18n/lang/en.yaml index 83522769b..405639841 100644 --- a/agent/i18n/lang/en.yaml +++ b/agent/i18n/lang/en.yaml @@ -197,6 +197,43 @@ ErrGroupInUse: "The IP group is used by the black/white list and cannot be delet ErrGroupExist: "IP group name already exists" ErrIPRange: "Wrong IP range" ErrIPExist: "IP is exit" +urlDefense: 'URL Rules' +urlHelper: 'Forbidden Access URLs' +dirFilter: 'Directory Filtering' +xss: 'XSS' +phpExec: 'PHP Script Execution' +oneWordTrojan: 'One-Liner Trojan' +appFilter: 'Application Dangerous Directory Filtering' +webshell: 'Webshell' +args: 'Parameter Rules' +protocolFilter: 'Protocol Filtering' +javaFileter: 'Java Dangerous File Filtering' +scannerFilter: 'Scanner Filtering' +escapeFilter: 'Escape Filtering' +customRule: 'Custom Rules' +httpMethod: 'HTTP Method Filtering' +fileExt: 'File Upload Restrictions' +defaultIpBlack: 'Malicious IP Group' +cookie: 'Cookie Rules' +urlBlack: 'URL Blacklist' +uaBlack: 'User-Agent Blacklist' +attackCount: 'Attack Frequency Limit' +fileExtCheck: 'File Upload Restrictions' +geoRestrict: 'Geographical Access Restrictions' +unknownWebsite: 'Unauthorized Domain Access' +notFoundLimit: '404 Frequency Limit' +headerDefense: 'Header Rules' +defaultUaBlack: 'User-Agent Rules' +methodWhite: 'HTTP Rules' +captcha: 'Captcha' +fiveSeconds: '5 Seconds Verification' +vulnCheck: 'Supplementary Rules' +acl: 'Custom Rules' +sql: 'SQL Injection' +cc: 'Access Frequency Limit' +defaultUrlBlack: 'URL Rules' +sqlInject: 'SQL Injection' + #license ErrLicense: "License format error, please check and try again!" diff --git a/agent/i18n/lang/zh-Hant.yaml b/agent/i18n/lang/zh-Hant.yaml index 07dcefbda..e22b1547d 100644 --- a/agent/i18n/lang/zh-Hant.yaml +++ b/agent/i18n/lang/zh-Hant.yaml @@ -198,6 +198,42 @@ ErrGroupInUse: "IP 群組被黑/白名單使用,無法刪除" ErrGroupExist: "IP 群組名稱已存在" ErrIPRange: "IP 範圍錯誤" ErrIPExist: "IP 已存在" +urlDefense: 'URL 規則' +urlHelper: '禁止訪問的 URL' +dirFilter: '目錄過濾' +xss: 'XSS' +phpExec: 'PHP 腳本執行' +oneWordTrojan: '一句話木馬' +appFilter: '應用危險目錄過濾' +webshell: 'Webshell' +args: '參數規則' +protocolFilter: '協議過濾' +javaFileter: 'Java 危險檔案過濾' +scannerFilter: '掃描器過濾' +escapeFilter: '轉義過濾' +customRule: '自定義規則' +httpMethod: 'HTTP 方法過濾' +fileExt: '檔案上傳限制' +defaultIpBlack: '惡意 IP 組' +cookie: 'Cookie 規則' +urlBlack: 'URL 黑名單' +uaBlack: 'User-Agent 黑名單' +attackCount: '攻擊頻率限制' +fileExtCheck: '檔案上傳限制' +geoRestrict: '地區訪問限制' +unknownWebsite: '未授權域名訪問' +notFoundLimit: '404 頻率限制' +headerDefense: 'Header 規則' +defaultUaBlack: 'User-Agent 規則' +methodWhite: 'HTTP 規則' +captcha: '人機驗證' +fiveSeconds: '5 秒驗證' +vulnCheck: '補充規則' +acl: '自定義規則' +sql: 'SQL 注入' +cc: '訪問頻率限制' +defaultUrlBlack: 'URL 規則' +sqlInject: 'SQL 注入' #license diff --git a/agent/i18n/lang/zh.yaml b/agent/i18n/lang/zh.yaml index 412fb19be..29674e043 100644 --- a/agent/i18n/lang/zh.yaml +++ b/agent/i18n/lang/zh.yaml @@ -199,6 +199,43 @@ ErrGroupInUse: "IP 组被黑/白名单使用,无法删除" ErrGroupExist: "IP 组名称已存在" ErrIPRange: "IP 范围错误" ErrIPExist: "IP 已存在" +urlDefense: 'URL 规则' +urlHelper: '禁止访问的 URL' +dirFilter: '目录过滤' +xss: 'XSS' +phpExec: 'PHP 脚本执行' +oneWordTrojan: '一句话木马' +appFilter: '应用危险目录过滤' +webshell: 'Webshell' +args: '参数规则' +protocolFilter: '协议过滤' +javaFileter: 'Java 危险文件过滤' +scannerFilter: '扫描器过滤' +escapeFilter: '转义过滤' +customRule: '自定义规则' +httpMethod: 'HTTP 方法过滤' +fileExt: '文件上传限制' +defaultIpBlack: '恶意 IP 组' +cookie: 'Cookie 规则' +urlBlack: 'URL 黑名单' +uaBlack: 'User-Agent 黑名单' +attackCount: '攻击频率限制' +fileExtCheck: '文件上传限制' +geoRestrict: '地区访问限制' +unknownWebsite: '未授权域名访问' +notFoundLimit: '404 频率限制' +headerDefense: 'Header 规则' +defaultUaBlack: 'User-Agent 规则' +methodWhite: 'HTTP 规则' +captcha: '人机验证' +fiveSeconds: '5 秒验证' +vulnCheck: '补充规则' +acl: '自定义规则' +sql: 'SQL 注入' +cc: '访问频率限制' +defaultUrlBlack: 'URL 规则' +sqlInject: 'SQL 注入' + #license ErrLicense: "许可证格式错误,请检查后重试!"