Expand i18n coverage

This commit is contained in:
ZacharyZcR
2026-05-23 15:18:40 +08:00
parent 9ed6cc95b6
commit 73cbe803c4
79 changed files with 2540 additions and 621 deletions
+6 -6
View File
@@ -110,7 +110,7 @@ func (p *RsyncPlugin) doRsyncAuth(ctx context.Context, info *common.HostInfo, cr
return &AuthResult{
Success: false,
ErrorType: ErrorTypeNetwork,
Error: fmt.Errorf("无法连接到Rsync服务"),
Error: fmt.Errorf("%s", i18n.GetText("rsync_connect_failed")),
}
}
modules := p.getModules(conn, session.Config)
@@ -120,7 +120,7 @@ func (p *RsyncPlugin) doRsyncAuth(ctx context.Context, info *common.HostInfo, cr
return &AuthResult{
Success: false,
ErrorType: ErrorTypeUnknown,
Error: fmt.Errorf("无法获取模块列表"),
Error: fmt.Errorf("%s", i18n.GetText("rsync_modules_failed")),
}
}
@@ -215,7 +215,7 @@ func (p *RsyncPlugin) testUnauthorizedAccess(ctx context.Context, info *common.H
modules := p.getModules(conn, session.Config)
if len(modules) > 0 {
banner := fmt.Sprintf("未授权访问 - 可用模块: %s", strings.Join(modules, ", "))
banner := i18n.Tr("rsync_unauth_modules", strings.Join(modules, ", "))
return &ScanResult{
Success: true,
Type: plugins.ResultTypeService,
@@ -328,7 +328,7 @@ func (p *RsyncPlugin) identifyService(ctx context.Context, info *common.HostInfo
return &ScanResult{
Success: false,
Service: "rsync",
Error: fmt.Errorf("无法连接到Rsync服务"),
Error: fmt.Errorf("%s", i18n.GetText("rsync_connect_failed")),
}
}
defer func() { _ = conn.Close() }()
@@ -363,12 +363,12 @@ func (p *RsyncPlugin) identifyService(ctx context.Context, info *common.HostInfo
lines := strings.Split(responseStr, "\n")
for _, line := range lines {
if strings.HasPrefix(line, "@RSYNCD:") {
banner = fmt.Sprintf("Rsync服务 (%s)", strings.TrimSpace(line))
banner = i18n.Tr("rsync_service_info", strings.TrimSpace(line))
break
}
}
if banner == "" {
banner = "Rsync文件同步服务"
banner = i18n.GetText("rsync_file_sync_service")
}
} else {
return &ScanResult{