Skip to content

fix: pass language to Collabora file conversions - #5973

Open
xhon-pelushi wants to merge 1 commit into
nextcloud:mainfrom
xhon-pelushi:fix/5165-conversion-lang
Open

fix: pass language to Collabora file conversions#5973
xhon-pelushi wants to merge 1 commit into
nextcloud:mainfrom
xhon-pelushi:fix/5165-conversion-lang

Conversation

@xhon-pelushi

Copy link
Copy Markdown
Contributor

Summary

  • Pass the current user locale to Collabora file conversions as a BCP 47 lang parameter.
  • Send conversion options as separate multipart fields (not merged into the file part).
  • Add focused PHPUnit coverage for language + multipart option payload.

Fixes #5165

Test plan

  • Save-as PDF (or other conversion) with a non-English locale and confirm locale-sensitive formatting uses the right language.
  • composer run test:unit for the new conversion tests when PHP tooling is available.

Fixes nextcloud#5165

Signed-off-by: xhon-pelushi <xhon@pelushi.com>
@xhon-pelushi
xhon-pelushi force-pushed the fix/5165-conversion-lang branch from 1e7d66e to 767e2da Compare August 14, 2026 03:48
@github-actions

Copy link
Copy Markdown
Contributor

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

@elzody

elzody commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Thank you for working on this @xhon-pelushi. That you want to work on the richdocuments app means a lot. <3

I do have some feedback that I think is worth considering:

In src/helpers/index.js there is a function called languageToBCP47() that translates the language setting given by Nextcloud into a BCP 47 tag that Collabora can correctly handle. Given that, to fix the problem this PR tries to solve, this logic would likely need to be duplicated in PHP since the /convert-to endpoint's lang field also takes the same BCP 47 language tags. I think it would make more sense to move the logic for that to the PHP side and then serve it to the front-end as an initial state, so the logic only lives in one place.

That said, I have not totally tested this PR yet, but given that it works as intended I am happy to merge it in the meantime and we can create a separate issue for refactoring that bit. But if you want to already take the opportunity to take care of that, that's also fine.

Will give it a proper test soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Language Parameter Not Provided To Collabora Conversion API

2 participants