ipadm: translate to English, fix help alignment
- All ipadm-internal messages (usage, prompts, errors) are now English - Usage text is built programmatically from a (left, desc) row list with computed column width instead of hand-aligned spaces, so it can't drift out of alignment again when rows are added/changed - README's literal usage block updated to match; rest of the repo docs stay German
This commit is contained in:
@@ -25,7 +25,7 @@ func renderPortForwards(hosts []Host, fwds []PortForward, wanIface string) (cont
|
||||
for _, f := range sorted {
|
||||
ip, ok := ipByHost[strings.ToLower(f.Host)]
|
||||
if !ok {
|
||||
warnings = append(warnings, fmt.Sprintf("Port-Forward %d/%s -> %q übersprungen: Host nicht (mehr) in der ipadm-Datenbank", f.WanPort, f.Proto, f.Host))
|
||||
warnings = append(warnings, fmt.Sprintf("port-forward %d/%s -> %q skipped: host no longer in the ipadm database", f.WanPort, f.Proto, f.Host))
|
||||
continue
|
||||
}
|
||||
switch f.Proto {
|
||||
@@ -58,14 +58,14 @@ func applyPortForwards(path string, content string) error {
|
||||
backup = b
|
||||
hadFile = true
|
||||
} else if !os.IsNotExist(err) {
|
||||
return fmt.Errorf("kann bestehende %s nicht lesen: %w", path, err)
|
||||
return fmt.Errorf("cannot read existing %s: %w", path, err)
|
||||
}
|
||||
|
||||
if err := os.MkdirAll(dirOf(path), 0755); err != nil {
|
||||
return fmt.Errorf("kann Verzeichnis für %s nicht anlegen: %w", path, err)
|
||||
return fmt.Errorf("cannot create directory for %s: %w", path, err)
|
||||
}
|
||||
if err := os.WriteFile(path, []byte(content), 0644); err != nil {
|
||||
return fmt.Errorf("kann %s nicht schreiben: %w", path, err)
|
||||
return fmt.Errorf("cannot write %s: %w", path, err)
|
||||
}
|
||||
|
||||
if err := runNftTest(); err != nil {
|
||||
@@ -74,11 +74,11 @@ func applyPortForwards(path string, content string) error {
|
||||
} else {
|
||||
os.Remove(path)
|
||||
}
|
||||
return fmt.Errorf("nftables-Konfiguration ungültig, Änderung zurückgerollt: %w", err)
|
||||
return fmt.Errorf("nftables config invalid, change rolled back: %w", err)
|
||||
}
|
||||
|
||||
if err := reloadNftables(); err != nil {
|
||||
return fmt.Errorf("%s geschrieben, aber Reload fehlgeschlagen: %w", path, err)
|
||||
return fmt.Errorf("%s written, but reload failed: %w", path, err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user