R-516: the formal forms in Go literals move into the bundle in the te-form
gates / gates (push) Successful in 50s
gates / gates (push) Successful in 50s
22 Go-literal messages (escrow handler, share password page, export upload, network-storage uid/remove/attach failures) are bundle keys with te-form Hungarian and English; a detached attach failure renders in the reader's language. The NAS refusal says „Válassz". Setup wizard, recovery-info.txt (R-554) and the SMART/fill-watch wire texts are left. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
@@ -3,7 +3,6 @@ package web
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"sort"
|
||||
"strings"
|
||||
@@ -35,8 +34,8 @@ const (
|
||||
// validMappedID reports whether id is a valid container uid/gid (F4 range check).
|
||||
func validMappedID(id int) bool { return id >= mappedIDMin && id <= mappedIDMax }
|
||||
|
||||
// netAddUIDRangeMsg is the friendly F4 refusal for an out-of-range mapped uid/gid.
|
||||
const netAddUIDRangeMsg = "Az alkalmazás felhasználói azonosítója (uid) érvénytelen. Adjon meg 1 és 65533 közötti értéket — a legtöbb médiaalkalmazás az 1000-est használja."
|
||||
// netAddUIDRangeKey is the friendly F4 refusal for an out-of-range mapped uid/gid (bundle key, R-516).
|
||||
const netAddUIDRangeKey = "api.netstorage.uid_range"
|
||||
|
||||
// netAddOutdatedMsg is the sync add-time refusal (machine code "agent_outdated") when the agent
|
||||
// predates the coupled verify-before-commit add semantics (pre-v0.81.0).
|
||||
@@ -130,7 +129,7 @@ func (s *Server) handleNetStorageAdd(w http.ResponseWriter, r *http.Request) {
|
||||
// here with a friendly Hungarian 400 — nothing is installed.
|
||||
if !validMappedID(uid) || !validMappedID(gid) {
|
||||
logx.Debugf(s.logger, "[web] netstorage add %q refused by validation: uid/gid out of range (uid=%d gid=%d)", name, uid, gid)
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, netAddUIDRangeMsg, nil)
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, s.msg(r, netAddUIDRangeKey), nil)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -179,7 +178,7 @@ func (s *Server) handleNetStorageAddStatus(w http.ResponseWriter, r *http.Reques
|
||||
}
|
||||
writeDiskJSON(w, http.StatusOK, true, "", map[string]any{
|
||||
"phase": job.Phase, "name": job.Name, "category": job.Category,
|
||||
"message": job.Message, "detail": trimNetDetail(job.Detail), "warn": job.Warn,
|
||||
"message": s.netAddJobMessage(r, job), "detail": trimNetDetail(job.Detail), "warn": job.Warn,
|
||||
"path": job.Path, "started_at": job.StartedAt, "updated_at": job.UpdatedAt,
|
||||
})
|
||||
}
|
||||
@@ -306,9 +305,7 @@ func (s *Server) handleNetStorageRemove(w http.ResponseWriter, r *http.Request)
|
||||
// files deleted anyway → an unreapable autofs mount until host reboot — the C6B-F2 orphan).
|
||||
if apps := s.deployedAppsOnPath(where); len(apps) > 0 {
|
||||
s.logger.Printf("[WARN] [web] netstorage remove %q refused: deployed app(s) on the share: %s", name, strings.Join(apps, ", "))
|
||||
writeDiskJSON(w, http.StatusConflict, false, fmt.Sprintf(
|
||||
"A tároló nem távolítható el, amíg alkalmazás használja: %s. Előbb távolítsa el vagy költöztesse át az alkalmazást.",
|
||||
strings.Join(apps, ", ")), nil)
|
||||
writeDiskJSON(w, http.StatusConflict, false, s.msg(r, "api.netstorage.remove_in_use", strings.Join(apps, ", ")), nil)
|
||||
return
|
||||
}
|
||||
agent, err := s.netAgentForAdd()
|
||||
|
||||
Reference in New Issue
Block a user