CTSX Instant Translation

Content management Incubator

Issues

Git

Git

Latest

4.0.0

Compatible with Magnolia 6.3.

The CTSX Instant Translation module adds option (functionality) for instant translation of page/area/component.

Installing with Maven

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

In order to be able to use instant translation actions, please make sure that the core and apps modules in the Content Translation Extended have already been installed.
<dependency>
  <groupId>info.magnolia.translation</groupId>
  <artifactId>magnolia-content-translation-support-ext-instant</artifactId>
  <version>4.0.0</version>
</dependency>

Configuration

There is no need of extra configuration for this module to function properly. The only thing that this module requires is setting a default translator (defaultFlag set to "true").

Instant translation actions in the magnolia’s action bar will be shown automatically (no need of extra configuration).

instant
Please note that "instant translation actions" in magnolia’s action bar, translate the component/area/page and save translated content in the JCR.

In case there is no need to save translated content in JCR automatically, you can configure "instant translation action" on dialog level.

instant dialog

To add "instant translation" secondary action to dialog definition you need to update, dialog’s actions definitions:

commit:
  $type: commitAction
cancel:
  $type: closeAction
instantTranslation:
  name: instantTranslation
  $type: instantTranslationDialogAction
  label: "Instant translation"

and also dialog’s footer layout definition:

$type: defaultEditorActionLayout
primaryActions:
  - commit
  - cancel
secondaryActions:
  - localeSelector
  - instantTranslation

So dialog definition should look like this:

form:
  properties:
    headlineLevel:
      $type: comboBoxField
      defaultValue: small
      datasource:
        $type: optionListDatasource
        options:
          - name: big
            value: big
          - name: medium
            value: medium
          - name: small
            value: small
    headline:
      $type: textField
      i18n: true
    text:
      class: info.magnolia.dam.app.field.DamRichTextFieldDefinition
      i18n: true
    image:
      $type: damLinkField
    imagePosition:
      $type: comboBoxField
      defaultValue: below
      datasource:
        $type: optionListDatasource
        options:
          - name: above
            value: above
          - name: below
            value: below
    imageAltText:
      $type: textField
      i18n: true
    imageTitle:
      $type: textField
      i18n: true
    imageCaption:
      $type: textField
      i18n: true
    imageCredit:
      $type: textField
      i18n: true
  layout:
    $type: tabbedLayout
    tabs:
      - name: tabText
        fields:
          - name: headlineLevel
          - name: headline
          - name: text
      - name: tabImage
        fields:
          - name: image
          - name: imagePosition
          - name: imageAltText
          - name: imageTitle
          - name: imageCaption
          - name: imageCredit

actions:
  commit:
    $type: commitAction
  cancel:
    $type: closeAction
  instantTranslation:
    name: instantTranslation
    $type: instantTranslationDialogAction
    label: "Instant translation"

footerLayout:
  $type: defaultEditorActionLayout
  primaryActions:
    - commit
    - cancel
  secondaryActions:
    - localeSelector
    - instantTranslation

Configuration on content app

In the content app definition, the configuration would look like this:

  editor:
    class: info.magnolia.ui.contentapp.detail.DetailDescriptor
    subAppClass: info.magnolia.editor.app.ContentEditorDetailSubApp
    footerLayout:
      $type: contentEditorActionLayout
    actions:
      close:
        class: info.magnolia.editor.action.CloseContentEditorActionDefinition
      instantTranslation:
        label: "instant translation"
        $type: instantTranslationDialogAction
        availability:
          rules:
            isNotDefaultLocale:
              class: info.magnolia.editor.action.availability.IsNotDefaultLocaleRuleDefinition
.....
    footerLayout:
      $type: defaultContentEditorActionLayout
      primaryActions:
        - save
        - saveAndPublish
        - close
      secondaryActions:
        - localeSelector
        - instantTranslation
        - copyContent

Usage

Instant translation module uses default translator to translate properties of page/area/component to the language chosen in the language switch.

If page/area/component doesn’t have translatable (i18n=true) properties "Instant translation" action will be disabled.
instant
instant lang

How it works

  • Select a component/area/page you want to translate.

  • Select desired target language in the language switch.

  • Click "Instant translation" action.

Feedback

DX Core

×

Location

This widget lets you know where you are on the docs site.

You are currently perusing through the Content Translation Extended module docs.

Main doc sections

DX Core Headless PaaS Legacy Cloud Incubator modules