URL Translation Module
Edition |
Incubator (services) |
||
Issues |
|||
Git |
|||
Latest |
6.2.4
|
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.
|
Installing with Maven
Maven is the easiest way to install the module. Add the following to your bundle:
<dependency>
<groupId>info.magnolia.i18n</groupId>
<artifactId>magnolia-url-translation</artifactId>
<version>6.2.4</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 | ||
---|---|---|---|
|
optional, defaults to `mgnl:page` Defines the type for the query.
|
||
|
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)
1 | nodeType |
2 | propertyName |
Page level dialog
This module expects to find the translated names of pages in an internationalized field defined by module level configuration propertyName
.
Consider an example using the MTK2 page dialog as a base: /mtk2/dialogs/pages/basic.yaml
form:
properties:
# Here we add the name field to the page properties dialog.
# Don't forget to place the property in the layout below.
name:
$type: textField
i18n: true
label: Name
title:
$type: textField
i18n: true
navigationTitle:
$type: textField
i18n: true
hideInNav:
$type: checkBoxField
windowTitle:
$type: textField
i18n: true
abstract:
$type: textField
rows: 5
i18n: true
keywords:
$type: textField
rows: 3
i18n: true
description:
$type: textField
rows: 5
i18n: true
noCache:
$type: checkBoxField
layout:
$type: tabbedLayout
tabs:
- name: tabMain
fields:
- name: name
- name: title
- name: navigationTitle
- name: hideInNav
- name: windowTitle
- name: abstract
- name: tabMeta
fields:
- name: keywords
- name: description
- name: noCache