Resolve the page UI language once and let each ExApp fill its own Phrases.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-11 11:45:25 +02:00
co-authored by Cursor
parent afbd76445d
commit 623ada5f99
14 changed files with 1051 additions and 53 deletions
+8
View File
@@ -10,9 +10,12 @@ import (
)
// OCSClient performs AppAPI-authenticated OCS requests with format=json.
// Header is copied onto the outbound request after the AppAPI auth headers.
// The UI language read uses it to forward Accept-Language.
type OCSClient struct {
Cred Credentials
Client *http.Client
Header http.Header
}
func (c OCSClient) httpClient() *http.Client {
@@ -48,6 +51,11 @@ func (c OCSClient) Call(method, path string, body []byte) ([]byte, error) {
req.Header.Set(k, v)
}
}
for k, vs := range c.Header {
for _, v := range vs {
req.Header.Add(k, v)
}
}
res, err := c.httpClient().Do(req)
if err != nil {
return nil, err