Open samcsk opened 4 years ago
Here is a tricky workaround. You can set API key to something like
<Your API Key>
Ocp-Apim-Subscription-Region: <Region>
Since we can't type linebreak \n
directly in GUI, we need to first write these two lines in somewhere like notepad, then copy them and paste to Textractor. The linebreak looks like a space, but it's actually linebreak. (You can copy it back to notepad to verify it)
This trick works because Textractor just joins our input into headers: https://github.com/Artikash/Textractor/blob/3e283975c8f0cf1bb8f1818e18e909196970c96b/extensions/bingtranslate.cpp#L209
Currently, the plugin is assuming the global region (by omitting in the header field
Ocp-Apim-Subscription-Region
) when contacting the API endpoint. This results in the return ofwhenever the endpoint is set to be any other regions.
From the official docs, the currently available regions are
Moreover, the API can also be accessed via custom endpoints (https://\<your-custom-domain>.cognitiveservices.azure.com/).
It would be nice if the plugin includes fields for the input of these two information.