Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Be more indulgent with "Automatic Suggestions" URLs #12291

Closed
jawira opened this issue Aug 19, 2024 · 5 comments · Fixed by #12292
Closed

Be more indulgent with "Automatic Suggestions" URLs #12291

jawira opened this issue Aug 19, 2024 · 5 comments · Fixed by #12292
Assignees
Labels
bug Something is broken.
Milestone

Comments

@jawira
Copy link

jawira commented Aug 19, 2024

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

  • Project: libretranslate
  • Container: libretranslate-1
  • Port: 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.

class WeblateServiceURLValidator(WeblateURLValidator):
"""
Validator allowing local URLs like http://domain:5000.
This is useful for using dockerized services.
"""

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
Copy link
Member

nijel commented Aug 19, 2024

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

@nijel
Copy link
Member

nijel commented Aug 19, 2024

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

@nijel nijel added the bug Something is broken. label Aug 19, 2024
@nijel nijel added this to the 5.7.1 milestone Aug 19, 2024
@nijel nijel self-assigned this Aug 19, 2024
nijel added a commit to nijel/weblate that referenced this issue Aug 19, 2024
The previous solution applied both Django and Weblate validation to
these fields.

Fixes WeblateOrg#12291
@jawira
Copy link
Author

jawira commented Aug 19, 2024

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 :)

Copy link

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

  • In case you see a problem with the fix, please comment on this issue.
  • In case you see a similar problem, please open a separate issue.
  • If you are happy with the outcome, don’t hesitate to support Weblate by making a donation.

1 similar comment
Copy link

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

  • In case you see a problem with the fix, please comment on this issue.
  • In case you see a similar problem, please open a separate issue.
  • If you are happy with the outcome, don’t hesitate to support Weblate by making a donation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants