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

ROSETTA_ENABLE_TRANSLATION_SUGGESTIONS 404 not found #200

Closed
svdvonde opened this issue Aug 6, 2018 · 5 comments
Closed

ROSETTA_ENABLE_TRANSLATION_SUGGESTIONS 404 not found #200

svdvonde opened this issue Aug 6, 2018 · 5 comments

Comments

@svdvonde
Copy link
Contributor

svdvonde commented Aug 6, 2018

When I enable translation suggestions via Azure (and enter my client id/secret key) the suggestions do not seem to work. When clicking 'suggest' the browser console throws a 404 error:

Not Found: /rosetta/files/project/fr/0/translate/

Note that I have not altered the error other than removing the GET parameters. Am I missing something?

  • Which version of Django are you using?: 2.1
  • Which version of django-rosetta are you using?: 0.8.1
  • Have you looked trough recent issues and checked this isn't a duplicate? Yes
@mbi
Copy link
Owner

mbi commented Aug 6, 2018

Sorry, this slipped under my radar, but it seems that the app we've been using the source translations from the Microsoft Translator Text API no longer works.

We'll have to come up with another solution via the new Azure API.

In the meantime, if you wish to enjoy free translation, the Yandex API works fine.

@mbi
Copy link
Owner

mbi commented Aug 6, 2018

Note to self: new Azure API.

@svdvonde
Copy link
Contributor Author

svdvonde commented Aug 6, 2018

Thank you for the quick response! The reason I tried to go for Azure is because, after doing some completely unscientific experiments with some news articles, it appeared that Yandex's translation seems complete trash compared to the "hot new tech" in translation that's currently out there (DeepL translator is insane; haven't tested Azure's translation service).

Could you point me to the location in the rosetta source code that is responsible for interfacing with the Azure API? Perhaps, if I'm feeling crazy some day, I can find the time to submit a pull request (if it does not involve me learning about the entire rosetta code base).

Thank you!

@mbi
Copy link
Owner

mbi commented Aug 6, 2018

Ha! that would rock :)

So it's really dead-simple, it all happens in rosetta/views.py#L679, you'd want to replace the few lines starting at line 695 with the snippet here, but ideally use requests which is already a dependency instead of http.client and urllib.parse.

Cheers!

@mbi
Copy link
Owner

mbi commented Aug 7, 2018

Thanks again for your support on this!

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

No branches or pull requests

2 participants