FlineDev / BartyCrouch

Localization/I18n: Incrementally update/translate your Strings files from .swift, .h, .m(m), .storyboard or .xib files.
MIT License
1.36k stars 121 forks source link

Error: Translation request failed with error: The operation couldn’t be completed. (Microya.JsonApiError error 1.) #191

Open ppcharlier opened 4 years ago

ppcharlier commented 4 years ago

Expected Behavior

translation using Microsoft Translator API

Actual Behavior

Keep empty translations and say "Found empty value for key ..."

Steps to Reproduce the Problem

  1. Add string to source language
  2. enter configuration in toml file (secret, I tried both subscription id and the 2 API keys)
  3. build

Specifications

0xJxa commented 4 years ago

Unfortunately I have the same problem 😔

jtruher commented 4 years ago

I was able to resolve this by recreating a new Azure instance in the Global domain. As near as I can tell, based on this document, bartycrouch is expecting to hit api.cognitive.microsofttranslator.com.

ppcharlier commented 4 years ago

Hi, Could you please explain or link an explanation on how to create an Azure instance in global domain ? Every time I try to create one it’s in a dedicated endpoint :-/

jtruher commented 4 years ago

I was able to do it, or something a lot like it, with instructions from here. I had a failed first attempt at setting it to Global and struggled a little bit with their UI. Things seemed to fail for no obvious reason.

scottsymes commented 4 years ago

Seems to be related to Auth of a global versus Regional resource:

The regional resource requires an additional parameter Ocp-Apim-Subscription-Region:

     -H "Ocp-Apim-Subscription-Key:<your-key>" \
     -H "Ocp-Apim-Subscription-Region:<your-region>" \
     -H "Content-Type: application/json" \
     -d "[{'Text':'Hello, what is your name?'}]"

Microsoft Azure Docs for reference: Global Resource Regional Resource

Adding an additional param in BartyCrouch could solve this. Until then resources need to be created as Global.

Danbana commented 3 years ago

I was able to resolve this by recreating a new Azure instance in the Global domain. As near as I can tell, based on this document, bartycrouch is expecting to hit api.cognitive.microsofttranslator.com.

I was able to get the translation working when I recreated the resource as global.

Magical to see the automatic translation!

Well done Barty!

tyirvine commented 3 years ago
Azure Global

Yup, just needed to select Global as region and then it works just fine.