URL Translation Module

Edition

Incubator (services)

Issues

Git

Git

Latest

6.2.3

Compatible with Magnolia 6.2, 6.1, 5.7, 5.6.

The Magnolia URL Translation module builds off the previous Urltrans Module. The idea of the module is to provide a way to translate the page names in a single-tree-multi-language website.

See enabling multilanguage content for how to set up this type of website. Using the translation module together with your translated website you can internationalize your URLs.

This module is at the INCUBATOR level.

  • The class URLTranslator uses a query to locate the translated page names. Very deep hierarchies could see performance impacts.

  • Version 5.6.1 should be avoided due to MURLTRANS-6.

  • You cannot use folder nodes at the root of the workspace. The top level node must be of mgnl:page type.

  • Testing on the author instance can be tricky when using EE Pro or DX core. Without a configured domain in the site definition the multisite module will prefix URIs with the name of the site definition. In most cases this will end up as a 404. If it must be working on author then create a domain configuration. This should not be a substitute for testing on public.

Installing with Maven

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

  • Magnolia 6.2

  • Magnolia 6.1

  • Magnolia 5.7

<dependency>
  <groupId>info.magnolia.i18n</groupId>
  <artifactId>magnolia-url-translation</artifactId>
  <version>6.2.3</version>
</dependency>
<dependency>
  <groupId>info.magnolia.i18n</groupId>
  <artifactId>magnolia-url-translation</artifactId>
  <version>6.1.1</version>
</dependency>
<dependency>
  <groupId>info.magnolia.i18n</groupId>
  <artifactId>magnolia-url-translation-multisite</artifactId>
  <version>6.1.1</version>
</dependency>
<dependency>
  <groupId>info.magnolia.i18n</groupId>
  <artifactId>magnolia-url-translation</artifactId>
  <version>5.6.2</version>
</dependency>
<dependency>
  <groupId>info.magnolia.i18n</groupId>
  <artifactId>magnolia-url-translation-multisite</artifactId>
  <version>5.6.2</version>
</dependency>

Usage

By default the module will expect to find the translated names of pages in an internationalized field called name. This requires the page level dialog to be modified so that editors may be able to set the property.

Configuration

For those requiring personalized pages to have translated names the module offers the option to configure the query so that variant pages can be found. You will also need to store your translations on a property other than the default name.

In the module url-translation you will find the properties:

Property Description

nodeType

optional, defaults to `mgnl:page`

Defines the type for the query.

Changing this value can affect performance.

propertyName

optional, defaults to `name`

Defines the name of the property where the translation can be found.

Example

modules:
  url-translation:
    config:
      nodeType: mgnl:page (1)
      propertyName: name (2)

Page level dialog

This module expects to find the translated names of pages in an internationalized field defined by module level configuration propertyName. Consider this example from the MTE module. Find the translated names of pages in an internationalized field called urlName.

/mte/dialogs/pages/pageProperties.yaml
form:
  tabs:
    - name: tabMain
      fields:

        # Here we add the name field to the page properties dialog.
        - name: name
          class: info.magnolia.ui.form.field.definition.TextFieldDefinition
          i18n: true

        - name: title
          class: info.magnolia.ui.form.field.definition.TextFieldDefinition
          i18n: true
        - name: navigationTitle
          class: info.magnolia.ui.form.field.definition.TextFieldDefinition
          i18n: true
        - name: hideInNav
          class: info.magnolia.ui.form.field.definition.CheckboxFieldDefinition
          defaultValue: false
          i18n: false
          type: Boolean
        - name: windowTitle
          class: info.magnolia.ui.form.field.definition.TextFieldDefinition
          i18n: true
    - name: tabMeta
      fields:
        - name: keywords
          class: info.magnolia.ui.form.field.definition.TextFieldDefinition
          i18n: true
          rows: 3
        - name: description
          class: info.magnolia.ui.form.field.definition.TextFieldDefinition
          i18n: true
          rows: 5

actions:
  commit:
    class: info.magnolia.ui.admincentral.dialog.action.SaveDialogActionDefinition
  cancel:
    class: info.magnolia.ui.admincentral.dialog.action.CancelDialogActionDefinition

Changelog

Version Notes

Future plans

6.2.3

6.2.2

6.2.1

6.2

6.1.1

Use the aggregation state to retrieve locale.

6.1

5.6.2

5.6.1

5.6

Feedback

DX Core