@shanelord01 OK - worked it out.
- Open the web UI for LibreTranslate after setting it up.
- In the "Request" box, there is a line with "const res = await fetch("https://translate.your.domain/translate", "
- Copy the main domain URL (ie https://translate.your.domain" )without the /translate and without quotation marks.
- Open your Cloudron Mastodon app, and open its file manager and edit "env.production"
- At the bottom, add the "#translate section" below here:
# Optionally change default language
# DEFAULT_LOCALE=en
# translate
LIBRE_TRANSLATE_ENDPOINT=https://translate.your.domain
LIBRE_TRANSLATE_API_KEY=YOUR_API_KEY
Save this. Restart the Mastodon app.
API Key
If you don't have your API key, open the LibreTranslate Cloudron App Terminal, and issue:
su - cloudron -c 'ltmanage keys --api-keys-db-path /app/data/api_keys.db add 120'
You'll get a key like "f67d5afe-aa14-4d37-90f7-f7d9636b721e" in response - use the one you got in reponse.
Optional; set your default language:
# Optionally change default language
DEFAULT_LOCALE=en
Update:
After completing setup and ensuring everything works, if you want to stop people from using the Web UI to translate, you can disable it by editing the LibreTranslate "env.sh" file via its Cloudron File Manager, and adding this (then save env.sh and restart LT):
export LT_DISABLE_WEB_UI=true
Note: After doing this I've noted the app is stuck reporting as "Starting" in the Cloudron "My Apps" even though it is running fine. Not sure if this is a health check failing in the Cloudron app? @nebulon Any way to do this without causing this issue?