Hello! I’m trying to connect my self hosted Weblate and Libretranslate instances, but when I add my Libretranslate URL in Weblate, I get this error: " * Could not fetch translation: 400 Client Error: BAD REQUEST for url: [MY LT INSTANCE’S URL]/translate".
If I try the public Libretranslate instance, it accepts that without issue and I get automatic suggestions working. This leads me to believe the problem is my Libretranslate configuration. What’s strange is that my Libretranslate instance seems to work the same as the public instance, as I can make requests to its /translate endpoint without issue.
What I’ve tried:
- Setting up CORS to accept requests from my Weblate instance’s URL. That didn’t change anything.
- Configure all instances under the same docker-compose.yml, which I share below, in order to leverage Docker networking which would mitigate any errors related to network permissions. I couldn’t complete this test because Weblate won’t accept
http://libretranslate:5000
as the Libretranslate URL by saying “Enter a valid URL”.
My docker configuration:
version: '3'
volumes:
localize-cdn-data:
services:
weblate:
ports:
- 8082:8080
volumes:
- localize-cdn-data:/app/data/localize-cdn-data
environment:
WEBLATE_ADMIN_PASSWORD: mypassword
WEBLATE_ADMIN_EMAIL: [email protected]
WEBLATE_SITE_DOMAIN: localhost
libretranslate:
container_name: libretranslate
build:
context: LibreTranslate
dockerfile: docker/Dockerfile
restart: unless-stopped
ports:
- "5000:5000"
environment:
- LT_LOAD_ONLY=en,es
- How could I inspect the request coming from Weblate in order to eye what’s different between the public instance and mine?
- What might I have misconfigured in my Libretranslate instance which doesn’t allow it to be used by my Weblate instance?