Comments (6)
Hi Lippy, these three need to match and come from the same resource.
The Text Translation Endpoint should also match the endpoint as listed in the Azure resource.
Also verify:
Are you using the newest version of the app?
Is the translation job working, only the test is failing? What are you seeing when you run a translation?
from documenttranslation.
So yes, I am using the three values from the translator resource. I have tried two different regions and the same thing happens with the test. I am using the latest version 0.9.3.2 and when I try to do a text translation the app bombs and closes.
from documenttranslation.
The translator resource is S1 pay as you go. My OS is Windows 11 64bit and I do have .net core 6.0.14 installed as well.
from documenttranslation.
Any ideas why I could be seeing these errors in testing and translation?
from documenttranslation.
I don't have an idea at this point.
Here is the code that produces the error message you are seeing when you run "Test":
private static async Task TryCredentialsKey(string subscriptionKey, string azureRegion, string TextTransUri)
{
if (string.IsNullOrEmpty(TextTransUri)) TextTransUri = "https://api.cognitive.microsofttranslator.com";
using HttpRequestMessage request = new() { Method = HttpMethod.Post, RequestUri = new Uri(TextTransUri + "/detect?api-version=3.0") };
request.Headers.Add("Ocp-Apim-Subscription-Key", subscriptionKey);
if (azureRegion?.ToLowerInvariant() != "global") request.Headers.Add("Ocp-Apim-Subscription-Region", azureRegion);
request.Content = new StringContent("[{ \"Text\": \"English\" }]", Encoding.UTF8, "application/json");
HttpClient client = new();
HttpResponseMessage response = await client.SendAsync(request);
if (!response.IsSuccessStatusCode)
throw new CredentialsException("Invalid key, or key does not match region.");
}
It does a simple language detection. If all your credentials and URLs are correct, as you expect them to be, check if a firewall or proxy blocks your access to api.cognitive.microsofttranslator.com.
from documenttranslation.
from documenttranslation.
Related Issues (20)
- Translate entire folder as source HOT 4
- Issue with CLI Usage HOT 9
- Translation of an empty folder causes an erroneous error message about invalid or missing credentials HOT 1
- Unable to translate OneDrive folder HOT 1
- Azure Translator Service Keys are not working within the tool HOT 26
- Issue with Microsoft Translator tool HOT 5
- DITA XML format HOT 9
- Custom Translate does not work for document translation but text translation HOT 3
- Unable to use application behind corporate proxy HOT 3
- HttpRequestException InnerException can be null HOT 3
- Central deployment of appsettings.json in locked-down clients HOT 1
- Make the proxy settings settable via command line (CLI)
- json files compatibility HOT 2
- Unable to locate DocumentTranslation Privacy Policy HOT 4
- Set KeyVaultURI via command line switch at install? HOT 1
- Add a link to relevant privacy documentation HOT 1
- The agent is killed while testing HOT 14
- json file not working
- Web interface with .Net 6 MAUI roadmap?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from documenttranslation.