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

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.

StatusINCUBATOR
TypeEnhancement
SubJar
JIRAMURLTRANS
Giturl-translation

Installation

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

<!-- Base module needed for all installs -->
<!-- Std and Pro -->
<dependency>
  <groupId>info.magnolia.i18n</groupId>
  <artifactId>magnolia-url-translation</artifactId>
  <version>${urlTranslationVersion}</version>
</dependency>

<!-- Multisite extension needed for EE Pro -->
<dependency>
  <groupId>info.magnolia.i18n</groupId>
  <artifactId>magnolia-url-translation-multisite</artifactId>
  <version>${urlTranslationVersion}</version>
</dependency>

Versions

5.6.2Magnolia 5.6
5.6.1Magnolia 5.6
5.6Magnolia 5.6

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

(warning) Added in v5.6.2

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:

nodeType

optional, defaults to mgnl:page

Defines the type for the query. Changing this value can effect performance.

propertyName

optional, defaults to name

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


Here we see an example for personalization.

modules:
  url-translation:
    config:
      nodeType: mgnl:content
      propertyName: urlName

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

/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

Migrating

For those coming from the older version of the module I would suggest that you uninstall that module before moving to 5.6.

  1. Delete the filter /server/filters/cms/urltrans
  2. Change the class property of /server/rendering/linkManagement
    • Community and EE std: info.magnolia.link.LinkTransformerManager
    • Pro: info.magnolia.multisite.MultiSiteLinkTransformerManager
  3. Change the class property of /server/rendering/linkManagement/transformers/absolute
    • info.magnolia.link.AbsolutePathTransformer
  4. Remove the module(s).

Warnings

  • This module is at 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 - Getting issue details... STATUS .
  • Testing on the author instance can be tricky when using EE Pro. Without a configured domain in the site definition the multisite module will prefix URIs with the name as the site definition. In most cases this will end up as a 404.

Changelog

  • Version 5.6.2
    • MURLTRANS-6 - Getting issue details... STATUS
    • 30% Test coverage added.
  • Version 5.6.1
  • Version 5.6 - Initial release of the extensions version of the module.