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.

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

Submit Batch

Open the Translation Extend app (under the Tools menu).

From 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 

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

Check result

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

Known Issues

Too many text segments

v3.x -  EXCONTRANS-333 - Getting issue details... STATUS

v.2.9 -  EXCONTRANS-334 - Getting issue details... STATUS

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

15 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.

  3. Hi,

    which exact google translation service is CTSX using ? is it the Google Cloud Translator API (https://cloud.google.com/translate/) ?

    Tx

    Hugo

    1. Hello Hugo-

      Yes, you can find the details here GoogleTranslator.

      HTH

  4. Hi,

    is the above known issue "Too many text segments" worked arround (e.g. submiting multiple requests so to not overpass the max_segments) ?

    Thanks

    BR

    Hugo

    1. Hey Hugo-

      As far as I know the only way to work around it is stay under the threshold with small batch sizes. I know that probably isn't easy to estimate when creating them. I will open a ticket and take a look to see if we can make some improvements there. 

      EXCONTRANS-333 - Getting issue details... STATUS

      Cheers!

    2. Hugo Venancio may I ask are you just testing out the module or actively using it? If you are trying to decide which translator to use I can tell you we have put a big effort into Translations.com. Most customers are going with that solution. 

  5. Hi Richard Gange, thanks for your messages,

    Currently i am analysing the possible integration with this module, and i was initially planning to use the Google service (thou i also checked the Microsoft cloud service as well).

    However (every day is a new day (smile)) In fact today i got the request from our BUS they would like to use even a different Translation service than the ones supported out-of-box => (deepL): https://www.deepl.com/en/translator

    I am actually trying to figure out how exactly we can do it but maybe we will need to create our own Connector based on the CTSX, connecting the this engine's API. The API is basic in fact.

    I suppose this is feasible, right ? Obviously it would be at our own effort/responsibility, but technically i don't see anything (at 1st sight) that could be a show stopper.

    Do you see major concerns on that ?

    WDYT ?

    Tx

    Hugo

    1. Hi Hugo-

      Sorry for my late reply. We have v3.0.3 of Google translate ready. This should fix the segments issues. Please let me know if you have an issues with it. 

      As far as the other translator I would say it looks feasible. I would not depend on any classes from our translation modules though. There is a high probability this will go through a major refactoring soon. See  EXCONTRANS-328 - Getting issue details... STATUS  So either wait for that or try the Google service in the mean time. 

      The only concern I have would be creating any kind of link between our module and yours. These incubator modules are in a constant state or refactoring and improvement as feedback comes in. So some modules are more mature than others. This would be a module that is still in that improvement phase. 

      HTH

      Rich

      1. Hi Richard Gange, will these changes also be applied to the version compatible with 5.7, i suppose 2.9-SNAPSHOT ?

        We are still on Mgnl 5.7 and we will not upgrade to 6.1 soon, but still planning to use the CTSX on 5.7.

        Is it possible to have it there as well ?

        And another question is: how stable is Google Translator (in the version compatible with 5.7) ? Is it "stable enough to use it" ? You mentioned in one of your previous comments Mgnl put a lot of effort on Translations.com. Does that mean Google is not stable enough? Cause our business is really pushing either for google or this other provider DeepL, so theoretically the best approach would be google naturally.

        tx

        1. Hey Hugo-

          I spoke with the developer. We can do that. Please follow the progress on  EXCONTRANS-334 - Getting issue details... STATUS .

          As far as stability goes, 2.9 is pretty much the same business logic as 3.x. It's the M6 UI changes that required the next iteration to be released. As I said about the incubator, each module has its own state of maturity. I would say this module does work but the code quality (and maintainability) needs improvement. Before this module can take the next step we really need to refactor some of the backend design. There are plenty other customer actively using it and it's quite popular. It's definitely something we will keep improving and maintaining. 

          HTH

        2. Hello Hugo-

          Version 2.9 was released today.

          HTH

          1. Hi Richard,

            Great to hear that! many thanks. So no longer in snapshot and including the too-many-segments' issue.

            Nice! Many Thanks

            KR