# DeepL Integration removes text to be translated

**URL:** <https://forum.collaboraonline.com/t/deepl-integration-removes-text-to-be-translated/3341>\
**Category:** Installation & Configuration\
**Created:** [January 22, 2025, 9:03pm UTC](https://forum.collaboraonline.com/t/deepl-integration-removes-text-to-be-translated/3341 "2025-01-22T21:03:06Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![iamdoubz](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.collaboraonline.com/iamdoubz/32/1522_2.png) [@iamdoubz](https://forum.collaboraonline.com/u/iamdoubz)\
**Post date:** [January 22, 2025, 9:03pm UTC](https://forum.collaboraonline.com/t/deepl-integration-removes-text-to-be-translated/3341/1 "2025-01-22T21:03:06Z")

</div>

# Environment

- Ubuntu 22.04
- nginx 1.27.3 (GeoIP2, Brotli, H3, debug: see links below)
- Nextcloud 29.0.11
- Collabora [Docker 24.04.11.3.1](https://hub.docker.com/layers/collabora/code/24.04.11.3.1/images/sha256-5b602590855689646782cb009f64c3fd4228c6123d3f51c57ec1511110e8e5cb)

# Links

> **[GitHub - iamdoubz/nginx-custom: Custom build configs for freenginx/nginx Ubuntu...](https://github.com/iamdoubz/nginx-custom)**
>
> Custom build configs for freenginx/nginx Ubuntu 22.04

I want to use DeepL in Collabora. Looks like a great tool to have. I want to use the free account. I added these lines to my `coolwsd.xml`:

```xml
    <deepl desc="DeepL API settings for translation service">
        <enabled desc="If true, shows translate option as a menu entry in the compact view and as an icon in the tabbed view." type="bool" default="false">true</enabled>
        <api_url desc="URL for the API" type="string" default="">https://api-free.deepl.com</api_url>
        <auth_key desc="Auth Key generated by your account" type="string" default="">redacted:fx</auth_key>
    </deepl>

```

The translate option now appears. However, after selecting the text I want to translate e.g. to German, the highlighted text gets deleted and no text appears in its place.

I have checked the docker logs, and nothing seems relevant to the DeepL api calls, and there is nothing in either the access or error logs for nginx.

Does anyone have a DeepL with Collabora working configuration?

Can anyone help me diagnose why this is happening?

I appreciate your help in advance 🙂.

---

<div class="post-metadata">

**Author:** ![darshan](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.collaboraonline.com/darshan/32/2230_2.png) [@darshan](https://forum.collaboraonline.com/u/darshan)\
**Post date:** [January 23, 2025, 7:01am UTC](https://forum.collaboraonline.com/t/deepl-integration-removes-text-to-be-translated/3341/2 "2025-01-23T07:01:59Z")

</div>

Hello @iamdoubz Welcome to collabora online forum

I did some research on our platform, and it seems to be working fine here. Can you please verify the custom Nginx settings you’re using? There might be an issue with the response you’re getting. Also, check the response code and review the values received at the API end to ensure they match the expected text for translation.

For reference, you can check out this document and try translating some text:  
[https://staging-perf.eu.collaboraonline.com/nextcloud/index.php/s/6jyHzwBE7F7PTmK?dir=/&openfile=true](https://staging-perf.eu.collaboraonline.com/nextcloud/index.php/s/6jyHzwBE7F7PTmK?dir=/&openfile=true). It works well here.

### Version Info

- **COOLWSD version:** 24.04.12.1 (git hash: db66104fd1 (E))
- **LOKit version:** Collabora Office 24.04.12.1 (git hash: 1768680)
- **Served by:** openSUSE Leap 15.5
- **Server ID:** 9c1efca5
- **WOPI host:** Nextcloud 31.0.0.11 - richdocuments 8.6.0-beta.1

Thanks  
Darshan

---

<div class="post-metadata">

**Author:** ![darshan](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.collaboraonline.com/darshan/32/2230_2.png) [@darshan](https://forum.collaboraonline.com/u/darshan)\
**Post date:** [January 23, 2025, 12:46pm UTC](https://forum.collaboraonline.com/t/deepl-integration-removes-text-to-be-translated/3341/3 "2025-01-23T12:46:42Z")

</div>



---

<div class="post-metadata">

**Author:** ![darshan](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.collaboraonline.com/darshan/32/2230_2.png) [@darshan](https://forum.collaboraonline.com/u/darshan)\
**Post date:** [January 24, 2025, 5:29am UTC](https://forum.collaboraonline.com/t/deepl-integration-removes-text-to-be-translated/3341/4 "2025-01-24T05:29:13Z")

</div>



---

<div class="post-metadata">

**Author:** ![darshan](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.collaboraonline.com/darshan/32/2230_2.png) [@darshan](https://forum.collaboraonline.com/u/darshan)\
**Post date:** [January 24, 2025, 5:31am UTC](https://forum.collaboraonline.com/t/deepl-integration-removes-text-to-be-translated/3341/5 "2025-01-24T05:31:05Z")

</div>

Response from @iamdoubz

> I have two subdomains, one for Nextcloud and the other for Collabora. e.g. cloud.my.domain and office.my.domain. For the office domain, everything is “wide open” meaning there are no nginx specific limits such as Content-Security-Policy or Permissions-Policy. There are, however, such limits in the cloud domain.
> 
> **Do I need to add the [https://api-free.deepl.com](https://api-free.deepl.com/) into my cloud nginx config?**
> 
> > Also, check the response code and review the values received at the API end to ensure they match the expected text for translation.
> 
> When I check the DeepL website for how many words I’ve translated, it reads 0. Which would lead me to the conclusion that the call isn’t being made to their servers. I went ahead and manually ran the API just to make sure it “works” in Postman and it indeed made the call and returned text.
> 
> Where can I go to see the POST calls to DeepL in Collabora?

---

<div class="post-metadata">

**Author:** ![darshan](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.collaboraonline.com/darshan/32/2230_2.png) [@darshan](https://forum.collaboraonline.com/u/darshan)\
**Post date:** [January 24, 2025, 6:22am UTC](https://forum.collaboraonline.com/t/deepl-integration-removes-text-to-be-translated/3341/6 "2025-01-24T06:22:55Z")

</div>

If your Nextcloud instance (`cloud.my.domain`) is making requests to the DeepL API (e.g., for translations or related features), you may need to add `https://api-free.deepl.com` to your Nextcloud domain’s `Content-Security-Policy` (CSP) configuration. This is required because the browser will block any cross-origin requests not explicitly allowed by the CSP.

---

<div class="post-metadata">

**Author:** ![iamdoubz](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.collaboraonline.com/iamdoubz/32/1522_2.png) [@iamdoubz](https://forum.collaboraonline.com/u/iamdoubz)\
**Post date:** [January 27, 2025, 5:11pm UTC](https://forum.collaboraonline.com/t/deepl-integration-removes-text-to-be-translated/3341/7 "2025-01-27T17:11:10Z")

</div>

I added the URL into Nextcloud’s CSP under script and connect, but no change in behavior. Any chance you can find your either apache or nginx config for your test Nextcloud instance and share?

---

<div class="post-metadata">

**Author:** ![darshan](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.collaboraonline.com/darshan/32/2230_2.png) [@darshan](https://forum.collaboraonline.com/u/darshan)\
**Post date:** [January 27, 2025, 5:25pm UTC](https://forum.collaboraonline.com/t/deepl-integration-removes-text-to-be-translated/3341/8 "2025-01-27T17:25:05Z")

</div>

Here are the instructions that might be helpful. Could you kindly review them ?

> **[Proxy settings — SDK https://sdk.collaboraonline.com/ documentation](https://sdk.collaboraonline.com/docs/installation/Proxy_settings.html)**
>
> Collabora Online Proxy settings: reverse proxy (Apache or Nginx), load balancing (HAProxy or Nginx)

---

<div class="post-metadata">

**Author:** ![iamdoubz](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.collaboraonline.com/iamdoubz/32/1522_2.png) [@iamdoubz](https://forum.collaboraonline.com/u/iamdoubz)\
**Post date:** [January 27, 2025, 5:29pm UTC](https://forum.collaboraonline.com/t/deepl-integration-removes-text-to-be-translated/3341/9 "2025-01-27T17:29:55Z")

</div>

I did an exact copy of this. I did not add any additional “extras” from what was explained here. So as far as the Collabora url, it is “wide open”. Everything works in Nextcloud and using Collabora to edit/create documents. The only thing that doesn’t work is the DeepL piece. I know it is probably super simple… just haven’t quite figured it out yet.

---

<div class="post-metadata">

**Author:** ![darshan](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.collaboraonline.com/darshan/32/2230_2.png) [@darshan](https://forum.collaboraonline.com/u/darshan)\
**Post date:** [February 11, 2025, 10:04am UTC](https://forum.collaboraonline.com/t/deepl-integration-removes-text-to-be-translated/3341/10 "2025-02-11T10:04:56Z")

</div>


