mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-28 19:01:57 +08:00
fix(wopi): cannot set preferred language for LibreOffice online
This commit is contained in:
@@ -59,6 +59,7 @@ const (
|
|||||||
|
|
||||||
wopiSrcPlaceholder = "WOPI_SOURCE"
|
wopiSrcPlaceholder = "WOPI_SOURCE"
|
||||||
wopiSrcParamDefault = "WOPISrc"
|
wopiSrcParamDefault = "WOPISrc"
|
||||||
|
languageParamDefault = "lang"
|
||||||
sessionExpiresPadding = 10
|
sessionExpiresPadding = 10
|
||||||
wopiHeaderPrefix = "X-WOPI-"
|
wopiHeaderPrefix = "X-WOPI-"
|
||||||
)
|
)
|
||||||
@@ -214,6 +215,9 @@ func generateActionUrl(src string, fileSrc string) (*url.URL, error) {
|
|||||||
queryReplaced.Set(wopiSrcParamDefault, fileSrc)
|
queryReplaced.Set(wopiSrcParamDefault, fileSrc)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// LibreOffice require this flag to show correct language
|
||||||
|
queryReplaced.Set(languageParamDefault, "lng")
|
||||||
|
|
||||||
actionUrl.RawQuery = queryReplaced.Encode()
|
actionUrl.RawQuery = queryReplaced.Encode()
|
||||||
return actionUrl, nil
|
return actionUrl, nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user