mirror of
https://github.com/RuoJi6/ARTEX.git
synced 2026-12-04 12:41:50 +08:00
feat: add English interface localization and fix preview crashes
This commit is contained in:
1 parent
a05a886d3d
commit
9ccaa81497
163 files changed
+17100
-6944
No files matched your search
@@ -0,0 +1,19 @@
|
||||
package server
|
||||
|
||||
import "net/http"
|
||||
|
||||
// productMessage keeps the original detail alongside a stable translation key.
|
||||
type productMessage struct {
|
||||
Code string `json:"code"`
|
||||
Params map[string]any `json:"params,omitempty"`
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
// Preserve error for existing clients and add stable fields for localized UIs.
|
||||
func writeProductError(w http.ResponseWriter, status int, code, message string, params map[string]any) {
|
||||
payload := map[string]any{"error": message, "code": code}
|
||||
if len(params) > 0 {
|
||||
payload["params"] = params
|
||||
}
|
||||
writeJSON(w, status, payload)
|
||||
}
|
||||
Reference in new issue
Block a user