User Guide Cancel

Configure a translation framework for a service provider

  1. RoboHelp User Guide
  2. Introduction
    1. Get to know RoboHelp workspace
    2. What's new in RoboHelp 2022 release
      1. What's new in Update 5
      2. What's new in Update 4
      3. What's new in Update 3
      4. What's new in Update 2
      5. What's new in Update 1
    3. Fixed Issues in RoboHelp
    4. RoboHelp System Requirements
    5. Download RoboHelp on Windows and macOS
    6. Download and install Adobe app
    7. RoboHelp FAQs
    8. What's new in RoboHelp 2020 release
      1. What's new in Update 8
      2. What's new in Update 7
      3. What's new in Update 6
      4. What's new in Update 5
      5. What's new in Update 4
      6. What's new in Update 3
      7. What's new in Update 2
      8. What's new in Update 1
  3. Projects
    1. Plan your RoboHelp project
    2. Create a project
    3. Manage projects
    4. Work with topics and folders
    5. Generate reports
    6. Work with context-sensitive help
    7. Manage References
    8. Set preferences in RoboHelp
  4. Collaborate with authors
    1. Collaborate using Git
    2. Collaborate using SharePoint Online
    3. Collaborate using Azure DevOps (Team Foundation Server)
  5. PDF Layout
    1. PDF templates
    2. Design a page layout
    3. Publish PDF output
    4. Work with the common content styles
    5. Components of a PDF template
    6. Support for language variables
    7. Customize PDFs
  6. Editing and formatting
    1. Format your content
    2. Create and manage cross-references
    3. Create and manage links
    4. Single-source with snippets
    5. Work with images and multimedia
    6. Create and use variables for easy updates
    7. Work with Variable Sets
    8. Use Find and Replace
    9. Auto save your content
    10. Side-by-side editing in Split View
    11. Use the Spell Check feature
    12. Create and Edit Bookmarks
    13. Insert and update fields
    14. Switch between multiple views
    15. Autonumbering in CSS
  7. Import and linking
    1. Import Markdown files into a project
    2. Import Word documents into a project
    3. Import FrameMaker documents into a project
  8. TOCs, indexes, glossaries, and citations
    1. Create and manage a Table of Contents
    2. Create and manage an index
    3. Create and manage a glossary
    4. Create and manage citations
    5. Create and manage browse sequences
    6. Work with See Also and Related Topics
  9. Conditional content
    1. What is conditional content
    2. Create and apply condition tags
    3. Configure output presets for conditional content
    4. Optimize and manage conditional content
  10. Microcontent
    1. Microcontent
  11. Review and Collaboration
    1. Review and Collaboration
  12. Translation
    1. Translating content to multiple languages
    2. Configure a translation framework for a service provider
  13. Generating output
    1. Generate output
    2. Generate Frameless output
    3. Generate Knowledge Base output
    4. Generate PDF output
    5. Generate Responsive HTML5 output
    6. Generate Word Document output
    7. Generate Content Only output
    8. Generate eBook output
    9. Generate Microsoft HTML Help output
    10. Generate Mobile App output
  14. Publish output
    1. Publish to a RoboHelp Server
    2. Publish to an FTP server, a Secure FTP server, or a File System
    3. Publish to SharePoint Online
    4. Publish to Zendesk Help Center
    5. Publish to Salesforce Knowledge Base
    6. Publish to ServiceNow Knowledge Base
    7. Publish to Zoho Knowledge Base
    8. Publish to Adobe Experience Manager
    9. Publish to Atlassian Confluence Knowledge Base
  15. Appendix
    1. Adobe RoboHelp Scripting Reference
    2. RoboHelp keyboard shortcuts

Learn how to configure the Translation framework for a translation service provider of your choice to dynamically translate your content with RoboHelp.

In addition to the pre-defined translation providers available out-of-the-box, you can also integrate your translation connector to serve your requirements.  

Using custom script for translation

To configure a custom provider, create a JavaScript file on the system. The file contains a function with return value an object. This returned object has a field “caller” and has a function of return type JavaScript Promise as its value.

(src_lng, tar_lng, text2translate, API_KEY, endpoint) => { 
 //src_lang: source language 
 //tar_lang: target language 
 //text2translate: text to send for translation 
 //API_KEY: API key from your service provider 
 //endpoint: endpoint/API URL of your service provider 
 //build your query  
 var query:Function = //REST API goes here, which returns a Promise 
 return { 
  caller: query  
 } 
}

caller (Function)

The function defined in the caller field of the returned object sends the REST API request over to the server using javascript "request" method, which returns a javascript Promise. Resolve/reject the Promise accordingly and finally return the translated text or in case of an error, throw an error.

Bing sample script file

(src_lng, tar_lng, text2translate, API_KEY, endpoint) => { 
     const uuidv4 = require('uuid/v4'); 
   const request = require('request'); 
 var api_request_fn = () => { 
   // return a promise because sending and receiving translated text is asynchronous procedure 
            return new Promise((resolve, reject) => {  
   var request_data = { 
              method: 'POST', 
              baseUrl: endpoint, 
              url: 'translate', 
              qs: { 
                'api-version': '3.0', 
                'to': [tar_lng] 
              }, 
              headers: { 
                 'Ocp-Apim-Subscription-Key': API_KEY, //your API key goes here 
                 'Content-type': 'application/json', 
                 'X-ClientTraceId': uuidv4().toString() //give an ID to your request 
              }, 
              body: [{ 
                    'text': text2translate //send the text to translate as a part of the body 
              }], 
              json: true, 
          }  
   // the structure of request_data is different for every service provider 
   // look up the documentation provided by your translation service provider  
   // to build the request data. 
 
                request(request_data, function(err, res, body) {  
     // read about request method here https://www.npmjs.com/package/request 
                    if(err) {// in case of an error reject the promise, it will exit the translation process 
                        reject({body, err, res}) 
                    } else {// in case of a valid response from the server, resolve the promise 
                        resolve({body, err, res}) 
                    } 
                }) 
            }).then(data => { 
                if(data.body.error) { 
     // in case error from the server is send as part of the body  
     // and skipping the previous if block in request, handle it here  
                    throw new Error(data.body.error.message); 
     // throw the error with the message you want to show,  
     // preferably the error message sent by the server 
                } else { 
                    return data.body[0].translations[0].text  
     // return the translated text here, in this case it is in the data at  
     // the specified location. The location in the data object varies with the provider 
                } 
            }) 
        } 
}

We discussed Bing translate API builder in the above example, notice that google and yandex have different handlers than the Bing. Build this function according to the specifications provided by your service provider.

We strongly recommend to check out samples in your RoboHelp installation directory:   
"resources/data/template/translation/bing/profile_builder.js"
"resources/data/template/translation/google/profile_builder.js"
"resources/data/template/translation/yandex/profile_builder.js"
"resources/data/template/translation/deepl/profile_builder.js"

Note:
  1. When customers use these translation features, the data is submitted to the vendor for the purpose of processing. 
  2. The use and processing of that data is governed by the customer’s contract with the vendor and the vendor’s privacy policy, and Adobe is not responsible for the vendor.

Create a custom integration profile

  1. Navigate to Translation Profiles. For details, see Create profile for Machine Translation.

  2. Click + to create a new profile.

  3. In the Translation profile dialog box, provide the details for API key, Endpoint & Custom Script Path

  4. Click Validate to verify that the credentials entered are correct and complete.

  5. Click Save.

Get help faster and easier

New user?