Page tree
Skip to end of metadata
Go to start of metadata

The CTSX Google module performs translation via Google Cloud Translation API. Google Translation API supports more than one hundred different languages, from Afrikaans to Zulu. Used in combination, this enables translation between thousands of language pairs.

Installation

Maven is the easiest way to install the module. Add the following dependency to your bundle:

<dependency>
    <groupId>info.magnolia.translation</groupId>
    <artifactId>magnolia-content-translation-support-ext-google</artifactId>
    <version>${CTSExtendedVersion}</version>
</dependency>

In order to start the Google translation process, please make sure that the core and apps modules which mentioned in Content Translation Extended have already been installed.

Configuration

Configuration of the Google service provider is handled in the module config. This provider can be configured with the following properties.

autoTranslationAllowed

optional, default is false

When true the content review process (workflow) is bypassed.

class

required

Definition class for the translator to be used.

See info.magnolia.translation.ext.provider.google.definition.GoogleProviderDefinition

clientId

required

Identifies the client application with Google.

clientToken

required

Client secret for the client ID.

configName

required

Identifies the configuration within Magnolia.

defaultFlag

optional

The default configuration used by the system in the case of multiple translation services being used.

implementationClass

required

Implementation class for interfacing with Google.

See info.magnolia.translation.ext.provider.google.translator.GoogleTranslator

Usage

After registration and starting, The Content Translation Support Extended (CTSX) module will bind the Google translator to Configuration field.

You can test the connection to the translator api before using.

How it works

Following the below steps in order to translate the content with Google translator service.

Step 1 - Choose Pages

Choose the pages that contain the i18n items before starting the process

Click to 'Add to translation batch' action on action bar

In the 'Add to translation batch' dialog:

  • Input the batch name or select a existing batch
  • Check to include Dependencies and include Sub-nodes if necessary 
  • Select Google.com in the Configuration
  • Optionally, add instructions and notes
  • Click Save Changes

Step 2 - Submit Batch

Open the Translation Extend app under the Tools menu in AdminCentral.

In the 'Batches' tab:

  • Select your batch 
  • Edit the batch information if you want
  • Click to 'Submit batch' action on action bar

After The executeGetTranslationCommand running, you will get the Pulse notification for the translation result 

***Note: This step can be bypassed (auto import translated content) if you set "autoTranslationAllowed=true"

In the 'Translation Review' dialog:

  • Click to 'Assign to me' on action bar
  • Can be 'Approve & Import' or Reject the task
  • Click to 'Review' action for comparing the different

Also can be 'Import' or "Reject" in the 'Comparison' tab

Step 3 - Check result

After importing the translated content, you can open the selected page again for checking the result.

Known Issues

Too many text segments

In case of submitting many contents (such as the whole /travel page includes dependences), an error will be thrown as below. This is known issue as number of submitted segments is over google's threshold. 

ERROR info.magnolia.commands.MgnlCommand: Execution is error, update to translation task item {}
com.google.cloud.translate.TranslateException: Too many text segments
Caused by: com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request {"code": 400, "errors" : [ { "domain" : "global", "message" : "Too many text segments", "reason" : "invalid" } ], "message" : "Too many text segments"}

References:

https://github.com/ankitpopli1891/django-autotranslate/issues/6

https://groups.google.com/forum/#!topic/google-ajax-search-api/ssBYeYWwpk8

https://groups.google.com/forum/#!topic/google-translate-api/ssT8i1DIsIA

  • No labels

4 Comments

  1. Which Magnolia versions are supported?

    1. Hi Christopher Zimmermann, It works for Magnolia 5.6 and 5.7. This info mentioned in the parent page Content Translation Extended, Should we add it here as well? 

  2. Thanks. No, I guess it is not required on these three child pages as well then, but it would be helpful if in the installation section of these pages there was a link to the parent page and a note that the CTX module must be installed. Consider that links will send people directly to this page, so they might not be aware of the parent page at first.

    1. Thank you for your advice! We will update it. Please feel free to add any other comments you have.