Hi, we want to run LibreTranslate and Discourse Translator on the same virtual server.
I have installed LibreTranlsate on our virtual server using pipx (as indicated by the pip installer). We have downloaded the language pairs and we have created an API key.
~# libretranslate
Running on http://127.0.0.1:5000
The Discourse instance is up and running, and the Translator plugin is enabled. We have entered http://127.0.0.1:5000
as the API end point and and the API key value.
But when we click the globe icon, this dialog happens:

For what is worth, we have also tried http://localhost:5000
. There is nothing in the Discourse /logs either.
Do you know what might be the cause, or how we can debug the problem?
Discourse runs inside a docker container. You probably need to make sure LibreTranslate is binding to 0.0.0.0 and then use http://host.docker.internal:5000 as an endpoint in your Discourse settings.
1 Like
That didn’t work, or I did something wrong.
Then, to debug this without time pressure, I just purchased a key, and… I’m still getting the problem on Discourse:
Translator libretranslate endpoint: https://libretranslate.com/translate
I enter the paid API key.
I get the same dialog as above. Now I do get an error in Discourse’ logs:
Job exception: The translator service is currently not available.
(snip, unnecessary)
1 Like
The endpoint should be https://libretranslate.com (without /translate)
1 Like
Doh, ok… I tried to find such basic information but only found comments from Mastodon admins pointing to the /translate URL. Maybe it could be more visible, be sent with the email next to the paid API key.
Anyway, problem solved, and now I can investigate the local problem quietly.
Thank you very much again, @pierotofy.
2 Likes