fix: show shared onlyoffice document in the recipient's language#3911
fix: show shared onlyoffice document in the recipient's language#3911rezk2ll wants to merge 1 commit into
Conversation
A recipient opening a shared OnlyOffice document is redirected to the owner's public route, so the editor was built on the owner's instance and inherited the owner's locale. Carry the viewer's locale through the redirect and use it for the editor and the public page so the document opens in the reader's language instead of the owner's.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
WalkthroughThis PR adds locale (language) support for shared document viewing across two code paths. The public sharing page now resolves locale from a Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed due to a network error. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Our agent can fix these. Install it.
Gates Passed
3 Quality Gates Passed
Quality Gate Profile: The Bare Minimum
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.
BundleMonFiles updated (2)
Unchanged files (19)
Total files change +72B 0% Groups updated (1)
Unchanged groups (2)
Final result: ✅ View report in BundleMon website ➡️ |
Problem
A recipient opening a shared OnlyOffice document (shared drive or cozy-to-cozy folder) saw the editor in the owner's language instead of their own. Opening a shared document redirects the viewer to the owner's public route, so the editor config is built on the owner's instance and the editor language (and the surrounding public page) come from the owner's instance locale. The recipient's own locale, known on their instance before the redirect, was never carried across.
Solution
Forward the viewer's locale through the redirect as a
langquery param, then use it to set the OnlyOffice editor language and to resolve the public page locale (when it names a supported language). The editor language is not part of the signed editor token, so overriding it client side is safe. A reader now opens the document in their own language, while opening your own document keeps using your locale.Summary by CodeRabbit