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

Bing Microsoft Translator API Key Isn't Recognized #8930

Open
Ulmo2112 opened this issue Oct 21, 2024 · 2 comments
Open

Bing Microsoft Translator API Key Isn't Recognized #8930

Ulmo2112 opened this issue Oct 21, 2024 · 2 comments

Comments

@Ulmo2112
Copy link

Ulmo2112 commented Oct 21, 2024

Thank you so much for such a beautiful and useful subtitles editor (the best Open Source) ! One issue regarding auto-translate though...
I've set up a Microsoft Azure account with the Translator resource especially for this app. Then, in the options > Settings > Auto-Translate, I provided the credentials in the entries for "Microsoft Translator" on the right pane of the settings dialog window : the Key, an the default endpoint provided which is "https://api.cognitive.microsoft.com/sts/v1.0/issueToken". But when I start an auto- translation (the above key being the API key as expected), an error control box appears stating "API key is not valid!"

I tried again after changing the default endpoint to Azure's Web API text translation endpoint, which is
"https://api.cognitive.microsofttranslator.com/"... Same result

I then tried again after changing the default endpoint to Azure's Web API document translation endpoint, which is
"https://<My_Resource_Name>.cognitiveservices.azure.com/"... Same result

I then tried with the second Key (Azure provides 2 keys for that Translator resource), along the three different endpoints as above... Same result

Here is the full error message that I get:
`API key is not valid!

{"error":{"code":401001,"message":"The request is not authorized because credentials are missing or invalid."}}
à Nikse.SubtitleEdit.Core.AutoTranslate.MicrosoftTranslator.Translate(String text, String sourceLanguageCode, String targetLanguageCode, CancellationToken cancellationToken)
à Nikse.SubtitleEdit.Forms.Translate.MergeAndSplitHelper.d__4.MoveNext()
--- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée ---
à System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
à Nikse.SubtitleEdit.Forms.Translate.AutoTranslate.<buttonTranslate_Click>d__33.MoveNext()
[{ "Text":"HEART BEATING STEADILY. (etc.....)"}]`

Here's a screen capture of my Azure resource Keys and endpoints:
Azure Keys and endpoints

@Ulmo2112 Ulmo2112 changed the title Bing Microsoft Translator doesn't recognize the API Key Bing Microsoft Translator API Key Isn't Recognized Oct 21, 2024
@niksedk
Copy link
Member

niksedk commented Oct 22, 2024

Works fine here:

image

image

image

image

@Ulmo2112
Copy link
Author

Thanks for your reply. Do you think that it could be a matter of location/region? I'm in Canada, and when registering the resource, if I select "global", Azure tells me that the resource isn't available for that location (hence the "canadacentral" location).
I'll try again this week and do a followup here, thanks again.

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