From 3fde423abc9c7d92452112796e3a208014178153 Mon Sep 17 00:00:00 2001 From: Roman Perekhod Date: Tue, 25 Jul 2023 15:13:12 +0200 Subject: [PATCH] [full-ci] update reva to include #4078 --- ...ix-onlyoffice-default-document-language.md | 6 +++++ go.mod | 2 +- go.sum | 4 +-- .../reva/v2/pkg/app/provider/wopi/wopi.go | 25 ++++++++++++++++--- vendor/modules.txt | 2 +- 5 files changed, 32 insertions(+), 7 deletions(-) create mode 100644 changelog/unreleased/fix-onlyoffice-default-document-language.md diff --git a/changelog/unreleased/fix-onlyoffice-default-document-language.md b/changelog/unreleased/fix-onlyoffice-default-document-language.md new file mode 100644 index 00000000000..8ae3104270a --- /dev/null +++ b/changelog/unreleased/fix-onlyoffice-default-document-language.md @@ -0,0 +1,6 @@ +Bugfix: fix the default document language for OnlyOffice + +Fix the default document language for OnlyOffice + +https://github.com/owncloud/ocis/pull/6878 +https://github.com/owncloud/enterprise/issues/5807 diff --git a/go.mod b/go.mod index f70d4cb0bb4..dd7028b507f 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/coreos/go-oidc v2.2.1+incompatible github.com/coreos/go-oidc/v3 v3.6.0 github.com/cs3org/go-cs3apis v0.0.0-20230516150832-730ac860c71d - github.com/cs3org/reva/v2 v2.15.1-0.20230724142905-f4507ac94bd4 + github.com/cs3org/reva/v2 v2.15.1-0.20230725125905-676d4e05f1b7 github.com/disintegration/imaging v1.6.2 github.com/dutchcoders/go-clamd v0.0.0-20170520113014-b970184f4d9e github.com/egirna/icap-client v0.1.1 diff --git a/go.sum b/go.sum index 1bf75b7a229..ba3afbc555d 100644 --- a/go.sum +++ b/go.sum @@ -625,8 +625,8 @@ github.com/crewjam/httperr v0.2.0 h1:b2BfXR8U3AlIHwNeFFvZ+BV1LFvKLlzMjzaTnZMybNo github.com/crewjam/httperr v0.2.0/go.mod h1:Jlz+Sg/XqBQhyMjdDiC+GNNRzZTD7x39Gu3pglZ5oH4= github.com/crewjam/saml v0.4.13 h1:TYHggH/hwP7eArqiXSJUvtOPNzQDyQ7vwmwEqlFWhMc= github.com/crewjam/saml v0.4.13/go.mod h1:igEejV+fihTIlHXYP8zOec3V5A8y3lws5bQBFsTm4gA= -github.com/cs3org/reva/v2 v2.15.1-0.20230724142905-f4507ac94bd4 h1:4o6B4JibypM0phV/GI7CcIvVvIP+hF6CSkjvJ91CYJk= -github.com/cs3org/reva/v2 v2.15.1-0.20230724142905-f4507ac94bd4/go.mod h1:4z5EQghS2LhSWZWocH51Dw9VAs16No1zSFvFgQtgS7w= +github.com/cs3org/reva/v2 v2.15.1-0.20230725125905-676d4e05f1b7 h1:+G17hDLzyv3tVht0UdrvWwsxiFE8MaJ09QaQvxhXRdE= +github.com/cs3org/reva/v2 v2.15.1-0.20230725125905-676d4e05f1b7/go.mod h1:4z5EQghS2LhSWZWocH51Dw9VAs16No1zSFvFgQtgS7w= github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8 h1:Z9lwXumT5ACSmJ7WGnFl+OMLLjpz5uR2fyz7dC255FI= github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8/go.mod h1:4abs/jPXcmJzYoYGF91JF9Uq9s/KL5n1jvFDix8KcqY= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= diff --git a/vendor/github.com/cs3org/reva/v2/pkg/app/provider/wopi/wopi.go b/vendor/github.com/cs3org/reva/v2/pkg/app/provider/wopi/wopi.go index 11744154eca..c2a57311eb6 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/app/provider/wopi/wopi.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/app/provider/wopi/wopi.go @@ -254,9 +254,9 @@ func (p *wopiProvider) GetAppURL(ctx context.Context, resource *provider.Resourc urlQuery := url.Query() if language != "" { - urlQuery.Set("ui", language) // OnlyOffice - urlQuery.Set("lang", language) // Collabora - urlQuery.Set("UI_LLCC", language) // Office365 + urlQuery.Set("ui", language) // OnlyOffice + urlQuery.Set("lang", covertLangTag(language)) // Collabora, Impact on the default document language of OnlyOffice + urlQuery.Set("UI_LLCC", language) // Office365 } if p.conf.AppDisableChat { urlQuery.Set("dchat", "1") // OnlyOffice disable chat @@ -470,3 +470,22 @@ func getEtherpadExtensions(appURL string) map[string]map[string]string { } return appURLs } + +// TODO Find better solution +// This conversion was made because no other way to set the default document language to OnlyOffice was found. +func covertLangTag(lang string) string { + switch lang { + case "cs": + return "cs-CZ" + case "de": + return "de-DE" + case "es": + return "es-ES" + case "fr": + return "fr-FR" + case "it": + return "it-IT" + default: + return "en" + } +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 5e7b0860d48..e9204496141 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -352,7 +352,7 @@ github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1 github.com/cs3org/go-cs3apis/cs3/storage/registry/v1beta1 github.com/cs3org/go-cs3apis/cs3/tx/v1beta1 github.com/cs3org/go-cs3apis/cs3/types/v1beta1 -# github.com/cs3org/reva/v2 v2.15.1-0.20230724142905-f4507ac94bd4 +# github.com/cs3org/reva/v2 v2.15.1-0.20230725125905-676d4e05f1b7 ## explicit; go 1.20 github.com/cs3org/reva/v2/cmd/revad/internal/grace github.com/cs3org/reva/v2/cmd/revad/runtime