fix (language): wopi language - #845

According to the UI default language, the UI language of collabora/code must be explicitly specified within the URL( &lang=pt-BR ); otherwise, the UI language will always default to English (en).
This commit is contained in:
badguy001 2025-06-18 08:04:45 +08:00 committed by GitHub
parent 609fc607c2
commit 1cda6505ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -282,6 +282,9 @@ func wopiDiscovery(ctx *App, fullpath string) (string, error) {
p := u.Query() p := u.Query()
p.Set("WOPISrc", wopiSRC) p.Set("WOPISrc", wopiSRC)
p.Set("access_token", ctx.Authorization) p.Set("access_token", ctx.Authorization)
if len(ctx.Languages) > 0 {
p.Set("lang", ctx.Languages[0])
}
u.RawQuery = p.Encode() u.RawQuery = p.Encode()
if newHost := rewrite_url(); newHost != "" { if newHost := rewrite_url(); newHost != "" {
if p, err := url.Parse(newHost); err == nil { if p, err := url.Parse(newHost); err == nil {