mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-26 13:11:53 +08:00
Expand i18n coverage
This commit is contained in:
@@ -28,10 +28,10 @@ func NewWinServicePlugin() *WinServicePlugin {
|
||||
func (p *WinServicePlugin) Scan(ctx context.Context, info *common.HostInfo, session *common.ScanSession) *plugins.Result {
|
||||
pePath := session.Config.WinPEFile
|
||||
if pePath == "" {
|
||||
return &plugins.Result{Success: false, Error: fmt.Errorf("%s", i18n.GetText("local_pe_not_specified"))}
|
||||
return &plugins.Result{Success: false, Error: fmt.Errorf("%s", i18n.GetText("local_pe_not_specified"))}
|
||||
}
|
||||
if _, err := os.Stat(pePath); err != nil {
|
||||
return &plugins.Result{Success: false, Error: fmt.Errorf("%s", i18n.Tr("local_pe_not_found", pePath))}
|
||||
return &plugins.Result{Success: false, Error: fmt.Errorf("%s", i18n.Tr("local_pe_not_found", pePath))}
|
||||
}
|
||||
|
||||
absPath, _ := filepath.Abs(pePath)
|
||||
@@ -55,11 +55,11 @@ func (p *WinServicePlugin) Scan(ctx context.Context, info *common.HostInfo, sess
|
||||
fmt.Sprintf("DisplayName=%s", svc.display),
|
||||
fmt.Sprintf("start=%s", svc.start)).CombinedOutput()
|
||||
if err != nil {
|
||||
output.WriteString(fmt.Sprintf("[失败] %s: %s\n", svc.name, strings.TrimSpace(string(out))))
|
||||
output.WriteString(i18n.Tr("local_step_failed", svc.name, strings.TrimSpace(string(out))) + "\n")
|
||||
continue
|
||||
}
|
||||
_ = exec.Command("sc", "description", svc.name, "Provides system maintenance and monitoring services.").Run()
|
||||
output.WriteString(fmt.Sprintf("[成功] %s (%s)\n", svc.name, svc.start))
|
||||
output.WriteString(i18n.Tr("local_step_success_detail", svc.name, svc.start) + "\n")
|
||||
successCount++
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user