# Translate button missing with libretranslate

**URL:** https://meta.discourse.org/t/translate-button-missing-with-libretranslate/229821
**Category:** Support
**Tags:** translation
**Created:** [June 13, 2022, 3:45pm UTC](https://meta.discourse.org/t/translate-button-missing-with-libretranslate/229821 "2022-06-13T15:45:25Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![henrylaxen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/henrylaxen/32/186719_2.png) [@henrylaxen](https://meta.discourse.org/u/henrylaxen)
#### Post date: [June 13, 2022, 3:45pm UTC](https://meta.discourse.org/t/translate-button-missing-with-libretranslate/229821/1 "2022-06-13T15:45:26Z")

</div>

Dear Discourse Group,  
First, to the authors of this project, my profound thanks and  
respect. Being a programmer myself I can appreicate the many hours  
that have gone into creating this project.

Over the last few days, I have installed discourse at:

[https://discourse.newcity.mx/](https://discourse.newcity.mx/)

and also added the translate plugin. Here is the relevant part of my  
app.yml file.

hooks:  
after\_code:  
- exec:  
cd: $home/plugins  
cmd:  
- git clone [GitHub - discourse/docker\_manager: Plugin for use with discourse docker image · GitHub](https://github.com/discourse/docker_manager.git)  
- git clone [GitHub - LibreTranslate/discourse-translator: Discourse translator with LibreTranslate support. · GitHub](https://github.com/LibreTranslate/discourse-translator)

First, the default locale of my discourse instance is set to English  
at [https://discourse.newcity.mx/admin/site\_settings/category/required](https://discourse.newcity.mx/admin/site_settings/category/required)

When I access the plugin/LibreTranslate tab of my admin screen, I check:  
Allow inline translation of posts.  
and set translater to LibreTranslate  
I am not sure what (if anything) I should put in the  
LibreTranslate API Endpoint field.

The plugin tab says that discourse-translator is enabled, the version  
is 0.4.0, there is a green checkmark, and a Y under the enabled  
column. So far all good, no?

However when I access a page, I don’t see any icon/option to do a  
translation. The leftmost icon at the bottom of the message is the  
“share a link to the post”.

I did install libretranslate following the instructions at:

[GitHub - LibreTranslate/LibreTranslate: Free and Open Source Machine Translation API. Self-hosted, offline capable and easy to setup. · GitHub](https://github.com/LibreTranslate/LibreTranslate)

which you can verify by going to [http://nadineloveshenry.com:5000/](http://nadineloveshenry.com:5000/)

I read:

> [@Translate plugin installed, but no translate button](https://meta.discourse.org/t/translate-plugin-installed-but-no-translate-button/161603):
>
> I’ve: Installed the plugin. Ticked “Allow inline translation of posts”. Followed the steps to get a Microsoft key. Selected Microsoft as my translator and added the key. Created a topic in a foreign language. But I don’t see any translation (globe) button next to the link button as depicted in the plugin instructions. I’ve also tried uninstalling and reinstalling the plugin. And this is the only plugin I’ve added now. Should I see that button no matter what? Should I test the Microsoft API…

Where I discovered “The translate button will only show if we detect  
that the language of the post is different from the current locale  
which that user has selected.”

So I removed English as firefox’s language and changed it to  
Espanol(MX), and connected to my site via a VPN through Spain just to  
make sure there was not trace of USA left. The request headers that  
were sent wre:

GET /t/welcome-to-new-city-discourse/7 HTTP/1.1  
Host: discourse.newcity.mx  
User-Agent: Mozilla/5.0 (X11; Linux x86\_64; rv:101.0) Gecko/20100101 Firefox/101.0  
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,_/_;q=0.8  
Accept-Language: es-MX,es;q=0.5  
Accept-Encoding: gzip, deflate, br

But still no joy.

Can anyone tell me what I am missing?

On another, and perhaps related note, when I run:

./launcher enter app

The response I get is:

x86\_64 arch detected.  
OCI runtime exec failed: exec failed: unable to start container process: open /dev/pts/1: operation not permitted: unknown

Thanks in advance for your help.  
Best wishes,  
Henry Laxen

---

<div class="post-metadata">

### Author: ![Benjamin\_D](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/benjamin_d/32/277831_2.png) [@Benjamin\_D](https://meta.discourse.org/u/Benjamin_D)
#### Post date: [June 13, 2022, 6:51pm UTC](https://meta.discourse.org/t/translate-button-missing-with-libretranslate/229821/2 "2022-06-13T18:51:00Z")

</div>

> [@henrylaxen](#):
>
> I am not sure what (if anything) I should put in the  
> LibreTranslate API Endpoint field

my guess would be `http://nadineloveshenry.com:5000/translate`  
as it seems to work:

 ![image](https://global.discourse-cdn.com/meta/original/4X/6/e/3/6e39cfc4a60c4ad2b86b47fa798f7da884c3e15e.png)

---

<div class="post-metadata">

### Author: ![henrylaxen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/henrylaxen/32/186719_2.png) [@henrylaxen](https://meta.discourse.org/u/henrylaxen)
#### Post date: [June 13, 2022, 7:55pm UTC](https://meta.discourse.org/t/translate-button-missing-with-libretranslate/229821/3 "2022-06-13T19:55:23Z")

</div>

Thanks Benjamin for the idea, but it doesn’t seen to work. I put  
[http://nadineloveshenry.com:5000/translate](http://nadineloveshenry.com:5000/translate)  
in the LibreTranslate API Endpoint field,

changed my firefox settings to German:

GET /t/test-libretranslate/17 HTTP/1.1  
Host: discourse.newcity.mx  
User-Agent: Mozilla/5.0 (X11; Linux x86\_64; rv:101.0) Gecko/20100101 Firefox/101.0  
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,_/_;q=0.8  
Accept-Language: de

But still no little world button appears. Are there any other ideas out there, or even a pointer as to how I can track this down. Does anyone have a working libretranslate discourse site working? Thanks again Benjamin.

---

<div class="post-metadata">

### Author: ![Benjamin\_D](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/benjamin_d/32/277831_2.png) [@Benjamin\_D](https://meta.discourse.org/u/Benjamin_D)
#### Post date: [June 13, 2022, 8:51pm UTC](https://meta.discourse.org/t/translate-button-missing-with-libretranslate/229821/4 "2022-06-13T20:51:52Z")

</div>

ha, my bad, the endpoint should be:  
`http://nadineloveshenry.com:5000`

> <https://github.com/LibreTranslate/discourse-translator/blob/c2067a2512ec942106ee81e57625d326ea334965/services/discourse_translator/libretranslate.rb#L47-L49>

Still don’t know if and how it works though 😅

---

<div class="post-metadata">

### Author: ![maiki](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/maiki/32/233950_2.png) [@maiki](https://meta.discourse.org/u/maiki)
#### Post date: [June 13, 2022, 9:43pm UTC](https://meta.discourse.org/t/translate-button-missing-with-libretranslate/229821/5 "2022-06-13T21:43:29Z")

</div>

Hi @henrylaxen. 👋

I don’t know how to fix your issue, but I wanted to point out were are potentially close to officially supporting LibreTranslate in our plugin, see [LibreTranslate provider support by pierotofy · Pull Request #36 · discourse/discourse-translator · GitHub](https://github.com/discourse/discourse-translator/pull/36) for what needs to be done. 🙂

---

<div class="post-metadata">

### Author: ![Benjamin\_D](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/benjamin_d/32/277831_2.png) [@Benjamin\_D](https://meta.discourse.org/u/Benjamin_D)
#### Post date: [June 13, 2022, 10:34pm UTC](https://meta.discourse.org/t/translate-button-missing-with-libretranslate/229821/6 "2022-06-13T22:34:26Z")

</div>

it seems there is something wrong here:

> <https://github.com/LibreTranslate/discourse-translator/blob/c2067a2512ec942106ee81e57625d326ea334965/services/discourse_translator/libretranslate.rb#L10>

Should be `SUPPORTED_LANG_MAPPING` I think (and thereafter)

> <https://github.com/discourse/discourse-translator/blob/d650f82221ff77c07cee6249a5e2a3693ccd2ba0/plugin.rb#L126>

---

<div class="post-metadata">

### Author: ![Benjamin\_D](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/benjamin_d/32/277831_2.png) [@Benjamin\_D](https://meta.discourse.org/u/Benjamin_D)
#### Post date: [June 13, 2022, 11:32pm UTC](https://meta.discourse.org/t/translate-button-missing-with-libretranslate/229821/7 "2022-06-13T23:32:05Z")

</div>

it also seems that the POST method is not allowed for the `/languages` url called here:

> <https://github.com/LibreTranslate/discourse-translator/blob/c2067a2512ec942106ee81e57625d326ea334965/services/discourse_translator/libretranslate.rb#L81>

it needs GET

---

<div class="post-metadata">

### Author: ![henrylaxen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/henrylaxen/32/186719_2.png) [@henrylaxen](https://meta.discourse.org/u/henrylaxen)
#### Post date: [June 14, 2022, 4:18am UTC](https://meta.discourse.org/t/translate-button-missing-with-libretranslate/229821/8 "2022-06-14T04:18:55Z")

</div>

Dear Benjamin, Maiki & co,  
Wow. Thanks so much for digging into this. Benjamin, I tried changing the endpoint to `http://nadineloveshenry.com:5000` but it had no effect. After reading the discussion for pull request 36, it sounds like it will be merged imminently, so I would rather wait a few days than try to use your branch at [GitHub - LibreTranslate/discourse-translator: Discourse translator with LibreTranslate support. · GitHub](http://github.com/LibreTranslate/discourse-translator), which I am not sure how to do. Please let me know if I can help you guys in any way.

I just noticed a new version is available, 2.9.0.beta5. I upgraded to it, and Now when I have translation enabled, by checking the box labelled

Allow inline translation of posts.

at the [https://discourse.newcity.mx/admin/site\_settings/category/plugins?filter=plugin%3Adiscourse-translator](https://discourse.newcity.mx/admin/site_settings/category/plugins?filter=plugin%3Adiscourse-translator) page,

when I go to [https://discourse.newcity.mx/t/test-libretranslate/17/2](https://discourse.newcity.mx/t/test-libretranslate/17/2)  
or in fact any page, I get an internal server error.

```plaintext

Request:
GET /t/test-libretranslate/17 HTTP/1.1
Host: discourse.newcity.mx
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:101.0) Gecko/20100101 Firefox/101.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Language: en-US
Accept-Encoding: gzip, deflate, br
DNT: 1
Connection: keep-alive
Cookie: _t=7TrnwomqGwDw359BMpi9EJo0cXFEYNpuysEJvGrkYwUG8D5zyJwVWd4iqKPmxUd2UUUG%2BH9hShgBeoCd7U51pJZg6CQYhKABm0AxQg0%2Bdqd9q1ODmRAPKp4INqAZHQuPZxWH9cObvpdaYaQFSbJiWRlfK0rRRgC%2FIqqgafn7w%2FAbTsO3N%2FmVLUIPj0t8PbJWDMYp1dDjevq4lpdNMYSViWbtHrFgXw89F5gTqgRjBBRdKRM81bwVFaUmqnHsPWgAWaeLapZxmrnfRqC%2F--HGGLHoE3sfXKcP7z--LfDlG3VIbZ0LSjwFoGl%2Bmw%3D%3D; _forum_session=NtilsRG2mkgUOmJGGgmGuCf4cGtxPHLLtE7sRkaRYP1gm6KA79fk6s6%2BBhYNTjoQz92x7pZljg9x1bGZYOTjuVDhzmeq5x7i7do7m3Iu4Z9jS6dSVGNJPaMi0p4uxHuqS4dfRLZ4JAODWZasTskcLq4gGXVUCOdybif89cg3dKNDyW3PAs%2Fp0D0uIRhWHJ49ws2uOQKbXVBvITyNdkKB7Ki%2BCTtLn8oCeTuq6rVxXcXuuaDh8jSz1CC3Cjw1I2jRVzm7ZVWdJMwRWCFbMb88AEGm2Mdh2Qx%2Fjwcexa6taXPuXR2LBuaUij5VmkRIzo0iRWya%2BJPVwhYR2jUJm9XR9cHKA6MUd87r%2FElyO9Aae7Vj0xP4ICt3KERZHUsidg%3D%3D--ZoSVywr0%2BfmX4s8w--E4TO4wELmgx%2BPdtHfufj2w%3D%3D; __profilin=p%3Dt%2Ca%3D6f2394e0167f915ab2fc46e5a6d45127%7C034d5170cc7d54c26ede324b2850a654
Upgrade-Insecure-Requests: 1
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: none
Sec-Fetch-User: ?1
Sec-GPC: 1
Pragma: no-cache
Cache-Control: no-cache

Response:
HTTP/1.1 500 Internal Server Error
Server: nginx/1.22.0
Date: Tue, 14 Jun 2022 04:08:05 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 658
Connection: keep-alive
X-Request-Id: d39e6252-1034-4e72-ae96-d20ebdb3a59e
Set-Cookie: __profilin=p%3Dt%2Ca%3D6f2394e0167f915ab2fc46e5a6d45127%7C034d5170cc7d54c26ede324b2850a654; path=/; secure; HttpOnly; SameSite=Lax
X-Runtime: 0.550344

```

So sorry for all the trouble. Again let me know if I can be helpful.

Best wishes,  
Henry Laxen

---

<div class="post-metadata">

### Author: ![maiki](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/maiki/32/233950_2.png) [@maiki](https://meta.discourse.org/u/maiki)
#### Post date: [June 14, 2022, 4:32am UTC](https://meta.discourse.org/t/translate-button-missing-with-libretranslate/229821/9 "2022-06-14T04:32:37Z")

</div>

> [@henrylaxen](#):
>
> After reading the discussion for pull request 36, it sounds like it will be merged imminently, so I would rather wait a few days

I would _not_ intepret that discussion to form that timeline; my reply was more to get more eyes to move along that issue, I’m not sure it LibreTranslate will be merged that quickly. 🙂

---

<div class="post-metadata">

### Author: ![Benjamin\_D](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/benjamin_d/32/277831_2.png) [@Benjamin\_D](https://meta.discourse.org/u/Benjamin_D)
#### Post date: [June 14, 2022, 4:43am UTC](https://meta.discourse.org/t/translate-button-missing-with-libretranslate/229821/10 "2022-06-14T04:43:54Z")

</div>

Hi Henry,  
yes the internal server error comes from the `SUPPORTED_LANG_MAPPING` problem,  
I’ve just mentioned it to author of the PR.

---

<div class="post-metadata">

### Author: ![henrylaxen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/henrylaxen/32/186719_2.png) [@henrylaxen](https://meta.discourse.org/u/henrylaxen)
#### Post date: [June 14, 2022, 1:28pm UTC](https://meta.discourse.org/t/translate-button-missing-with-libretranslate/229821/11 "2022-06-14T13:28:31Z")

</div>

Dear Maiki,  
I see. If I were to switch to your branch, do I just clone your repository, fix up app.yml, and rebuild, or is there more to it. I live in Tijuana, so running a discourse instance without English and Spanish is a game stopper for me. Thanks for the responses.

---

<div class="post-metadata">

### Author: ![argosopentech](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/argosopentech/32/336988_2.png) [@argosopentech](https://meta.discourse.org/u/argosopentech)
#### Post date: [October 31, 2023, 11:03pm UTC](https://meta.discourse.org/t/translate-button-missing-with-libretranslate/229821/12 "2023-10-31T23:03:53Z")

</div>

Here’s a list of public LibreTranslate mirrors:  
[https://github.com/LibreTranslate/LibreTranslate#mirrors](https://github.com/LibreTranslate/LibreTranslate#mirrors)

---

<div class="post-metadata">

### Author: ![sunjam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sunjam/32/175682_2.png) [@sunjam](https://meta.discourse.org/u/sunjam)
#### Post date: [November 3, 2023, 4:09am UTC](https://meta.discourse.org/t/translate-button-missing-with-libretranslate/229821/13 "2023-11-03T04:09:58Z")

</div>

> [@argosopentech](#):
>
> Here’s a list of public LibreTranslate mirrors:

Those are working fine. Unfortunately run into trouble with the arm64 image when testing at home, which seems to be an issue for the last few releases.

---

<div class="post-metadata">

### Author: ![argosopentech](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/argosopentech/32/336988_2.png) [@argosopentech](https://meta.discourse.org/u/argosopentech)
#### Post date: [November 3, 2023, 9:17pm UTC](https://meta.discourse.org/t/translate-button-missing-with-libretranslate/229821/14 "2023-11-03T21:17:46Z")

</div>

> [@sunjam](#):
>
> Those are working fine. Unfortunately run into trouble with the arm64 image when testing at home, which seems to be an issue for the last few releases.

This bug should be fixed now:  
[https://github.com/LibreTranslate/LibreTranslate/issues/524#issuecomment-1784342641](https://github.com/LibreTranslate/LibreTranslate/issues/524#issuecomment-1784342641)

---

<div class="post-metadata">

### Author: ![sunjam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sunjam/32/175682_2.png) [@sunjam](https://meta.discourse.org/u/sunjam)
#### Post date: [November 3, 2023, 11:17pm UTC](https://meta.discourse.org/t/translate-button-missing-with-libretranslate/229821/15 "2023-11-03T23:17:46Z")

</div>

Yep, translations are working on `latest` on arm64 Docker on Raspberry Pi 4.

Thanks so much!

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [December 14, 2023, 12:16pm UTC](https://meta.discourse.org/t/translate-button-missing-with-libretranslate/229821/16 "2023-12-14T12:16:25Z")

</div>


