Hi, trying to translate an RTF document fails. I think the issue is in the synchronous translator with any RTF. I'm wondering - nobody translating RTFs? I tried with 2 RTFs, one of which I created new just for the test. Not allowed to attach it here but I uploaded it to [1], will be there for 7 days.
My file is:
echo '{\rtf1\ansi\deff0 {\fonttbl {\f0 Times New Roman;}} Hello world}' > /tmp/ttt. rtf
My request is:
curl -v -o /tmp/ttt.translated.rtf -X POST "https://yoga-translator.cognitiveservice s.azure.com/translator/document:translate?sourceLanguage=en&targetLanguage=bg&api-version=2024-05-01" -H "Ocp- Apim-Subscription-Key: [REDACTED]" - F 'document=@"/tmp/ttt.rtf";type=application/rtf;filename=document.rtf'
I get back HTTP 400 and the content of /tmp/ttt.translated.rtf is:
{"error":{"code":"InvalidRequest","message":"The format parameter is not valid.","target":"ContentType","inner Error":{"code":"InvalidFormat","message":"The format parameter is not valid."}}}
Whether I specify type or not with curl doesn't matter. I always get the same when I submit an RTF file. I successfully translated only a sample text/plain document but only succeeded when file extension was .txt. When `filename`` had no extension, everything else equal, I've got the same error as with the RTF. That's why I'm thinking that whatever auto-detection is going on is broken over there. With a confusing error message on top of it.
I hope some support person can chime in because I can't file a support case. I'm not paying $29 for the privilege to be a qe tester. I'd rather go to a different provider as I'm just kicking the tires of azure translate.
P.S. I verified that the translator does support RTF with the application/rtf mime type using some endpoint /translator/text/batch/v1.0/documents/formats
Update: it also rejects any .doc files but works with .docx
[1] https://limewire.com/d/jkv1f#Sm9q9ncgc0