WeblateOrg / weblate

Web based localization tool with tight version control integration.
https://weblate.org/
GNU General Public License v3.0
4.58k stars 1.02k forks source link

Be more indulgent with "Automatic Suggestions" URLs #12291

Closed jawira closed 2 months ago

jawira commented 2 months ago

Describe the problem

As you might know, in dockerized environments, containers can communicate between them using Docker's container name. The problem is that, currently my container's name is not accepted when I configure LibreTranslate as "Automatic Suggestion" provider.

For example, using Docker-compose I have the following hostname: http://libretranslate-libretranslate-1:5000

Sadly, Weblate is too strict about URL and considers that previous URL is not valid, I get the message Enter a valid URL..

Screenshot from 2024-08-19 12-44-21

Describe the solution you would like

It would be nice to be more flexible about URLs and accept container names as valid URL.

As far I can see some effort has already by done to add compatibility with Dockerized environments, for example there is WeblateServiceURLValidator.

https://github.com/WeblateOrg/weblate/blob/a855fe6d57ef1b16e0f09b1ab3ef87b3559fedfb/weblate/utils/validators.py#L325-L330

So it would be nice to extend this "compatibility" to "Automatic Suggestions".

Describe alternatives you have considered

No response

Screenshots

No response

Additional context

No response

nijel commented 2 months ago

What Weblate version do you use? The custom URL validator is used since Weblate 5.5 (see ec0af648c5091594422fed25493bdce5881eb5b7).

nijel commented 2 months ago

…ah, but it seems to add this validator on top of the existing one instead of replacing it.

jawira commented 2 months ago

What Weblate version do you use? The custom URL validator is used since Weblate 5.5 (see ec0af64).

I recently update to docker image weblate/weblate:5.7.0.0.

Thanks for checking this :)

github-actions[bot] commented 2 months ago

Thank you for your report; the issue you have reported has just been fixed.

github-actions[bot] commented 2 months ago

Thank you for your report; the issue you have reported has just been fixed.