Skip to main content
Participant
May 19, 2021
Answered

Google Translations - Invalid Credentials

  • May 19, 2021
  • 5 replies
  • 2625 views

Hello,

We are trying to setup machine translation for RoboHelp 2020 by using Google Translations API. We already have the API key, and we are sure it works fine since we tested it by opening the following URL in a browser:

https://translation.googleapis.com/language/translate/v2?q=This%20is%20a%20test&source=en&target=it&key={OUR_API_KEY}

Unfortunately, after pressing the "Validate" button in the RoboHelp dialog, it states that credentials are not valid ("Incorrect credentials."). We put the following URL in the endpoint field:


https://translation.googleapis.com/language/translate/v2

What are we doing wrong?

 

Thank you in advance.

 

    This topic has been closed for replies.
    Correct answer Sylvio5FB7

    Hi!

    Update #5 fixes this issue. Google did change how their translation API works, so that essentially broke this feature for earlier versions of RohoHelp.

    Now, you can create a Service Account in your Google Cloud Translation API and create a "Service Account Key". This is actually a downloadable JSON key file, which you store locally on your PC. You then need to provide the path to that key file in your RoboHelp translation profile.

     

    Here's a good start to learn the Google side of things:

    https://cloud.google.com/docs/authentication?_ga=2.36464617.-878103868.1620851413

     

    I managed to get it to work with a trial account. Of course, this being machine translation, it's never perfect. Even if it is "AI-assisted" or whatever... You still need to have the results reviewed by someone who actually speaks the target language natively.

    5 replies

    Sylvio5FB7Correct answer
    Inspiring
    June 11, 2021

    Hi!

    Update #5 fixes this issue. Google did change how their translation API works, so that essentially broke this feature for earlier versions of RohoHelp.

    Now, you can create a Service Account in your Google Cloud Translation API and create a "Service Account Key". This is actually a downloadable JSON key file, which you store locally on your PC. You then need to provide the path to that key file in your RoboHelp translation profile.

     

    Here's a good start to learn the Google side of things:

    https://cloud.google.com/docs/authentication?_ga=2.36464617.-878103868.1620851413

     

    I managed to get it to work with a trial account. Of course, this being machine translation, it's never perfect. Even if it is "AI-assisted" or whatever... You still need to have the results reviewed by someone who actually speaks the target language natively.

    Known Participant
    October 18, 2022

    Hey there!

     

    I've seen your message about the new update and having the google translate API. I have my JSON key and everytime I click validate it gives me an application error:

    Do you have any idea what I have to do or what causes this? It's giving me such a headache haha!

     

    Thank you in advance!

    Jeff_Coatsworth
    Community Expert
    Community Expert
    October 19, 2022

    @ElisaTeigeler what exact version of RH please?

    Inspiring
    May 26, 2021

    Hi,

    I'm getting the same issue as well. I happen to have access to beta releases for Update #5, but it seems that this issue has not been addressed yet, even in the latest drop. I'm still getting the "Incorrect Credentials" message in Update 5 Beta, Drop 7.

     

    Also, I tried the proposed workaround using Update 5 Beta, Drop 7, and got the same results as the OP. I guess we need to wait for another drop for these fixes to be included.

     

    Also, I would add that the online documentation perhaps needs to go a little bit deeper in explaining how to obtain the necessary values like API Key and Endpoint. Or perhaps link to relevant instructions in Google's documentation? Although Google's documentation is very thorough and detailed, I felt a bit lost trying to figure out exactly how to obtain an API Key suitable for RoboHelp, and I'm still not perfectly clear on what the Endpoint should be. Like the OP, I am unable to get the translation API to work, but I can't be sure if the values I'm putting in are actually the right ones and if my project in Google Cloud is properly setup for what RoboHelp needs.

    Jeff_Coatsworth
    Community Expert
    Community Expert
    May 20, 2021

    Sorry, no clue (don't have to deal with localization in any of my projects) - I suggest you chat with RH support - see https://helpx.adobe.com/contact/enterprise-support.other.html#robohelp for your support contact options.

    Jeff_Coatsworth
    Community Expert
    Community Expert
    May 20, 2021

    This might be your issue - https://community.adobe.com/t5/robohelp/configure-machine-translation/m-p/11704673 - something to do with a region in the Header in the Profile?

    Participant
    May 20, 2021

    Hi Jeff,

    I'm afraid this is not our case since we are trying to use Google Translations API while that post talks about Microsoft Translations API. As far as I know, Google has no region restrictions. Just to be sure, I had a look at the Google Cloud Console and verified that my API key has no restrictions.

     

    Can you tell us how RoboHelp creates the API request? Which headers and parameters are used? It would be great if we could simulate that call to understand what's going wrong.

     

    Any other ideas/suggestions are greatly appreciated.

     

     

    Thank you.

    Adobe Employee
    May 20, 2021

    Hi,

    I will be suggesting a workaround. Google translate has undergone a revamp on their side so it has broken in RH. We will be fixing this issue in our next update. 

     

    In you terminal type -> "npm install @google-cloud/translate" without quotes.

    If you don't have npm, please download and install it for your system from here.


    Follow the below steps and let me know if resolved:

    1. Open RH installation folder: (eg: C:\Program Files\Adobe\Adobe RoboHelp 2020)
    2. Go to "resources\data\template\google" and open profile_builder.js
    3. Remove all the content of this file, and replace it with the below code:
      const {Translate} = require('@google-cloud/translate').v2;
      
      (src_lng, tar_lng, text2translate, API_KEY, jsonKeyFile, headers = {}) => {
          tar_lng = tar_lng.replace(/-(.*)/, '')
          let CREDS = require(jsonKeyFile)
          let _object = {} 
          _object.caller = (thisObjectInit) => {
              const translate = new Translate({
                  projectId: CREDS.project_id, 
                  credentials: CREDS
              }) 
          
              return translate.translate(text2translate, {from: src_lng, to: tar_lng}).then(translations => {
                  let translation = translations && translations[0]
                  return translation
              })
          }
          return _object
      }

       

    4. Restart RH, and go to add translation profile dialog.
    5. Choose Google Translate from the dropdown.
    6. In the text input of the endpoint(2nd text input), paste the path to the JSON file which gets downloaded (refer this) when you set up a service account of google translate in the google cloud console. (If this step hasn't been followed, refer to this)
    7. In the text input of the API key(1st text input) type "abcdef123".
    8. When both the input fields are populated hit the validate button.


    This should fix the validation issue and let you use google translation for machine translation. 

    Thanks.

    Jeff_Coatsworth
    Community Expert
    Community Expert
    May 19, 2021

    Is your RH2020 running patch 4?

    Participant
    May 20, 2021

    Hi Jeff,

    thank you for your prompt reply.

    Attached you can find the snapshots about the version and the error.

     

    If I look for updates it says that I'm up to date.

     

    Thank you again.