MicrosoftTranslator / DocumentTranslation

Command Line tool and Windows application for document translation, a local interface to the Azure Document Translation service for Windows, macOS and Linux.
Other
147 stars 34 forks source link

The Chinese version of Azure uses DocumentTranslation to prompt that there is no such resource group #95

Open e4je opened 2 years ago

e4je commented 2 years ago

image Hello developer, I have tried according to the document for a long time, and found that on the Chinese version of Azure, there will be an error message that there is no such resource group. No matter what, I can't solve it. I would like to ask if this version cannot be used.

chriswendt1 commented 2 years ago

Hi @e4je , The Document Translation service is not deployed yet in Azure China. It just reached general availability in public Azure, that means it will be deployed in China within the next two months or so. I leave this issue open until then, and resolve it when I learned that Document Translation has been deployed in Azure China.

Please submit an issue at the time, if you still have trouble. I'd be interested in your observation whether the app works in Azure China, after Document Translation has been deployed there.

e4je commented 2 years ago

Thanks a lot, I will test it when deploying to Azure China

zjunsen commented 1 year ago

Hello, document translation has been deployed in China. When will this tool be updated to support China?

chriswendt1 commented 1 year ago

Hi @zjunsen , The tool is designed to work with any Azure region. What are you observing? Where is it failing?

zjunsen commented 1 year ago

Hi @zjunsen , The tool is designed to work with any Azure region. What are you observing? Where is it failing?

I created a translation service in China East 2, and the pricing layer is S1 standard. After the tool saves the settings, the test prompts: resource not found. It's the same as the sticker error on the question post.

micli commented 1 year ago

Hi @chriswendt1 and @e4je : I've debugged Documentation Translation UI line by line. The 404 error that e4je mentioned before raised by TryPaidSubscription() which is located at TestCredentials.cs .

The root cause is that Azure Mooncake did not deploy documentation translation API at all! It's easy to be verified by PostMan. Any APIs regarding documentation translation always returns 404 resource not found. At document center of Azure Mooncake, there is no articles describe documentation translation.

The only part of let user confusion is there is an documentation translation API endpoint shows at Azure Mooncake portal.

截屏2022-10-05 20 31 58

I thought Mr. Chris definitely did not test Mooncake service before release.

Thanks all!

e4je commented 1 year ago

Hi@micli I tried Python to call the document translation endpoint and the call was successful and returned the expected result。 The following code is used `import requests

endpoint = "https://Translate-no1.cognitiveservices.azure.cn/translator/text/batch/v1.0" key = 'You Key' path = '/batches' constructed_url = endpoint + path

payload= { "inputs": [ { "source": { "sourceUrl": "You Source AzureBlob Url", "storageSource": "AzureBlob", "language": "en", }, "targets": [ { "targetUrl": "You Azure Targets AzureBlob Url", "storageSource": "AzureBlob", "category": "general", "language": "zh-Hans" } ] } ] } headers = { 'Ocp-Apim-Subscription-Key': key, 'Content-Type': 'application/json' }

response = requests.post(constructed_url, headers=headers, json=payload)

print(f'response status code: {response.status_code}\nresponse status: {response.reason}\nresponse headers: {response.headers}')`